Mock Interview Guide โ Think Aloud, Code Reliable, Optimize Smart¶
Goal: Develop a repeatable "method" so every interview feels familiar, not scary.
The 4-Phase Framework โ "URPO"¶
| Phase | Letter | What you do |
|---|---|---|
| Understand | U | Restate the problem, ask clarifying questions |
| Reason | R | Discuss approaches out loud, pick one with trade-offs |
| Produce | P | Write clean, working code |
| Optimize | O | Analyze complexity, improve, test edge cases |
PHASE 1: UNDERSTAND (Don't skip this โ 2-3 minutes)¶
What to do¶
- Repeat the problem in your own words.
- Ask 2-3 clarifying questions:
- Input size? (10? 10 million?)
- Are there duplicates / negatives / nulls?
- Sorted or unsorted?
- What should we return for empty input?
- Give 1-2 examples with input โ output.
- Discuss edge cases before coding.
Phrases to use¶
- "Let me make sure I understand..."
- "Can I assume the input is always valid?"
- "If the input is empty, should I return 0 or throw an error?"
- "Let me walk through a quick example to confirm."
PHASE 2: REASON (5 minutes)¶
What to do¶
- Brute force first โ say it out loud. Don't be shy.
- State the time/space complexity of brute force.
- Identify the pattern (Sliding Window? DP? Two Pointers?).
- Propose a better approach and explain WHY it's better.
- Get buy-in before coding: "Shall I go ahead with this approach?"
Phrases to use¶
- "The brute force would be O(Nยฒ) โ let me see if I can do better."
- "This looks like a sliding window pattern because..."
- "I can use a HashMap to bring lookup down to O(1)."
- "Does this approach work for you, or should I explore another?"
PHASE 3: PRODUCE (10-15 minutes)¶
Coding Rules¶
- Talk while coding โ narrate every 2-3 lines.
- Use meaningful names:
left,right,count, nota,b,x. - Write the skeleton first, then fill in logic.
- Don't go silent for more than 30 seconds. If stuck, say: "Let me think out loud here."
Reliability checklist (while coding)¶
- Initialize variables clearly.
- Handle null / empty inputs at the top.
- Use guard clauses for edge cases.
- Avoid magic numbers โ use constants.
Sample narration¶
"I'll start by defining two pointers โ left at 0, right at end. Then I'll loop while left is less than right. Inside, I'll check the sum. If it's equal to target, I return both indices..."
PHASE 4: OPTIMIZE & TEST (5 minutes)¶
What to do¶
- Walk through the code with the example you used in Phase 1.
- Trace through line by line โ values of variables at each step.
- State final complexity: "Time is O(N), space is O(1)."
- Suggest improvements: "If we needed to handle streaming data, we'd switch to..."
- Mention edge cases tested: empty, single element, all duplicates, negative numbers.
Phrases to use¶
- "Let me dry-run this with input [1,2,3]..."
- "Time complexity is O(N log N) because of the sort, space is O(1)."
- "One trade-off: this uses extra memory for the HashMap. If memory is tight, the two-pointer approach would be better."
COMMON MISTAKES (and how to avoid)¶
| Mistake | Fix |
|---|---|
| Jumping to code immediately | Force yourself: Understand โ Reason โ Code |
| Going silent | Even "I'm thinking" is better than silence |
| Writing perfect code in one shot | Skeleton first, refine later |
| Forgetting edge cases | Always test: empty, 1 element, max size |
| Saying "I don't know" | Say "I haven't seen this, but here's how I'd think about it..." |
| Ignoring interviewer hints | Hints = gifts; pause and incorporate them |
RELIABILITY TIPS (Code that doesn't break)¶
- Always check for null / empty before accessing.
- Off-by-one errors: Be precise with
<vs<=,i+1vsi-1. - Integer overflow: For large numbers, use
long(Java) or know Python handles bigints. - Avoid mutating input unless asked.
- Test with 3 inputs: normal, edge (empty/1 elem), large.
OPTIMIZATION CHECKLIST¶
After getting working code, ask yourself:
- Can I reduce time?
- Sort first? (O(N log N) opens up two-pointer / binary search)
- HashMap for O(1) lookup?
-
Memoization to avoid repeated work?
-
Can I reduce space?
- In-place modification?
-
Use 2 variables instead of array (Fibonacci-style)?
-
Is there a better algorithm pattern?
- DP instead of recursion?
- Sliding window instead of nested loops?
BEHAVIORAL ROUND โ STAR Method¶
For "Tell me about a time when..." questions, use STAR: - Situation: Context - Task: What needed to be done - Action: What YOU did - Result: Outcome (with numbers if possible)
Example: "Tell me about a challenging bug you found"¶
S: At Questt, we had a flaky test that passed locally but failed in CI 30% of the time. T: I needed to find the root cause so the release wasn't blocked. A: I added retry instrumentation, checked logs, and found a race condition in the API setup. I refactored to use Playwright fixtures with explicit waits. R: Flakiness dropped to <1%, and release confidence improved.
MOCK INTERVIEW PRACTICE PLAN¶
Week 1: Solo¶
- Record yourself solving 1 problem per day.
- Watch it back. Identify silences > 30 sec.
Week 2: Peer¶
- Use Pramp, Interviewing.io, or a friend.
- Do 3 mocks per week.
Week 3: Real-feel¶
- Use timed sessions (45 min).
- Solve on a shared screen / whiteboard, not your usual IDE.
QA-SPECIFIC INTERVIEW QUESTIONS TO PREPARE¶
- "How would you test a login page?"
- "Difference between smoke, sanity, and regression?"
- "How do you handle flaky tests?"
- "Tell me about a critical bug you found."
- "How do you decide what to automate?"
- "Walk me through your framework architecture."
- "How do you do API testing?"
- "What's your approach to UI vs API testing trade-offs?"
- "How do you ensure test reliability in CI?"
- "How do you test AI / ML features?"
Have a 2-minute story ready for each. Practice them out loud.
FINAL ADVICE¶
- Confidence > Correctness: Even if your answer isn't perfect, a clear explanation wins.
- Curiosity > Knowledge: Asking "How does that work?" shows engagement.
- Calm > Speed: Pause for 3 seconds, then speak. Beats rushing into a wrong answer.