Coding Interview
Cheatsheet In General
Answering Steps
- Understand the questions (requirement, IO, accepted form)
- Ask the
- scope
- scale of data
- range of number
- limitation
- boundary of the questions
- expected space & time compliexity
- 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
- Write the code
- clean code, explain, easy-to-understand variable names
- write
test cases
- Run the code
- solve bugs
- Explain time & space complexity
- validate the test cases
- 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