Placement Prep · 2025–26

115 Must-Solve Codeforces
Div 2 · Problem C

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.

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