General Advice
This section contains general topics that are not specific to any particular data structure or algorithm.
Iterative Problem Solving

Communication
A significant aspect common to competitive programming and technical interviews is good communication. You need to be able to explain your thought process, your code, and your solutions to others. Here are some tips to help you communicate effectively:
Explaining Your Thought Process
-
Think out loud: Explain your thought process as you work through a problem. This helps interviewers understand your approach and can lead to valuable feedback.
-
Break down the problem: Divide the problem into smaller subproblems and explain how you plan to solve each one.
-
Use examples: Provide examples to illustrate your points and make your explanations clearer.
-
Ask questions: If you’re unsure about something, don’t be afraid to ask questions. It’s better to clarify things upfront than to make assumptions that could lead you down the wrong path.
-
Be concise: While it’s important to explain your thought process, be mindful of the time and try to be concise in your explanations.
Explaining Your Code
-
Comment your code: Use comments to explain your code and make it easier for others to understand.
-
Use meaningful variable names: Choose variable names that are descriptive and help convey the purpose of the variable.
-
Follow a consistent style: Stick to a consistent coding style to make your code more readable.
-
Use whitespace: Use whitespace to break up your code and make it easier to read.
-
Practice explaining your code: Practice explaining your code to others, either by talking through it out loud or writing explanations in comments.
Explaining Your Solutions
-
Summarize your solution: Start by summarizing your solution in a few sentences to give the interviewer an overview of your approach.
-
Explain the rationale: Explain why you chose a particular approach and how it addresses the problem.
-
Discuss trade-offs: If there are trade-offs or limitations to your solution, be upfront about them and explain why you made the choices you did.
-
Consider alternative approaches: If time allows, discuss alternative approaches to the problem and compare them to your solution.
-
Be open to feedback: Be open to feedback and be willing to revise your solution based on the interviewer’s input.
Working under pressure
The other common aspect of competitive programming and technical interviews is working under pressure. You need to be able to think quickly and make decisions under tight time constraints. Here are some tips to help you work effectively under pressure:
Practice, practice, practice
The more you practice solving problems under time constraints, the better you’ll get at it. Set aside time each day to work on problems and challenge yourself to solve them quickly.
Break down the problem
When faced with a complex problem, break it down into smaller subproblems that are easier to solve. Focus on solving one subproblem at a time and build up to the final solution.
Manage your time
Keep an eye on the clock and allocate your time wisely. If you get stuck on a particular part of the problem, don’t be afraid to move on and come back to it later.
Stay calm
It’s natural to feel nervous or stressed during a competition or interview, but try to stay calm and focused. Take deep breaths, remind yourself of your preparation, and trust in your abilities.
Be adaptable
Be prepared to change your approach if you hit a roadblock or if your initial solution isn’t working. Don’t be afraid to try new strategies or techniques to solve the problem.
Learn from your mistakes
After each competition or interview, take the time to reflect on what went well and what you could improve on. Use this feedback to inform your practice and make adjustments for next time.