← Back to Cheat Sheets

Code Interview General Cheatsheet

# Coding Interview Cheatsheet In General

# Answering Steps

    1. Understand the questions (requirement, IO, accepted form)
    1. Ask the
    • scope
      • scale of data
      • range of number
    • limitation
      • boundary of the questions
      • expected space & time compliexity
    1. Come up with V1 approaches
    • Algorithm ideas
    • brute force is fine, but explain the ideas
    • come up with V2 solutions, explain the ideas, the Algorithm & data structure
    • Write pseudo code
    • Discuss the edge cases
    • Discuss with interviewer, if OK, start coding
    1. Write the code
    • clean code, explain, easy-to-understand variable names
    • write test cases
    1. Run the code
    • solve bugs
    • Explain time & space complexity
    • validate the test cases
    1. Following up session
    • optimize time & space complexity
    • if input is scalable
    • if input is in stream (rather than batch)
    • if input can not fit the server memory