description | coverY |
---|---|
Don't leave your interviews to chance |
0 |
To solve a Rubik's cube, you recognize patterns and apply specific combinations of moves (algorithms) until the cube is solved. An example of an algorithm is for solving the yellow face when the pieces are in the pattern shown below.
This algorithm consists of two parts:
- Setup: position the cube in a way to apply the sub-algorithm.
- Sub-algorithm: apply a set of moves to reorient pieces.
Once you memorize a few patterns/algorithms, you are able to restructure them together to solve any possible position on the cube. You even start to recognize new patterns and form algorithms intuitively.
A large majority of programming problems consist of applying specific algorithms to data structure access-patterns. Once we break down problems into sub-problems, they just become a combination of patterns/algorithms to achieve the solved state.
This book aims to provide programming problem mastery through strengthening pattern recognition and algorithm application.
I dedicate a chapter to each pattern where I:
- Introduce the pattern
- Walkthrough simple example problem
- Explain variations
- Walkthrough examples for variations
- Walkthrough harder problems
- Provide further resources and challenge problems
The problems will come from programming problem sites (like LeetCode, Project Euler, and Kattis) and my personal interview experiences. I'll also touch on some behavioral and resume advice briefly.
All provided code/solutions are written in Python but the strategies presented are language-agnostic.
If you're looking for more information on interview processes, check out the Tech Interview Handbook.
If you're looking for curated lists of problems by patterns, check out LeetCode Patterns.
A great, pattern-oriented course is Grokking the Coding Interview but it will cost you $15/month.
tl;dr: You've solved, or are able to solve, Two Sum on LeetCode.
I expect you have familiarity with general algorithms and have taken the equivalent of a data structures and algorithms course. This book is not introductory in nature--the goal is to make hard problems feel approachable during interviews.
Hayden Daly did. I am a grad student at Cornell Tech and I've interned at companies including Stripe, Expo, and Disney. I aim to use writing this as a tool to improve my interview and technical writing skills.