Front matter

Preface

about 3 minutes

During interview preparation, things can be foggy and stressful, and sometimes you may question whether you are qualified for the job. Does that sound familiar? If so, you are not alone! We have all been there.

At times, I become frustrated and disheartened, and on other days, I even question whether it is worth continuing with these interviews. Despite putting in significant effort to prepare, I often find that the outcome does not match my expectations or reflect my abilities. Later, I realized that it was because of my poor preparation and lack of balance between effectiveness and efficiency.

So, I began to focus on problems that were relevant to the position I was applying for. Additionally, I prioritized these problems based on their importance, starting with the most critical ones, and it worked like a charm!

However, during my preparation journey, I encountered many online resources. I conduct an extensive research looking for good materials that could provide me with two important things: saving my preparation time by helping me focus on important problems and techniques, and providing me with an in-depth explanation while being practical and concise.

I spent several months going from reading blog posts to taking online courses and even watching videos from that algorithm expert on YouTube who happens to be from India. However, the information was scattered, and there were things I should have learned and things I should not have because they were too advanced and less likely to be brought up during interviews. That is why I decided to write this guide. A guide that saves you time while making you focus on things that matter.

I feel obliged to pass these lessons on to you and make your journey a lot easier. You do not have to waste the same time that I invested in these interviews. Yes, I have learned a lot of things during my preparation journey, but you can also use this time to learn other important things to you, so please enjoy this guide!

This second edition is a larger book than the first, and a different one. It is organised around the eight things an interviewer is actually scoring, rather than around a list of problems, and each technique now arrives with the signals that tell you to reach for it. Where the first edition told you what to practise, this one tries to tell you what to notice.

It also comes with somewhere to do the work. The practice companion at solvealgorithms.com/practice runs the problems in your own browser, against the same tests the book’s code has to pass, and asks you what a solution costs before it will mark it. Reading the book there is free and stays free; you are holding the copy that is yours to keep.

If you find a mistake, tell me: select the sentence online and choose Report an error, or write to errata@solvealgorithms.com. Corrections are published at solvealgorithms.com/errata and fixed in the files, and you will be credited unless you would rather not be.

Waleed Khamies, September 2026.

Start here