What are coding interview patterns?
Coding interview patterns are reusable ways to solve whole families of problems, such as two pointers, sliding window, binary search, BFS and DFS, backtracking and dynamic programming. Instead of memorizing hundreds of answers, you learn to spot the signals in a problem statement, pick the matching pattern and adapt its template. Most problems in a coding round are one or two of about 18 patterns.
How many LeetCode patterns are there?
There is no official number. Popular lists group problems into somewhere between 14 and 20 topics. This guide uses 18: arrays and hashing, two pointers, sliding window, stack, binary search, linked lists, trees, tries, heaps, backtracking, graphs, advanced graphs, 1D dynamic programming, 2D dynamic programming, greedy, intervals, math and geometry, and bit manipulation. Together they cover the large majority of problems you are likely to see in a coding interview.
Should I learn patterns or just solve a lot of problems?
Both, in that order. Learn one pattern, solve three to six problems that use it, then mix problems from different patterns so you practice choosing the pattern yourself. Solving hundreds of random problems without naming the pattern behind each one is slow, and it does not prepare you for a problem you have never seen.
Which coding patterns matter most?
Arrays and hashing, two pointers, sliding window, trees, graphs (BFS and DFS) and binary search come up most often, and they are the base for the rest. Dynamic programming and backtracking take the longest to get comfortable with, so start them early. Bit manipulation and math and geometry are worth a short review, not weeks.
What is the sliding window algorithm?
The sliding window algorithm finds the best contiguous subarray or substring in one pass. You keep a window between a left and a right index, add the next item on the right, and move the left edge forward whenever the window breaks the rule. Each item enters and leaves the window at most once, so the scan is O(n) instead of the O(n^2) of checking every start and end.
What is the two pointer technique?
The two pointer technique moves two indexes through the same array or string instead of nesting two loops. With opposite-end pointers on sorted data, each comparison rules out a whole row of pairs, which gives O(n) pair and palindrome checks. With a slow and a fast pointer moving the same way, you can filter an array in place, or find the middle of a linked list or a cycle in it.
How do I get better at dynamic programming?
Use the same five steps on every problem: say what dp[i] means in words, write how it comes from smaller states, set the base cases, pick an order so every dependency is ready, and say which state holds the answer. Start with top-down recursion plus a memo, then turn it into a bottom-up table. Work through the 1D families (counting ways, min cost, reachability) before 2D problems on two strings or a grid.
Is Blind 75 enough to prepare for coding interviews?
Blind 75 is a strong core, but it is small, and many people finish it having memorized answers rather than patterns. Treat any list as practice material for patterns: for each problem, name the pattern, write the template from memory and explain the complexity. Grind 75 and NeetCode 150 are larger lists that fill in more topics.
Which language should I use for coding interviews?
Use the language you write fastest and most accurately. Python is popular because it is short and has built-in tools like heapq, deque and Counter. JavaScript works well too, but you have to write a small heap yourself and watch 32-bit bitwise math. OphyAI Coding Practice supports Python and JavaScript, and every template on this page is written in both.
Does OphyAI Coding Practice use LeetCode problems?
No. OphyAI is not affiliated with LeetCode, and Coding Practice problems are written in our own words. The library has 153 algorithm problems across the same 18 patterns as this guide, plus 25 Terraform tasks, in Easy, Medium and Hard, with hints one at a time and an AI coach that checks your plan and reviews your code. The full library comes with Pro and Premium, and free accounts get 4 sample problems.