Answering coding interview questions

History / Edit / PDF / EPUB / BIB /
Created: May 1, 2021 / Updated: June 5, 2021 / Status: draft / 1 min read (~123 words)
  • Read the problem statement
  • Look at any provided unit tests
  • Add any unit tests you think might be relevant and not currently covered
  • Order the unit tests from easiest to hardest
  • Ask questions to confirm your understanding of the problem and verify edge cases
  • Think of a possible approach to solve the problem
  • Share your approach with the interviewers and get their buy-in
    • You may do this by writing pseudo-code as you are explaining your thought process
  • Implement your solution
    • If you encounter any difficulties, state them and explain what you are thinking
    • Make use of preconditions/early exit if possible to handle empty cases
  • Run your code frequently, even if it is not fully working
  • Discuss any follow-up questions with the interviewers