Hacker News new | ask | show | jobs
by paladin314159 2490 days ago
FAANG interviews aside, I find the idea of having a mental model before you write code extremely helpful. It's a lot easier to understand the purpose of individual functions and how things should interface with each other if you do. It won't be perfect at first, but the more you can get right in the first stab the better.

Your ability to build that mental model depends on both your experience/skill and the complexity of the problem. For simple problems, a more senior engineer might be able to come up with a mental model instantly because it's similar to lots of things they've done before. For really complex problems, it probably takes everyone a long time to build the correct mental model and you'd want to balance that with what you can figure out by diving into the implementation.

My guess would be that the interviewers' line of thinking is that if you couldn't build a mental model for a problem quickly, that means you're not proficient with problems like that. Which is probably true, but opens up the question of whether the interview is testing the right type of problem, of course.

1 comments

> ...it probably takes everyone a long time to build the correct mental model

To be fair, 90% of most business logic is simple and straightforward, and should be written that way.

The real test of a senior engineer is to quickly see the hard 10% that isn't straightforward, and to design the rest of the system to minimize the effects of the complexities introduced by the hard 10%.