"Interview is an artificial reality designed by companies to keep people out" - Manager ToolsMany companies won't offer helpful feedback on your interview performance. I think that feedback is a fair game, and the process should be transparent.
PseudocodeThis is a follow-up on the older post, Interview Insider: Coding fluency. A reader asked my opinion on using pseudocode to document his thoughts while working on the solution. Specifically during a phone screening, when diagramming may not be a possibility.
The choice of which notation is best depends upon which method you are most comfortable with. I usually prefer to describe the ideas on an algorithm in English, moving to a more formal, programming-language-like pseudocode or even real code to clarify sufficiently tricky details.
A common mistake my students make is to use pseudocode to dress up an ill-defined idea so it looks more formal. Clarity should be the goal.
Clarity is the goal indeed. There could be cases when using pseudocode is justified. However, I think those are rear.
I recommend sticking to the plain English (and diagramming, when you can) until the solution is crystal clear. It’s also easier for your interviewer to understand. Note that you need to make sure that your interviewer is OK with your solution before coding.
Using pseudocode (same as actual code) prematurely can send you wrong way, and you will waste extra time digging yourself out. I noticed that if I stay on a higher level, I generate more creative ideas. The interview has two-parts: head-up, when you look for solutions, discuss, and debate. And then head-down, when you demonstrate your ability to implement the agreed solution quickly and accurately.
Finally, interviewers in big companies typically offer you to code in the language of your choice, and pseudocode is considered as a red flag. E.g. the candidate could be rusty in coding or trying to obscure “an ill-defined idea”. In the end, if you code every day, it should be even faster to code in your language than in pseudocode.
- The Algorithm Design Manual on Amazon.
Post a Comment