Part 1
How to Become a Cracked LeetCoder?
- Pattern Recognition, Pick DSA
Learn to quickly identify the pattern of a problem. Knowing only brute force isn’t enough; you must know when and why to use a specific DSA. So check constraints before deciding.
For example, if n = 10⁵ and you need repeated subarray sums, O(n²) brute force will time out. Use Fenwick Tree (BIT) if updates, Prefix Sum if static to get sums efficiently. (Part 2: check it out)
-
Solve problems from the last 25-30 contests.
-
Use fast I/O templates if doing contests in C++ or Java.
Keep ready templates for:
• Fast I/O
• BFS / DFS
• DSU (Union Find)
• Binary Search
• Prefix Sum / Hash / Map / Set
- Early Problems First
Solve easy & medium problems ASAP (within 10-20 mins).
-
Don’t get stuck in hard problem initially — waste of time.
-
Speed + Accuracy
First 2 problems must be solved within 10-15 mins.
But for beginners: Try to solve the first 2 problems within 10-15 mins.
-
Aim for full solve or 3/4 solves to gain significant rating.
-
Debugging Skills
Practice finding bugs quickly.
-
One wrong submission can kill your rank — test locally if possible.
-
After Contests
• Read editorials for unsolved problems.
• Analyze your mistakes. Check why you failed a problem: Was it logic, speed or implementation?
• Don’t stop just because your solution got accepted. If your solution is O(n²), see if it can be improved to O(n log n).
- Master These Topics
To reach 2500+, You need to be fast in:
• Prefix Sum / Binary Search / Sliding Window
• Two Pointers / Stack & Queue / Monotonic Stack
• Hashing / Maps / Sets
• DFS/BFS / Union-Find / Graph
• DP — must-do!
• Greedy + Heap + Backtracking
• Tree Algorithms
• Segment Tree / Fenwick Tree (optional)
• Math / Combinatorics
• Bit Manipulation
Part 2
2.1: Must-know 7 LeetCode Patterns
- Sliding Window
Problem Keywords: subarray, substring, contiguous elements, window size k, longest / shortest substring.
Example use:
• Longest substring without repeating characters
• Maximum sum subarray of size k
- Two Pointers
Problem Keywords: sorted array, pair sum, remove duplicates, opposite direction scanning, left/right pointer.
Example use:
• Pair with target sum
• Remove duplicates
• Container with most water
- Prefix Sum
Problem Keywords: range sum, subarray sum, subarray sum equals k, cumulative sum.
Example use:
• Range sum queries
• Subarray sum equals k
- Binary Search
Problem Keywords: sorted array, find target, minimum / maximum possible value, search space, monotonic condition, search on answer.
Example use:
• Search in sorted array
• Minimum feasible value problems
- Fast & Slow Pointers (also called Floyd's cycle detection)
Problem Keywords: linked list cycle, find middle node, detect loop, remove cycle.
Example use:
• Linked list cycle detection
• Find middle of linked list
- DFS (Depth First Search)
Problem Keywords: graph traversal, tree traversal, recursion / stack, connected components, backtracking, island problems.
Example use:
• Graph traversal
• Tree recursion
- BFS (Breadth First Search)
Problem Keywords: shortest path in unweighted graph, minimum steps, level order traversal, queue, grid traversal.
Example use:
• Shortest path in unweighted graph
• Tree level order traversal
If you want to solve problems based on the patterns most frequently asked in tech company interviews, then "Blind 75 & NeetCode 150" are for you.
- Blind 75: List of the 75 essential LeetCode algorithms problems.(Curated by Yangshun, a former Meta staff engineer) Easy: 19, Medium: 49, Hard: 7.
- NeetCode 150: Expands on Blind 75 with 75 more problems. Easy: 28, Medium: 101, Hard: 21.
"Blind 75" vs "NeetCode 150" -> Blind 75 offers a solid foundation with essential LeetCode problems But "NeetCode 150" expands this palette, covering a wider array of patterns and topics!
Recommended YouTube Channel for solving tutorials: "NeetCode"
Standard Time for Solving LeetCode Problems:
- Easy: 15-20 minutes
- Medium: 30 minutes
- Hard: 40-60 minutes
- Arrays & Hashing: NeetCode (9), Blind (8)
- Two Pointers: NeetCode (5), Blind (3)
- Sliding Window: NeetCode (6), Blind (4)
- Stack: NeetCode (7), Blind (1)
- Binary Search: NeetCode (7), Blind (2)
- Linked List: NeetCode (11), Blind (6)
- Trees: NeetCode (15), Blind (11)
- Tries: NeetCode (3), Blind (3)
- Heap / Priority Queue: NeetCode (7), Blind (1)
- Backtracking: NeetCode (9), Blind (2)
- Graphs: NeetCode (13), Blind (6)
- Advanced Graphs: NeetCode (6), Blind (1)
- 1-D Dp: NeetCode (12), Blind (10)
- 2-D Dp: NeetCode (11), Blind (2)
- Greedy: NeetCode (8), Blind (2)
- Intervals: NeetCode (6), Blind (5)
- Math & Geometry: NeetCode (8), Blind (3)
- Bit Manipulation: NeetCode (7), Blind (5)
-> Here the problem topics are listed along with the number of problems in each topic. For example, there are 9 problems in Arrays & Hashing where Blind has 8, but NeetCode has 9, that means there are 8 common problems.
Important DSA: BFS & DFS, Sliding window, Top K elements, Linked list, Stack, Queue, DP, Array, String, Searching, Sorting, Backtracking, Trie, Bit manipulation, Graph, BST.
- Sliding Window (Fixed sized window and variable sized window questions on array and string)
- Island problems(DFS/BFS or different traversals on grid)
- Two Pointers, Fast and Slow pointer
- Merge Intervals
- Cyclic Sort(Very important)
- DFS and BFS
- Two Heaps Problems(Find median in a stream problem)
- Subset Problems
- Subarray/Substring problems using Hashing
- Binary Search
- Bitwise XOR(Common asked question in many OAs)
- Top k elements
- K way merge
- Topological Sort
- Bit Manipulation
- Number Theory
- Data Structures & Algorithms:
Computer Science Distilled - https://amzn.to/39jYZ0S
Grokking Algorithms - https://amzn.to/2JcBrjS
Introduction to Algorithms - https://amzn.to/2V03JRb
Elements of Programming Interviews (Python) - https://amzn.to/35XPQJw
Elements of Programming Interviews (Java) - https://amzn.to/374W5KT
- Software Engineering & Architecture:
Clean Code - https://amzn.to/3nHNtAC
Clean Architecture - https://amzn.to/3kZ7UqR
Refactoring - https://amzn.to/377VXdM
The Productive Programmer - https://amzn.to/33aMeSE
Pragmatic Thinking & Learning - https://amzn.to/2J5IfzM
- Distributed Systems:
Web Scalability for Startup Engineers - https://amzn.to/39c55QV
Designing Data Intensive Applications - https://amzn.to/3fxgOLm
Understanding Distributed Systems - https://amzn.to/3cjChr5
Software Engineering at Google - https://amzn.to/3rfJc8L
Building Microservices - https://amzn.to/2UUPsFi