For any given problem asked in such interviews there is certainly one correct implementation and if you believe otherwise you are not providing sufficient information to answer such a question.
> Understanding the choice you make and can support is the point of coding interviews. That's why they're so often done in pseudocode and/or on the whiteboard. > If you can look stuff up you're not demonstrating a knowledge of the fundamentals. If you don't understand complexity and optimization, you will make mistakes even if you can look stuff up later. > That's why these companies do these.
Honestly? This is part of the rant I was trying to avoid.
1) I've met developers that claim SHA-1 is a secure choice in 2017 and make other facepalm worthy claims that 5 minutes of research would have told them was a bad idea.
2) We've fired quite a few people who believe as you do precisely because they are so convinced they understand the fundamentals they don't look things up and make costly mistakes.
3) I've met accountants who can't correctly handle a 4-4-5 calendar that is integral to their jobs without looking things up. Similarly, I've met ones like you that genuinely believe they've memorized the "fundamentals" and repeatedly failed waste thousands of dollars.
4) I honestly believe anyone who refuses to look things up to double check is fundamentally incompetent. We all make mistakes and the only way to appropriately minimize them is to double check (i.e look things up) before hand and have someone else review it afterward.
5) I genuinely do not want to work with anyone who does not do #4. Ever. The sheer number of times they've attempted to shift blame onto other people before they were fired is simply not worth the hassle.