
Learn the patterns, practice the right way, and master the art of thinking out loud in live coding interviews.
90% of coding interview problems can be solved with these 10 patterns. Learn the pattern, not just the problem.
Example problems: Longest Substring Without Repeating, Max Sum Subarray of K
When to use: Contiguous subarray or substring problems with a condition
Example problems: Two Sum (sorted), 3Sum, Container With Most Water
When to use: Pair or triplet problems in sorted arrays
Example problems: Cycle detection in linked list, Middle of Linked List
When to use: Cycle detection, finding middle element
Example problems: Koko Eating Bananas, Minimum Days to Complete Tasks
When to use: Finding minimum/maximum value satisfying a condition
Example problems: Binary Tree Level Order, Shortest Path in Matrix, Word Ladder
When to use: Shortest path, level-by-level traversal
Example problems: Subsets, Permutations, N-Queens, Sudoku Solver
When to use: Generating all combinations, constraint satisfaction
Example problems: Knapsack, Longest Common Subsequence, Coin Change
When to use: Overlapping subproblems with optimal substructure
Example problems: Merge Intervals, Insert Interval, Meeting Rooms
When to use: Overlapping ranges or time scheduling problems
Example problems: Next Greater Element, Largest Rectangle in Histogram
When to use: Next/previous greater/smaller element problems
Example problems: Kth Largest, Top K Frequent, Merge K Sorted Lists
When to use: Finding K largest/smallest elements efficiently
Re-read the problem. Identify: input format, output format, constraints, and what 'optimal' means.
Match the problem to a known pattern (sliding window? BFS? DP?). What data structure fits?
Outline your algorithm in plain English before coding. Agree on the approach with the interviewer.
Write clean code. Narrate as you type. Use meaningful variable names.
Trace through with the sample input. Check edge cases manually.
State time and space complexity. Suggest optimizations if you see them.
Easy problems — Arrays, Strings, Hashmaps. Solve 50 problems. Focus on getting working solutions, not speed.
Medium problems — Trees, Linked Lists, Recursion. 75 problems. Start recognizing patterns.
Patterns — DP, Graphs, Advanced Trees. 50 problems. Learn pattern before problem.
Mock interviews — time yourself to 45 min per problem. Use Pramp, Interviewing.io, or peers.
TomoLink curates company-specific DSA questions so you practice exactly what each company tests.
Explore Company Questions