It’s time to start breaking down the problem by category.
Given a question which requires the use of a stack, what do you know about stacks? Have you encountered other problems that use stacks and how were they solved?
Is this a searching question? Can you sort the input and will that help? Does this problem sound like it can be modeled as a graph, with vertices and connected edges?
Understanding the applications of different data structures is very useful! The more questions you practice, the more you will be able to see patterns between problems.
This step varies the most because it requires details of the specific problem, but regardless of the question make certain you are communicating with the interviewer as a potential co-worker. Show them your thought process!
During this step, the interviewer may make suggestions on how to proceed. Acknowledge the interviewer and incorporate their suggestions into your approach.
Don’t disregard their input! It gives the impression you would be difficult to work with on the job.
When you and the interviewer are satisfied with a workable solution, write the steps next to your input. Follow these steps as you write code on the board.
Come up with an outline of how to solve the Pythagorean Triplet problem.
Don’t worry about efficiency, just aim for high-level steps which will produce the correct output.
Watch the video when you’re ready to move on.