In this video, Haythem Balti from the Wiley Edge Academy offers advice on how to answer an algorithmic problem in an interview. Here's what he had to say:
First, read the problem several times. Every word is there for a reason. Interviewers often introduce ambiguity in the problem to see if you notice them. Clarify anything with the interviewer and ask as many questions as possible. Once you've understood the problem to be solved, start to think about the solution.
Ask yourself, what’s the input and output of the problem? How can you leverage information in the problem definition? Do you need new data structures? What’s the flow of your solution?
Think out loud and describe what you’re writing throughout. The interviewer is interested in your thought process and how you approach the problem.
Think about simple and edge cases and how your solution will handle them. If we are searching for the max of an array. What if the array is empty or contains only one element? What should we return if the array is empty. Also consider the performance.
Write a quick pseudocode for the proposed solution and test the solution.
Next, implement the solution. Write your solution in your go to programming language unless the interviewer is dictating the language.
Finally, manage your time accordingly. You only have 30 to 45 minutes so make sure you allow enough time for requirements analysis and definition, design, test and implementation.
Thank you, I hope you found my advice useful.
Негізгі бет How to answer an algorithmic problem in an interview
Пікірлер