Member-only story
The Step-by-Step Guide to Answering a Technical Question in a Coding Interview
Repeat, examples, approach, code, test, and optimization

If you’ve ever taken a behavioral interview, you’ve probably heard of the STAR method (Situation, Task, Action, Result). REACTO is the coding version of this. There is an excellent video I’ve linked below that goes over the REACTO approach. Definitely worth watching. But real quick, here’s what REACTO stands for:
Repeat the question
Examples
Approach
Code
Test
O, as in Big O
The important thing to notice is that coding isn’t the first step. It’s not even in the first half of the steps— it’s step 4. And I cannot stress this enough: Do not just start coding right off the bat.
When you are studying, it’s OK to jump in, but for the actual interview, this is a big no-no.
You must explain your approach first. And yes, I know, it’s not natural to do this, which is why you have to practice doing it. Just like you practice the coding. Just like you practice your behavioral questions.
So once you feel comfortable coding the solution to a problem, practice answering it in REACTO format.
We’ll go into more depth here with an example.
Explain Your Approach Before Coding
Your code is only as good as the extent to which you can explain it. Remember, the interviewer isn’t just assessing the correctness of your code. A computer could do that just fine. The reason you have an actual human being assessing you is that they can see how well you think, communicate, collaborate, and work with someone — just like you would have to in the real job.
Let’s go over the classic Two Sum problem:
Two Sum problemGiven a list of numbers and a target number, return two numbers that add up to the target.
Here’s what I would say first.