Hacker News new | ask | show | jobs
by rakejake 1169 days ago
Interviewed onsite at a company where I was asked some leetcode-medium binary tree problem. This was a well-known company with easily available lists of frequently asked interview questions you can find online. Luckily, I had solved this exact problem a few days back.

Unfortunately, this problem has an easy and ultra-straightforward solution using deques with O(N) space complexity, and an another slightly tricky solution with O(1) complexity. I had spent some time the other day cracking this O(1) solution. I decided that I would take the risk of reproducing the tricky solution and wow the interviewers.

Naturally, I didn't. I got confused and had to start from scratch several times. And the interviewer kept hinting that I could use a data structure to make this simple, but stubborn me thought I was just minutes from a working perfect solution.

I deeply internalized the saying "Perfect is the enemy of good" after I was marched out of the building after only two interviews instead of the usual 4. I've had my fair share of interview bombs but I consider this the worst because I was lucky enough to have faced a problem I had solved recently, and for which the interviewer was willing to accept the easier solution, and yet I managed to nuke it to oblivion.