I've been a software engineer for 24 years. I've never ever needed to write a binary search function.
This is ridiculous I've been a binary search tree for 30 years and never once have I had a software engineer traverse me.
Interview: Search a binary tree. Job: Please make CTA blue, client said her favorite color is blue.
This interviewer giving a lot of guidance. I’d be grateful to have him. Other interviews don’t really do that
1. Read the question twice. Look at the examples. 2. Clarify the details of the definitions. In this case what is a "successor" 3. Clarify the constraints. 4. Determine edge cases 5. Choose an algorithm associated with the question. e.g. trees -> inorder, pre-order, post-order, bfs, dfs. 6. Implement the naive solution and discuss time and space. Write clean code. 7. If time talk about how you will improve the solution and implement if you can.
As a software engineer, I swear the only time questions like these matter are in college. Maybe interview for top 5 percent of jobs, but the other 95 percent definitely not going this in depth. Companies need bodies not rainman.
I've been a software engineer for 25 years. I have interviewed TONS of prospects. I've NEVER had them code without using a compiler. Typically, I would just come up with a project, give them the directions and let them sit in front of a computer for one hour and hammer it out the way they normally would. They get the compiler, internet, whatever they need. Now, given that, I do expect o see much better code than what would be written in notepad :) As long as they can then thoroughly explain their project to me I'm good with it.
10 years in the industry and I echo what others have said here. There is no particular reason to know how to solve this problem from memory. However being able to work through it is the real test here. If I were ever to sit over someone for a coding interview like this, I wouldn't really be looking for the correct solution, rather the approach and how long the individual stick with it.
this is one of those interviews where you can get the interviewer to give you the answers because it makes them feel smart. so easy
My biggest advice for interviews like this "communication is key".. speak with the guy who is interviewing you say what you think. It gives the guy an idea on how you think. Most of the time it is not about the technical knowledge itself but how you handle it.
95% of devs will never need this. The real question is how well can the devs take requirements and create an effective solution.
Majority of software engineers never work on these nonsense in day to day work
During Bloomberg technical rounds, the person being interviewed isn't usually asked to compile the code
Engineers in this video: let's do some real algorithm work to get hired Founders of 95% products: I need to integrate Stripe with WordPress
*Code runs successfully* Him: cool Interviewer: cool. *leaves the meeting*
It seems like they’re interviewing each other. I think it was more of a collaborative problem solving exercise
These kinds of cliche questions are never ever used in real-life situations. You can literally learn by heart those types of things and pass any interview with breeze but have no idea what you're doing otherwise.
So I need a cheaufeur to drive me around: skills required are, mechanical engineering to build the limo each time I need a lift to the office.
maybe he is hiring for a "binary tree interviewer position" that is why they are discussing binary trees.
@KeepOnCoding