How do I write code without bugs in interviews? : learnprogramming
In my experience, interview questions are usually not about writing bug free code, but rather being able to explain your thought process and demonstrate problem solving ability. Since you can't compile and test your code, no reasonable interviewer would expect completely bug free code.
A good interviewer will raise questions about bugs that they notice in hopes that you'll realize for yourself that there's a bug. Walk through your code and explain what the values of variables will be at each point to help find bugs here.
Most minor syntax errors will be ignored in whiteboard programming. These problems are focused towards problem solving and it's implied that you'll be able to figure out things like missing semicolons when you compile.
You and the interviewer should be agreeing on a language before hand. If it's pseudocode, requirements are lax, so you wouldn't have to worry about things like data types there. In fact, pseudocode almost never mentions primitive types, as they can be determined from context.
Read full article from How do I write code without bugs in interviews? : learnprogramming
No comments:
Post a Comment