In today's tech industry, these algorithm questions is now used as an effort to trip up candidates and to always try to "See how you think" in an unrealistic scenario. The questions I've been given and have seen are mostly irrelevant and are always done for us in the libraries I use at work.
I had interviewed at one startup in the UK who asked me a algorithm question that they admitted that they don't use and their excuse is the same: "To see how you think." Not only this doesn't make sense if one has already seen this problem, but the fact that they don't use it makes you wonder the real reason why they are doing this.
The simple answer is: Because it works for FAANG (Who actually do use these algorithms); Thus everyone else copies them. This is why hiring in this industry is a complete circus.
> Things like improper syntax and not getting the damned recursive solution fast enough.
A problem statement like that is like: `Design and implement the optimal solution to this 'problem' in X language in less than 15 minutes.`
This is a red flag for you as a candidate who is allowing room for the interviewer to nit-pick you here to waste your time. It should never be that important to worry about the specific language semantics here due to the time limit. But again the interviewer is there to be impressed on how much the candidate knows about the intricate details of the language + data structure + algorithms all in 15 minutes which is nonsensical requirements for a typical software engineering role.
Frankly speaking, the interview dance in the tech-industry is an excuse to trip up candidates who have not practiced for more than 6-9 months on data structures and algorithms and the latest tools that everyone is adopting. It is so 'broken' that interviewing at FAANG companies is an entire industry itself.
For them, whiteboarding like this is essentially trying to find a silver needle in the sky.