Welcome to the comprehensive guide to mastering core computer science fundamentals and recognizing problem-solving patterns for technical interviews.
This repository contains a curated, categorized list of essential LeetCode problems, along with a structured 8-week study plan designed to build your skills progressively.
- Follow the Study Plan: Start with Phase 1 and work your way down. Do not skip ahead until you are comfortable with the core concepts of your current phase.
- Time Box Your Practice: Limit yourself to 20 minutes for Easy problems and 40 minutes for Mediums.
- Understand, Don't Memorize: If you are stuck after the time limit, read the solution, understand the pattern, and try coding it again from scratch.
- Use Your Interview Language: Implement all solutions in the language you intend to use in interviews (e.g., C#, Python, Java) to build strict muscle memory.
Focus on how data is stored continuously in memory and how to manipulate indices efficiently.
- Concepts to Master: Time & Space Complexity (Big-O), Two Pointers, Sliding Window, Prefix Sums.
- Core Problem Set:
- Arrays: Two Sum (#1), Remove Duplicates from Sorted Array (#26), Best Time to Buy and Sell Stock (#121).
- Strings: Valid Palindrome (#125), Longest Substring Without Repeating Characters (#3).
- Patterns: Container With Most Water (#11).
Transition from contiguous memory to node-based data structures.
- Concepts to Master: Singly vs. Doubly Linked Lists, LIFO (Stacks), FIFO (Queues), Hash Maps.
- Core Problem Set:
- Linked Lists: Reverse Linked List (#206), Merge Two Sorted Lists (#21), Linked List Cycle (#141).
- Stacks/Queues: Valid Parentheses (#20), Min Stack (#155).
- Hashing: Group Anagrams (#49), Longest Consecutive Sequence (#128).
Mastering recursive thinking and traversal algorithms.
- Concepts to Master: Binary Trees, Binary Search Trees (BST), Depth-First Search (DFS), Breadth-First Search (BFS), Recursion.
- Core Problem Set:
- Trees: Binary Tree Level Order Traversal (#102), Maximum Depth of Binary Tree (Foundational).
- BST: Validate Binary Search Tree (#98), Lowest Common Ancestor (#236).
Tackling complex networks, pathfinding, and robust data querying.
- Concepts to Master: Graph representations, Dynamic Programming (Memoization vs. Tabulation), Relational Database logic (Joins, Aggregations).
- Core Problem Set:
- Graphs: Number of Islands (#200), Clone Graph (#133), Course Schedule (#207).
- DP: Climbing Stairs (#70), Coin Change (#322), Longest Increasing Subsequence (#300).
- SQL: Combine Two Tables (#175), Second Highest Salary (#176).
| ID | Problem Title | Difficulty |
|---|---|---|
| 2 | Add Two Numbers | Medium |
| 19 | Remove Nth Node From End of List | Medium |
| 21 | Merge Two Sorted Lists | Easy |
| 23 | Merge k Sorted Lists | Hard |
| 24 | Swap Nodes in Pairs | Medium |
| 25 | Reverse Nodes in k-Group | Hard |
| 83 | Remove Duplicates from Sorted List | Easy |
| 86 | Partition List | Medium |
| 92 | Reverse Linked List II | Medium |
| 138 | Copy List with Random Pointer | Medium |
| 141 | Linked List Cycle | Easy |
| 142 | Linked List Cycle II | Medium |
| 143 | Reorder List | Medium |
| 148 | Sort List | Medium |
| 160 | Intersection of Two Linked Lists | Easy |
| 206 | Reverse Linked List | Easy |
| 234 | Palindrome Linked List | Easy |
| 237 | Delete Node in a Linked List | Medium |
| 430 | Flatten a Multilevel Doubly Linked List | Medium |
| 876 | Middle of the Linked List | Easy |
| ID | Problem Title | Difficulty |
|---|---|---|
| 37 | Sudoku Solver | Hard |
| 79 | Word Search | Medium |
| 126 | Word Ladder II | Hard |
| 127 | Word Ladder | Hard |
| 130 | Surrounded Regions | Medium |
| 133 | Clone Graph | Medium |
| 200 | Number of Islands | Medium |
| 207 | Course Schedule | Medium |
| 210 | Course Schedule II | Medium |
| 399 | Evaluate Division | Medium |
| 417 | Pacific Atlantic Water Flow | Medium |
| 695 | Max Area of Island | Medium |
| 721 | Accounts Merge | Medium |
| 733 | Flood Fill | Easy |
| 743 | Network Delay Time | Medium |
| 787 | Cheapest Flights Within K Stops | Medium |
| 802 | Find Eventual Safe States | Medium |
| 815 | Bus Routes | Hard |
| 827 | Making A Large Island | Hard |
| 843 | Guess the Word | Hard |
| 909 | Snakes and Ladders | Medium |
| 934 | Shortest Bridge | Medium |
| 947 | Most Stones Removed with Same Row or Column | Medium |
| 980 | Unique Paths III | Hard |
| 994 | Rotting Oranges | Medium |
| 1631 | Path With Minimum Effort | Medium |
| 1971 | Find if Path Exists in Graph | Easy |
| 1976 | Number of Ways to Arrive at Destination | Medium |
| ID | Problem Title | Difficulty |
|---|---|---|
| 146 | LRU Cache | Medium |
| 150 | Evaluate Reverse Polish Notation | Medium |
| 155 | Min Stack | Medium |
| 224 | Basic Calculator | Hard |
| 227 | Basic Calculator II | Medium |
| 232 | Implement Queue using Stacks | Easy |
| 295 | Find Median from Data Stream | Hard |
| 347 | Top K Frequent Elements | Medium |
| 359 | Logger Rate Limiter | Easy |
| 362 | Design Hit Counter | Medium |
| 380 | Insert Delete GetRandom O(1) | Medium |
| 402 | Remove K Digits | Medium |
| 496 | Next Greater Element I | Easy |
| 503 | Next Greater Element II | Medium |
| 622 | Design Circular Queue | Medium |
| 636 | Exclusive Time of Functions | Medium |
| 703 | Kth Largest Element in a Stream | Easy |
| 715 | Range Module | Hard |
| 735 | Asteroid Collision | Medium |
| 900 | RLE Iterator | Medium |
| 981 | Time Based Key-Value Store | Medium |
| 1244 | Design A Leaderboard | Medium |
| 1381 | Design a Stack With Increment Operation | Medium |
| 1603 | Design Parking System | Easy |
| 2296 | Design a Text Editor | Hard |
| 3815 | Design Auction System | Medium |
| ID | Problem Title | Difficulty |
|---|---|---|
| 7 | Reverse Integer | Medium |
| 9 | Palindrome Number | Easy |
| 12 | Integer to Roman | Medium |
| 13 | Roman to Integer | Easy |
| 29 | Divide Two Integers | Medium |
| 50 | Pow(x, n) | Medium |
| 66 | Plus One | Easy |
| 67 | Add Binary | Easy |
| 69 | Sqrt(x) | Easy |
| 136 | Single Number | Easy |
| 137 | Single Number II | Medium |
| 168 | Excel Sheet Column Title | Easy |
| 190 | Reverse Bits | Easy |
| 202 | Happy Number | Easy |
| 231 | Power of Two | Easy |
| 233 | Number of Digit One | Hard |
| 258 | Add Digits | Easy |
| 263 | Ugly Number | Easy |
| 268 | Missing Number | Easy |
| 282 | Expression Add Operators | Hard |
| 292 | Nim Game | Easy |
| 371 | Sum of Two Integers | Medium |
| 401 | Binary Watch | Easy |
| 507 | Perfect Number | Easy |
| 645 | Set Mismatch | Easy |
| 693 | Binary Number with Alternating Bits | Easy |
| 728 | Self Dividing Numbers | Easy |
| 1015 | Smallest Integer Divisible by K | Medium |
| 1025 | Divisor Game | Easy |
| 1137 | N-th Tribonacci Number | Easy |
| 1523 | Count Odd Numbers in an Interval Range | Easy |
| 1922 | Count Good Numbers | Medium |
| 2235 | Add Two Integers | Easy |
| 2396 | Strictly Palindromic Number | Medium |