TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1384 316
⚠️ COMMON INTERVIEW MISTAKE #3 - Not Testing Your Own Code

You finish coding, say "I think that's it," and stop. The interviewer asks "are you sure this works?" - and you just... shrug.

This is one of the most avoidable point losses in the entire interview.

✅ What to do instead: Before declaring you're done, manually trace through your code with the example input(s) given. Actually walk through it line by line, tracking variable values as you go - out loud.

"Let's trace through with nums = [2,7,11,15], target = 9. i=0, num=2, complement=7, not in seen yet, so seen={2:0}. i=1, num=7, complement=2, IS in seen at index 0 - so we return [0,1]. That matches the expected output."

This catches real bugs before the interviewer has to point them out (which is a much worse look), and it demonstrates the exact skill you'd use before merging a real pull request.

Bonus: always test at least one edge case too (empty input, single element, all duplicates) - don't just re-test the example they gave you.

Do you naturally trace through your code, or does it feel like an extra step you skip under time pressure? 👇
More from @coding_interview_preparation
  1. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  2. Oct 6, 2026document post
  3. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  4. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
  5. Oct 1, 2026Most Asked Topics in AI Engineer Interviews Based on 2026 candidate reports
  6. Sep 30, 2026💼 What Companies Actually Look For in a Fresher Think companies only care about your CGPA…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →