It is challenging to become proficient in coding interviews. I remember my first real one as a senior in college interviewing for Bloomberg. I went in with hardly any practice and three and a half years of a computer science degree. I will always remember the question I got: binary search.
Spring of my sophomore year, I learned how to write a binary search algorithm in Java. I thought I understood the principle (continuously split a list until you arrive at the target number), but for the life of me, I could not remember how to do it. I remember feeling helpless, panicked, and completely stuck. It is like you become the stupidest version of yourself instantly.
Keeping your composure is one of the most challenging parts of interviewing. Understanding coding, data structures, and algorithms is only half the battle. The other half is staying calm under pressure and believing that you can solve the problem. If you start from first principles and work through a problem logically, you will eventually figure out how to do it. It is imperative to think of the problem in basic terms and to solve it one piece at a time. All complex algorithms and questions are the composition of less complex ones.
Another fundamental principle of interviewing I would recommend is to try to solve the problem as quickly as possible. During an interview there are multiple components and layers to a problem. Try your best to listen closely to your interviewer, ask for feedback often, and think critically about the problem.
This would be my advice to senior year me. If you panic at any point during an interview - reset completely, take a deep breath, and go back to first principles.