u/michaelnovati replied ·
Lots of the commenters are commenting on the specific question, I can comment on why these questions are asked in interviews. I did hundreds of interviews at FB, trained interviewers, and people I work with now have also done hundreds of interviews and trained interviewers at FB.
So the TLDR: goals is consistent interviews, environments and questions any engineer can do, and extracting best signal quality possible in several areas.
I can speak to the FB philosophy on this. Over a set of different types of interviews a company is collecting a bunch of "signals". They are trying to get the highest quality "signal" they can from an in interview, which means the interviewer can confidently compare what they observed to dozens of other people who have done the same interview. An analogy to this is cell phone receptions. The quality of the signal is different from the connection speed. You might have a full five bars, and a slow connection, or only a few bars but a very high (but maybe inconsistent) speed. The signal strength + the speed are both important to note, and not just one or the other. If you don't have consistent way of measuring signal strength and speed, then you can't even have a discussion comparing different signals.
For coding interviews, determining the solution to a problem is one important signal, but other signals are much more important for a senior candidate. Senior engineers tend to do a little worse on the harder "leetcode" problems, but they do better overall in a coding interview . The "did they have the best solution to hard problem signal" might be a bit worse, but the "clean code signal" will hopefully be much higher, even if the solution was wrong! I've seen director level candidates cramming leetcode because they were so nervous for their coding interview and then crumble at a simple reversing a linked list!
Happy to discuss more!