DEV Community

Timevolt
Timevolt

Posted on

The Interview Matrix: See Your Thought Process in Code

The Quest Begins (The "Why")

I still remember my first technical interview like it was yesterday. I sat down, the interviewer popped up a simple array‑pair‑sum problem, and my brain went blank. I started typing furiously, hoping the code would speak for itself. Thirty seconds later I realized I’d written a solution that didn’t even compile, and the interviewer was staring at me with that polite “I’m waiting for you to explain” look. I felt like Neo dodging bullets in The Matrix—except I was the one getting hit, and I had no idea how to see the code’s flow.

After that cringe‑filled session I promised myself I’d never let silence be my answer again. The problem wasn’t my algorithm skills; it was that I wasn’t showing my thinking. Interviewers aren’t just looking for a correct answer; they want to watch you wrestle with the problem, make decisions, and adjust on the fly. If you can let them peek inside your head, you turn a stressful Q&A into a collaborative puzzle‑solving session.

The Revelation (The Insight)

The game‑changer for me was a tiny, repeatable script I now call the WWH framework:

  1. What I’m about to do.
  2. Why I’m choosing that approach.
  3. How I’ll implement it (the next concrete step).

I literally say those three words out loud, then fill in the blanks. It forces me to verbalize my reasoning before I dive into code, and it gives the interviewer a clear trail to follow.

Here’s the exact phrasing I use (feel free to steal it verbatim):

“First, I’m going to [what], because [why]. To do that, I’ll [how].”

That’s it. No jargon, no rambling—just a compact narrative that maps directly onto the next lines of code you’ll write.

Wielding the Power (Code & Examples)

The Struggle (What NOT to do)

Imagine the candidate tackling the classic Two Sum problem (given an array of integers and a target, return indices of the two numbers that add up to the target). A common silent approach looks like this:

def two_sum(nums, target):
    seen = {}
    for i, n in enumerate(nums):
        complement = target - n
        if complement in seen:
            return [seen[complement], i]
        seen[n] = i
Enter fullscreen mode Exit fullscreen mode

The code is fine, but the interviewer hears nothing but keyboard clacks. They have no idea why you chose a hash map, whether you considered a brute‑force scan, or if you’re even aware of edge cases like duplicate numbers.

The Victory (Using WWH)

Now watch how the same solution unfolds when I narrate with WWH:

“First, I’m going to store each number’s index in a hash map, because looking up a complement is O(1) and avoids the O(n²) brute‑force check. To do that, I’ll iterate through the list, compute the complement, and see if it’s already in the map.”

def two_sum(nums, target):
    # First, I'm going to store each number's index in a hash map,
    # because looking up a complement is O(1) and avoids the O(n²) brute‑force check.
    # To do that, I'll iterate through the list, compute the complement,
    # and see if it's already in the map.
    seen = {}
    for i, n in enumerate(nums):
        complement = target - n
        if complement in seen:
            return [seen[complement], i]
        seen[n] = i
Enter fullscreen mode Exit fullscreen mode

Notice how the comment block mirrors the spoken WWH script. The interviewer now hears my reasoning before I write a single line, sees the logic translate directly into code, and can ask follow‑ups (“What if the array had negative numbers?”) with confidence that I’m tracking the whole picture.

Common Traps to Avoid

Trap What it looks like Why it hurts WWH fix
Over‑explaining “Um, I think maybe we could… I guess we could try a hash table? Or maybe sort first? Actually, I’m not sure… ” Shows uncertainty, wastes time, obscures the plan. Commit to one clear what and why before you code.
Going off‑topic Talking about your favorite framework while the interviewer waits for the algorithm. Distracts from the problem, signals poor focus. Keep the how tightly coupled to the immediate next code block.
Silent coding Typing without any verbalization. Interviewer can’t assess your thought process. Insert a WWH sentence before each logical chunk (e.g., before the loop, before the return).

Why This New Power Matters

When you adopt WWH, you transform the interview from a monologue into a dialogue. The interviewer gets to see:

  • Clarity of thought – you can articulate trade‑offs before you code.
  • Confidence – you’re not guessing; you’re stating a justified plan.
  • Adaptability – if they propose a twist, you can instantly adjust your what/why/how and show you’re thinking on the fly.

In my own interviews after learning this trick, I went from “I think I got it?” to “Let’s walk through this together,” and the feedback shifted from “needs more communication” to “great problem‑solving communication.” It’s like finally seeing the green code rain in The Matrix—you perceive the underlying structure and can navigate it effortlessly.

Your Next Quest

Pick a simple problem you’ve solved before (maybe palindrome check or Fibonacci). Grab a rubber duck, a friend, or even record yourself on your phone. State your solution using the exact WWH sentence before you write any code, then code it out loud. Notice how the commentary guides your typing and how much easier it feels to explain each step.

Challenge: Try it on your next practice problem and share your WWH script in the comments. Let’s see how many of us can turn silent coding into a thoughtful conversation—one “what, why, how” at a time!


Now go forth and make your thought process visible. The interviewers are waiting to see the wizard behind the code.

Top comments (0)