Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Interview Stories: Should Your Code be Doing THAT?

DZone's Guide to

Interview Stories: Should Your Code be Doing THAT?

A really fun exercise for a coding interview is to invalidate a certain assumption, and see how the candidate handles that. Seeing how a candidate interacts with their own code in this way is enlightening.

· Agile Zone ·
Free Resource

RavenDB vs MongoDB: Which is Better? This White Paper compares the two leading NoSQL Document Databases on 9 features to find out which is the best solution for your next project.  

We require all candidates to do a coding test before we invite them to an interview.

The purpose of the coding test is to get some idea about the way the person thinks, and to see what they can do. Often, we don’t really care about the actual solution that was sent, because the point isn’t to solve the problem in the “best” way. The “best” way is highly dependent on many factors (are we trying to optimize for readability, speed, memory consumption, etc.)?

But what I find most interesting is when we confront a candidate with their own code. Typically we have certain remarks, because even if the code is great we can change whatever it is that we are trying to get ("this is highly readable code, but we care about performance here, what would you do if we wanted…?").

A really fun exercise is to invalidate a certain assumption, and see how the candidate handles that. This is typically done on:

You called int Read(byte[] buffer, int start, int count) and you assumed that it will fill the entire buffer, but it will give you only as much as it has available right now. Your code needs to handle that. What needs to be changed?

Seeing how a candidate interacts with code is much more enlightening, especially because this is code that the candidate wrote, so they are familiar with it.

Do you pay to use your database? What if your database paid you? Learn more with RavenDB.

Topics:
interview questions ,interview tips ,interviews

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}