Comprehensive topic-wise segregation covering greedy, binary search, prefix sums, two pointers, trees, DP, graphs, strings, constructive, number theory and advanced patterns. Hand-picked for product-company OAs and coding interviews.
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 1: GREEDY & SORTING (Problems 1–12) | ||||||
| 1 | Fence Painting | 1400 | Easy | Interval-greedy selection; foundational for all greedy pattern recognition. | ||
| 2 | Compress | 1600 | Med | Merging intervals via greedy ordering; classic Amazon OA pattern. | ||
| 3 | Balanced String | 1500 | Easy | Greedy character pairing to balance; tests observation before implementation. | ||
| 4 | Division by Two and Permutation Sums | 1700 | Med | Greedy matching with constraints; teaches when to sort and why it works. | ||
| 5 | Block Chords | 1600 | Med | Interval nesting via greedy sorting; tests interval reasoning. | ||
| 6 | Phoenix and Towers | 1600 | Med | Greedy assignment with data structure; elegant multiset usage pattern. | ||
| 7 | Two Subsequences | 1500 | Easy | Greedy bipartition for constraint satisfaction; teaches why minimum max matters. | ||
| 8 | Not Adjacent Matrix | 1500 | Easy | Greedy placement with adjacency constraints; constructive greedy reasoning. | ||
| 9 | Media Magician | 1600 | Med | Greedy selection around median; sorting + observation combo tested at Flipkart. | ||
| 10 | Minimum Partition into Two Balanced Subsequences | 1700 | Med | Greedy bipartition via sorted two-pointer technique. | ||
| 11 | Increasing Subsequences | 1600 | Med | Greedy sequence splitting with multiset; data structure usage pattern. | ||
| 12 | Marooush and the Large Cherry | 1700 | Med | Greedy path selection problem; combines greedy with pathfinding. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 2: BINARY SEARCH & VARIANTS (Problems 13–24) | ||||||
| 13 | Catch Overflow! | 1500 | Easy | Binary search on answer pattern; foundation for all "find minimum/maximum" problems. | ||
| 14 | Binary String | 1700 | Med | Binary search + sliding window combo; classic Walmart/IBM OA pattern. | ||
| 15 | Yet Another Counting Problem | 1600 | Med | Binary search on cycles; advanced application tested at Adobe/Qualcomm. | ||
| 16 | KHCODE | 1600 | Med | Binary search with two-pointer validation; hybrid technique for constraint checking. | ||
| 17 | Mark the Pianist | 1700 | Med | Binary search + greedy selection; tests hybrid thinking skills. | ||
| 18 | A-B Testing | 1600 | Med | Binary search on result space; tests when to binary search vs. direct math. | ||
| 19 | Busy Robot | 1700 | Med | Binary search on timestamp; coordinate compression variant. | ||
| 20 | Make It Increasing | 1700 | Med | LIS via binary search (patience sorting); most frequently asked DP/BS hybrid. | ||
| 21 | Factorize as Much as Possible! | 1500 | Easy | Binary search on divisor; number-theoretic binary search variant. | ||
| 22 | New Year and the Cake | 1600 | Med | Binary search on game outcome; game-theoretic binary search. | ||
| 23 | School Marks | 1700 | Med | Binary search + construction; tests binary search with validation. | ||
| 24 | Hate It or Love It | 1600 | Med | Binary search with segment tree validation; advanced binary search pattern. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 3: TWO POINTERS & SLIDING WINDOW (Problems 25–35) | ||||||
| 25 | Count Triangles | 1500 | Easy | Triangle inequality via two pointers; classic O(n²) optimization pattern. | ||
| 26 | Traffic Light | 1500 | Easy | Circular sliding window pattern; Amazon/Google OA classic. | ||
| 27 | Yet Another Walking Robot | 1600 | Med | Longest valid window via hash map; window + map combo for Ola/PhonePe OAs. | ||
| 28 | Yet Another Broken Keyboard | 1400 | Easy | Longest valid substring pattern; appears in every top company OA bank. | ||
| 29 | Pluses and Minuses | 1500 | Easy | Window validity checking; tests sliding window boundary logic. | ||
| 30 | Phoenix and Towers | 1400 | Easy | Two-pointer assignment problem; teaches pointer movement strategy. | ||
| 31 | Alphabetical Strings | 1500 | Easy | Fixed-size window on strings; teaches window size and movement patterns. | ||
| 32 | Shuffle Hashing | 1500 | Easy | Variable-window pattern matching; substring permutation detection. | ||
| 33 | Unequal Array | 1600 | Med | Two-pointer with constraint satisfaction; tests pointer crossing logic. | ||
| 34 | Maximize Number of Positive Integers and Minimize the Number of Operations by Dividing by 2 | 1600 | Med | Two-pointer with operations counting; optimization under operations. | ||
| 35 | Make It Palindrome | 1700 | Med | Min-cost pairing via two pointers; classic Paytm/Razorpay OA pattern. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 4: PREFIX SUMS & RANGE QUERIES (Problems 36–46) | ||||||
| 36 | Tonya and Birthday | 1700 | Med | GCD over prefix sums; combines two must-know interview techniques. | ||
| 37 | Good Array | 1600 | Med | Count subarrays using sorted order + prefix sum; elegant O(n log n) optimization. | ||
| 38 | Diluc and Sucrose | 1600 | Med | Balance split via prefix sums; tests modular arithmetic application. | ||
| 39 | Compress | 1600 | Med | Prefix maximum for interval optimization; compound prefix technique. | ||
| 40 | Vampiric Powers, Let's Go! | 1500 | Easy | Prefix XOR + hash map to count pairs; combines two elegant patterns. | ||
| 41 | Inversion Graph | 1600 | Med | Graph connectivity via prefix-max observation; frequently reinvented in interviews. | ||
| 42 | Busy Robot | 1500 | Easy | Cumulative result calculation; tests prefix sum as state machine. | ||
| 43 | Element Extermination | 1700 | Med | Game state via prefix sums; prefix sum variant for game theory problems. | ||
| 44 | Co-Growing Sequence | 1500 | Easy | Running XOR construction; tests bit-manipulation fluency. | ||
| 45 | And Then There Were K | 1700 | Med | Prefix AND operations; bitwise prefix variant for bit-heavy problems. | ||
| 46 | Make Them Equal | 1600 | Med | Difference array optimization; range update pattern with prefix sums. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 5: TREES & GRAPHS – DFS/BFS (Problems 47–57) | ||||||
| 47 | Ehab and Path-XOR | 1600 | Med | XOR on tree paths via DFS; tree + bit manipulation combo for Walmart/Uber. | ||
| 48 | Graph Transitiveness | 1500 | Easy | Graph clique detection via complement; graph theory reasoning for OAs. | ||
| 49 | Assigning to Classes | 1500 | Easy | Connected component counting via DFS; foundation for graph traversal problems. | ||
| 50 | Grid Path Constructor | 1600 | Med | Grid pathfinding via observation; graph traversal with coordinate system. | ||
| 51 | Euclid and his Modern Computer | 1700 | Med | Graph construction with arithmetic rules; BFS on abstract graph. | ||
| 52 | Controller | 1700 | Med | Game state representation as graph; dynamic graph manipulation. | ||
| 53 | Divide by Three | 1700 | Med | State-space BFS for optimization; treats problem as graph traversal. | ||
| 54 | Marooush and the Large Cherry | 1600 | Med | Multi-target pathfinding via BFS; shortest path with constraints. | ||
| 55 | Robot Collisions | 1700 | Med | Graph simulation with DFS; event-based graph processing. | ||
| 56 | Long Multiplication | 1700 | Med | Constraint propagation via DFS; graph for constraint satisfaction. | ||
| 57 | Mocha and Stairs | 1700 | Med | Hidden graph structures via DFS; teaches graph recognition. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 6: DYNAMIC PROGRAMMING (Problems 58–68) | ||||||
| 58 | Sum of Subsets | 1700 | Med | Subset-sum counting with bitmask DP; DP over subsets for Samsung/Adobe. | ||
| 59 | Web of Lies | 1600 | Med | Tree DP for subset constraints; tree DP recurrence design. | ||
| 60 | Carrying Coins | 1600 | Med | DP state with binary search; DP + binary search hybrid optimization. | ||
| 61 | Block Chords | 1600 | Med | Interval DP with greedy choice; teaches DP state design for intervals. | ||
| 62 | Product 1 Modulo N | 1700 | Med | DP on multiplicative group; advanced number-theoretic DP. | ||
| 63 | Dominoes Painting | 1700 | Med | Combinatorial DP for tiling; DP state counting for grid-based problems. | ||
| 64 | Planar Reflections | 1700 | Med | DP with coordinate compression; compressing large coordinate spaces for DP. | ||
| 65 | Baby Ehab Partitions Again | 1600 | Med | Knapsack variant; partition DP for subset optimization. | ||
| 66 | Two Permutations | 1700 | Med | DP over permutation structures; permutation DP recurrence design. | ||
| 67 | Compressed String | 1600 | Med | String DP for compression problems; DP on string decomposition. | ||
| 68 | Coronavirus | 1700 | Med | Multi-source BFS DP; state-space DP for expanding frontiers. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 7: STRINGS & PATTERN MATCHING (Problems 69–79) | ||||||
| 69 | Minimum Notation | 1600 | Med | Lexicographically smallest via monotonic stack; stack + greedy for every top OA. | ||
| 70 | Strange Function | 1400 | Easy | Greedy character removal; substring manipulation under rules. | ||
| 71 | Hongcow's Game | 1500 | Easy | String greedy optimization; teaches string constraint analysis. | ||
| 72 | Balanced Bracket Sequence | 1400 | Easy | Bracket balancing classic; foundation for all bracket/parenthesis problems. | ||
| 73 | Searching for Escaped Shapes | 1500 | Easy | Hidden pattern detection in strings; teaches observation over implementation. | ||
| 74 | Coin Change Rounds | 1600 | Med | String DP for sequences; state-based string processing. | ||
| 75 | Andrew and Stones | 1700 | Med | Character frequency-based optimization; tests grouping and counting. | ||
| 76 | Nastya and a Shock | 1600 | Med | Prefix-based string pattern; prefix variant on strings. | ||
| 77 | Greedily Increasing Sequence | 1600 | Med | Subsequence extraction via greedy; greedy matching on strings. | ||
| 78 | Increase and Decrease | 1500 | Easy | String transformation via greedy ops; operation sequencing. | ||
| 79 | Dog Show | 1600 | Med | String permutation under constraints; permutation greedy on strings. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 8: NUMBER THEORY & BIT MANIPULATION (Problems 80–89) | ||||||
| 80 | Hossam and Trainees | 1700 | Med | Largest prime factor via sieve; sieve problems are recurring interview topic. | ||
| 81 | Ternary XOR | 1400 | Easy | Digit-by-digit greedy construction with XOR; builds constructive intuition. | ||
| 82 | Circular Mirror | 1500 | Easy | Parity observation on circular structure; elegant one-liner insights. | ||
| 83 | Petya and Exam | 1600 | Med | Modular arithmetic optimization; teaches mod constraint handling. | ||
| 84 | girlscout2 | 1500 | Easy | Bit-by-bit greedy construction; tests bit manipulation fluency. | ||
| 85 | And Then There Were K | 1700 | Med | Bitmask optimization via greedy removal; teaches bitmask DP patterns. | ||
| 86 | Magic Grid | 1600 | Med | Recursive construction with XOR properties; divide & conquer on grids. | ||
| 87 | K-Complete Sentence | 1600 | Med | Bit manipulation with modular structure; teaching periodic bit patterns. | ||
| 88 | number game | 1700 | Med | Game theory on number properties; combining game + number theory. | ||
| 89 | Removing Smallest Multiples | 1700 | Med | Greedy divisibility selection; teaches number-theoretic greedy reasoning. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 9: CONSTRUCTIVE & MATHEMATICAL PATTERNS (Problems 90–100) | ||||||
| 90 | Labs | 1600 | Med | Interleaving arrays to satisfy diff constraints; parity + sorting insight. | ||
| 91 | Not Adjacent Matrix | 1500 | Easy | Constructive placement with checkerboard pattern; teaches construction reasoning. | ||
| 92 | Petya's Exam | 1600 | Med | Greedy construction under constraints; teaching when to construct greedily. | ||
| 93 | Omkar and Determination | 1700 | Med | Construction from observation; teaches problem analysis before coding. | ||
| 94 | Worms | 1500 | Easy | Construction with binary search; combining construction + BS for efficiency. | ||
| 95 | Inversion Swaps | 1700 | Med | Construction via inversion counting; teaches counting-based construction. | ||
| 96 | Zero Path | 1700 | Med | Path construction with mathematical constraints; math-driven construction. | ||
| 97 | A-B Testing | 1600 | Med | Constructive optimization with binary search; teaching construction verification. | ||
| 98 | Alice and the Cake | 1600 | Med | Constructive greedy solution; teaches when greedy construction works. | ||
| 99 | Chicken Chicks | 1700 | Med | Construction via mathematical observation; tests insight-before-code. | ||
| 100 | Stripes | 1600 | Med | Pattern construction from constraints; teaching constraint analysis for construction. | ||
| No. | Problem | Rating | Diff | Tags | Why It Matters | |
|---|---|---|---|---|---|---|
| ★ TOPIC 10: ADVANCED PATTERNS & HYBRID TECHNIQUES (Problems 101–115) | ||||||
| 101 | Division by Two and Permutation Sums | 1700 | Med | Greedy matching with multi-level constraints; teaches complex matching logic. | ||
| 102 | Element Extermination | 1700 | Med | Game-theoretic observation via mathematical reasoning; tests game analysis. | ||
| 103 | Fence Painting | 1400 | Easy | Pattern observation + greedy; teaches elegant insight-based solutions. | ||
| 104 | Busy Robot | 1700 | Med | Event-based simulation with binary search; teaches event ordering concepts. | ||
| 105 | Media Magician | 1600 | Med | Median-based optimization; teaches median selection in greedy problems. | ||
| 106 | School Marks | 1700 | Med | Multi-constraint satisfaction via binary search + construction. | ||
| 107 | Euclid and his Modern Computer | 1700 | Med | Abstract graph construction via number theory; teaches creative graph modeling. | ||
| 108 | Controller | 1700 | Med | Game state graphs with DFS analysis; teaches game state modeling. | ||
| 109 | Minimum Partition into Two Balanced Subsequences | 1700 | Med | Sophisticated two-pointer logic with greedy; teaching advanced pointer techniques. | ||
| 110 | Divide by Three | 1700 | Med | State-space exploration with BFS optimization; teaches implicit graph BFS. | ||
| 111 | Robot Collisions | 1700 | Med | Collision simulation with graph analysis; teaches simulation graph design. | ||
| 112 | Long Multiplication | 1700 | Med | Constraint satisfaction via DFS propagation; teaches constraint graphs. | ||
| 113 | Mocha and Stairs | 1700 | Med | Graph recognition from problem structure; teaches implicit graph discovery. | ||
| 114 | KHCODE | 1600 | Med | Binary search with complex validation logic; hybrid algorithm design. | ||
| 115 | Mark the Pianist | 1700 | Med | BS + greedy combo for optimization; teaches algorithm composition patterns. | ||