Talking aloud
Communication
- Have a good/friendly/happy conversation with the interviewer
- Eye contact, real discussion
- Make interviewer like you: your personality, your skills etc
- Show the process how you tackle the problem
Always think whether there are different/better approaches
- If you find it (even after you finish your current approaches) , still say it
If there are somethings that you didn't solve or understand
- Ask for hints/solutions
- if possible
- Even that questions maybe not that important: that shows you want to learn in any cirsumstances
Before interview
- Know how many questions they would ask
- Some companies/interviewers likes to ask simple code questions as warm up, if you spend too much time on it, there may be no much time left for the next real question.
- Though, personally lots of warm up coding questions is not that useful - as it only causes confusion.
- Good warm up questions:
-- different types: simple dfs/recursion question
When write code
What expectations from the interviewers:
- Do they care about details such as sanity check, corner cases
- Or they focus on the high level algorithm and your problem solving skills
- If they ask you simple coding questions, pay more attention to details when you write the code and later when re-check
- If possible - depend on timings
- Always say: let me check the code again after you finish your first draft code
- Always run some examples:
- Generalize your example: isPalindromOneDiff
Never say:
I don't know
- Try to solve it, infer from your existing knowledge
Even after you finish your code/design, think aloud what you can improve
What's the time/space complexity of your current approach
How you can improve it:
- your current approach: O(1) time, O(n) time, can you use lesser space but still O(1) time, or lesser space but more time: like O(logn) time
When find/realize there are something you can improve: in the code, design
- Say it,
- Fix it
- in the code, if possible before the interviewer takes the picture
Even after all this, ask the interviewer:
- Take this as a chance to learn something
Is there any better approach?
Did I miss anything in the design?
Reflection
- Think what you can do better, what mistakes you made, what lessons you learned after interview
When write code
What states/variables/invariants you are trying to maintain
Source of bugs
loop variables
- forget to change them: next=current.next;