Tip 1 : Stay focused
Tip 2 : Practice coding questions
Tip 3 : View previous interviews of the company applying to
Tip 1 : Have atleast 3 great project
Tip 2 : Write only what you know and prepare well
Initially, I have told him a brute-force approach of O(n). He asked for optimization. Then I have given a binary search approach. He agreed to that and asked me to write code for that. I had written the code in 5 mins then he asked me to dry run on some test cases.
I have proposed two approaches one was sorting + two pointer-based and other one was map-based. He asked me to explain both the approaches and at the end he asked me to code sorting based approach. I had written the code in 10 mins and then dry run the code for the given test case.