When you're taking online assessments or doing live coding interviews, you might think that the only thing that matters is whether or not the test cases pass. In some cases, this is true. But most of the time, the company is less interested in the solution and more interested in how you arrived at it. 🧠
You have to prove:
- You understand the question
- You understand the solution to the question
- You understand that there are multiple approaches (and what the tradeoffs are)
Luckily, there are frameworks you can use that make it MUCH easier to hit all these points. We'll go over one in this lesson called REACTO.
What is REACTO?
REACTO is an acronym.
R - Repeat the question
E - Examples
A - Approaches
C - Code
T - Test
O - Optimize
It outlines a simple path for you to follow as you tackle any algorithm-style question, whether it's in an online assessment or during a live technical interview.
If you follow the steps, you'll give yourself a great chance at not only successfully answering the question, but also clearly showing your thought process.
Watch the video below to get a complete breakdown of the framework.
And then read the full article from Fullstack Academy for even more information.
Aside from following the REACTO framework, here are a few other things you can do to put yourself at an advantage and help you stand out from other candidates.
Comment your code
This tip gets tossed around all the time but we rarely see anyone actually do it. As you solve algorithms for online assessments, write descriptive comments about what you're doing and why.
This helps code reviewers understand your decision making. And if you ever have to revisit, explain, or defend your code later on then these comments will make it much easier for you to remember your own thought process.
Solve first, optimize second
A lot of candidates get hung up trying to figure out the most optimal solution.
And then they run out of time.
As you try to pass online assessments, your first goal should be to solve the problem and get the test cases to pass. Even if you have to brute force it.
For online assessments, a 10/10 brute force solution is better than a 0/10 unfinished solution.
If you're in a live interview, ask your interviewer for their preference. They might prefer that you spend the entire time working toward the optimal solution -- but some might prefer that you get the test cases to pass and then spend the remainder of your time talking about alternative approaches.
There's no one-size fits all answer because all interviewers are different, but you can't go wrong if you're friendly and communicative.
Above all, don't get frustrated! Stay calm, cool, and collected even in the face of pressure. Remember, you're trying to show your interviewers that you'll make a great teammate.
Use descriptive variable names
Descriptive variable names make your code more human-readable.
This makes it easier for an interviewer (or for your future self) to follow the logic of your code as they read through it.