Skip to content
Preptima
easyCodingEntry

Your intern interview is in a shared document with no compiler. How do you write code you cannot run?

Coding without a compiler means doing the computer's checking yourself. Write two or three test cases before the code, keep functions small with clear names, then trace one test by hand line by line, aloud. The trace finds the bugs a run would have found, and it shows the interviewer how you verify.

5 min readUpdated 2026-10-10

Answer

Short answer

Coding without a compiler means you do the checking the computer would have done. Write two or three test cases before the code, including an edge case. Keep functions short and named for what they do. Then trace one test by hand, line by line, saying each variable's value aloud. The trace finds the bugs a run would have found, and it shows the interviewer the verification habit they are scoring.

Was this answer helpful?

Likely follow-ups

  • Your trace passes on "aaabcc". Which input would you trace next, and why that one?
  • The interviewer says your code has a bug but not where. How do you search for it without running anything?
  • How would you change this function if the input could be a stream too large to hold in memory?
  • You are unsure whether string slicing copies the string in your language. Does it matter here?

Related questions