Chapter 4.3: Programming exercise interview

What is programming exercise interview?

A programming exercise section is where the candidate is given a technical problem and asked to write a functioning, error-free code on their own, within a specified time limit, without any help from the interviewer, such that it solves the given problem. Unlike a whiteboard exercise, the candidate is required to provide a fully functioning code and not a pseudo-code, or a code that can have some errors. Another difference from whiteboard is that the candidate writes the code with no help or discussion with the interviewer. For programming exercise section, the interviewer is instead a facilitator whose work is to ensure that the candidate is provided a platform where they can code without running into any issues. The goal of the programming exercise section is to verify that the candidate can develop a production level code on their own, that solves a provided problem statement.

What to expect at programming exercise interview?

The programming exercise begins with interviewer setting up a work environment for the interviewer and explaining the rules of the interview section. A problem decription is provided to the candidate for which the candidate must code a solution. Mostly, the problem statement is not modified after it is given. Once this is done, the interviewer hands off the work environment to the candidate, which starts the timer for the section. Some tests may also be provided to verify that the code provided by the candidate achieves the desired goals. The interviewer does not interfere, except probably to notify the candidate on how much time is left, or helping out with any unexpected issues. They also do not discuss the problem / solution / code architecture with the candidate. For the programming exercise section, since the goal is to ensure that the candidate can be a productive developer, so they are also generally allowed to look up documentation on internet, like, using search engines, or StackOverflow, etc., because documentation lookup is something that developers often do in routine work. Once the time runs out, the interviewer collects the work environment back from the candidate.

Preparations / Things to consider

This section covers some of the preparations / things-to-consider for the programming exercise interview.

Considerations similar to ones used in whiteboard

Identify data structure and algorithm before coding

For programming exercise, the first emphasis is to ensure that you provide a working code with correct syntax and which is able to achieve perform expected operations. Let's say that you provide a code but using a naive algorithm full of repeated action and almost not data structures. This would almost definitely signal you as NOT being a viable candidate for a software engineer position. However, if you are able to identify the data structures to use and an improved algorithm, and mention it in your solution (for example, as comments), then that counts as a positive! Even better though, would be if you can spend a few minutes trying to identify the best approach to solve the problem before you start coding. Maybe give yourself ~5 minutes, and in this time, if you can identify the optimal algorithm and code using that, then it would make you stand out as a really good candidate. If you do so, then also add a small code comment summarizing your thought process. This helps convey your thought process to the interviewer since they wouldn't be directly interacting with you.

Aim to write production level code

If you ask your interviewer on whether there's any guidance on code style to use, it is very likely that you'll receive an answer like "do as you feel best" or "do similar to as in your most recent job". In reality though, you should interpret it as "write a code such that it will be reviewed by your peers and eventually deployed to production". Hence, an emphasis should also be put on ensuring code readability and maintainability rather than just writing a giant code.

Things to observe during the interview

Every thing up to now has been about how you should be ready for a programming exercise interview. However, an interview is a two-way communication! This means, you can, and should also observe the interviewer to get a glimpse of workplace culture. There are common points that can be observed in all interviews and they are discussed in a later chapter.