How to pass a live coding interview?
The key concept of the game, you can clarify questions to understand what you need to meet the expectation.
Logic questions
Read the task carefully. Don’t hesitate to ask any logic related questions.
- Ask whether you need to provide an algorithm before the coding.
- Ask about edge cases. Do you need to handle them? Do you need to write tests for edgecases
- Should algorithm be optimized. What’s the desired complexity?
Time
Ask how much time do you have for coding. What happens if you don’t fit in time?
Outputs
Clarify which outputs they value. What’s the expected output of the coding interview? Do you need to solve the issue? Do you need to prove that you produce a good quality code. We both know that’s quality code requires time. Some interviews will cross you out if you don’t fit in time. Some of them will if your code is barely readable but get you through if it’s working.
Time limitation
If you are limited by time I would recommend prioritizing the successful output and only then sanitize the code.
Googling
Ask which things exactly you can google and whether you can google at all. Can you use stackoverflow? Can you use official documentation?
Learn basic language syntax.
Even if googling is permitted, you still present less impression each time you google something trivial. For example ES6 has arrays has useful methods like at, some, reduce
Use debugger
Use debugger wisely. Remember that it’s a powerful tool that allows you:
- set conditional breakpoints
- change variables during runtime
- evaluate any expression during runtime
- pause code during infinitive loops
- go up and down during the functions call stack.
Use IDE
If you are forbidden to use google, you can always use your IDE’s documentation VSCode or JetBrains has builtin docs. You should master those before the int
When you’re stack
Have a deep breath and read slowly what you need to do. Try to start writing code with simple constructions. Extract more variables and use your debugger to view more middle results.
Get yourself prepare
It’s not gonna be a surprise that you have to prepare for the interview by solving lots of algorithmic problems on sites like letcode. But a few people mentioned that the main preparation would be passing those kind of interview. Don’t put everything at stake for a single position on some specific company. Keep in mind that’s the most valuable thing from the interview you can get is information about yourself. And what you exactly need to get the next interview go smoothly.