The point of coding questions is to determine how well you can code. Itâs the most important part of the interview because the code you write and the answers you give to the interviewer largely determine whether he recommends you for the job.
You usually work one-on-one with your interviewer. He will give you a marker and a whiteboard (or pen and paper) and ask you to write some code. The interviewer usually wants you to talk through the question before you start writing. Generally, you are asked to code a function or method, but sometimes you need to write a class definition or a sequence of related code modules. In any case, you write code, either in an actual programming language or in some form of pseudo-code. (The closer you can get to actual working code, the better.)
The problems the interviewers give you have specific requirements. They must be short enough to be explained and solved reasonably quickly, yet complex enough that not everyone can solve them. Therefore, itâs unlikely that youâll be asked any real-world problems. Almost any worthy real-world problem would take too long to explain, let alone solve. That isnât an option in an interview. Instead, many of these problems require algorithmic tricks or uncommonly used features of a language.
The problems often prohibit you from using the most-common way to do something or from using the ideal data structure. For example, you might be given a problem such as this: âWrite ...
Get Programming Interviews Exposed: Secrets to Landing Your Next Job, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.