DEV Community

Cover image for Your approach to code exercise interviews has always been wrong
Giovanni Trematerra
Giovanni Trematerra

Posted on • Originally published at trematerra.me

Your approach to code exercise interviews has always been wrong

The right mindset to give your best

The time has come, as you open your laptop and launch the video-conference software you have been instructed to use, you start the call and boom. The interview that can change your life starts, you feel nervous, not sure what they will ask you and if you remember all the answers. You prepared yourself for this a lot. You read a lot of books about algorithms, data structures and exercises on pointers because after all is not what they ask all the time? Is not that what they are going to evaluate you on?
You can nail your code exercise interview by using the best algorithm you learned and be done in less than 5 minutes without saying a word.
The interviewers don't look impressed and ask you a lot of follow-up questions and you start wondering what you did wrong.

--

Let's take a step back. You have 45 minutes to show your best likewise the interviewers have 45 minutes to understand what you can bring to the company. What are they looking for to have a good evaluation of you, to figure out if you are a person they would like to work with?
They want to figure out how you would approach a problem you are not familiar with.

Talk a lot

Let's face the truth. Forty-five minutes are not a lot of time and being silent is not the best use of the time available. Before start doing anything, tell them how you are going to approach it. Voice any doubts you have and explain why you changed strategy if that happens. Changing your mind is not a sign of weakness is a sign of an open mind.
No one knows everything or remembers everything. If you don't remember something then ask for help, if you have any doubt or got stuck ask questions to unblock yourself, don't wait for the interviewer to give you hints or advice.

Offer multiple solutions

A coding exercise is nothing close to real life; most of the time, there is no silver bullet. It is important to clarify why you are picking a specific solution and offer others based on different tradeoffs. Think about the scalability or complexity of your solution and try to offer a potential strategy to address them later while you get a working solution first.

Don't let the perfection ruin everything

It should be clear that a perfect solution is not something to strive for. Start always with a naive one and improve it until you run out of time or ideas. Offer suggestions on how your code will be tested ahead of time. Pay attention to all potential edge cases and always test the preconditions.

Closing

A working solution is expected but it is not the most important part of a coding interview. The journey from the exercise asked and the working solution is.
Next time you will find yourself preparing for a coding interview not only refresh your memory on algorithms and data structures but train yourself to get into the right mindset and that means to start small, pay attention to the details, include the interviewers in your team as you all are part of a team.

Top comments (0)