Overview
This chapter presents a collection of common coding interview problems of various difficulty levels. The solutions to these problems have not been provided since the aim is to test your understanding without having the safety net of viewing the solution. Rather than looking at the solution when a problem gets too hard to decipher, you acquire the discipline to spend a fair bit of time to coming up with a promising strategy. General guidelines to prompt you in the right direction have been provided. However, the onus is on you, as the learner, to decide which pattern to apply when solving the problem.
Possible roadmaps to help you explore the chapter
While there are no strict rules regarding the use of the material in this chapter, the following are some general guidelines which may help you in set up a blueprint and prepare:
-
If you’re relatively new in your journey as a programmer and have limited experience using textbook algorithms, you may want to review the preceding chapters in detail. You’ll be provided with an introduction to each pattern and, then, solve the problems that fall under it. In most cases, a detailed solution to the problem will be provided, allowing you to understand how the underlying technique works. After you’ve explored these chapters, you’ll have gained sufficient knowledge of how each coding pattern works and be able to categorize different problems under its appropriate pattern. You can then apply this acquired knowledge to the problems in the Challenge chapter.
-
If you have intermediate level knowledge of frequently used algorithms and would like to solve as many problems as you can, this method is recommended. You can alternate between the Challenge Yourself, pattern chapters, and the others at your discretion. If you’re unsure how to solve a problem, you can refer back to the relevant pattern chapter to refresh your knowledge.
-
Lastly, if you’re an advanced learner with prior knowledge of coding patterns, you can jump directly to the Challenge Yourself chapter and test your mettle by attempting problems using your existing skills.