Skip to main content

The REACT Method.

The five-step framework I follow in every coding interview.

Last updated

On this page

In coding interviews I follow a framework I call the REACT method:

  1. Repeat and clarify
  2. Edge cases
  3. Approach
  4. Code
  5. Test

R: Repeat and clarify

I repeat the question back to the interviewer, then ask clarifying questions until I fully understand the problem.

E: Edge cases

I discuss any edge cases I can think of, and talk through how I'm going to handle them, or how the interviewer expects me to handle them.

A: Approach

I discuss at least two approaches, starting with the brute force.

Clearly outlining the brute force first helps me understand how to optimise. Once it's laid out, I can see the bottlenecks, and that's what gets me to something more optimal.

C: Code

This is where I actually code out the solution, talking through everything as I write it.

T: Test

I dry run my code: take a test case and go through the code line by line, to show exactly how it would work with that input.

  • First, a normal example.
  • Then the edge cases, including all the ones I outlined back in step E.

Testing the edge cases I raised at the start shows attention to detail. Once that's done, I ask the interviewer if they want me to go through any other test cases, and that's pretty much it.

All five steps happen out loud. Why that matters so much is in Communication.