Over a million developers have joined DZone.

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

Learn more about how DevOps teams must adopt a more agile development process, working in parallel instead of waiting on other teams to finish their components or for resources to become available, brought to you in partnership with CA Technologies.

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.

Discover the warning signs of DevOps Dysfunction and learn how to get back on the right track, brought to you in partnership with CA Technologies.

Topics:
interview questions ,interview tips ,interviews

Published at DZone with permission of Ayende Rahien, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}