Infosys
Round-by-round question patterns, past problem types, track-specific roadmaps, and Grand Finale prep. SP (₹9.5 LPA) to Champion (₹21 LPA).
Max CTC
₹21 LPA
Rounds
3 Rounds
Grand Finale
Top 100
Prep Time
3–9 months
Apply now for Infosys HackWithInfy 2026! Registration is currently active.
Challenging for freshers
3–9 months
No
Enter your email and we'll send it straight to your inbox.
Each round is a separate elimination gate. You can exit with an offer after Round 1 (SP track) or go deeper for PP/Champion roles.
These are the problem patterns that have appeared across multiple HackWithInfy editions. The problem names are real — "Oil Tank" and "General Ali's" are actual past problems. The Hard problems rotate but always require Graph or advanced DP.
Given a sequence of fill and drain operations on an oil tank with a max capacity, simulate the state after each operation and return the final volume. Tests basic array traversal and boundary clamping (max/min).
Approach
Iterate the operations array. Maintain a running total. Clamp between 0 and capacity on each step. Time: O(N), Space: O(1).
Rearrange characters of a string such that no two adjacent characters are the same. Return the rearranged string or "-1" if impossible.
Approach
Count frequencies with a HashMap. Use a max-heap (priority queue). Repeatedly extract the two most frequent characters and append alternately. Time: O(N log K), Space: O(K).
N soldiers stand in a row. In each round, all soldiers at even positions are eliminated. Count how many rounds until only 1 soldier remains. A variation tests which position survives given K rounds.
Approach
Observe the pattern: soldiers halve each round. Answer is ceil(log2(N)) rounds. For position survival, track which indices survive each halving. Time: O(log N).
Given a string with brackets and wildcard characters (*), count the number of ways wildcards can be replaced with (, ), or empty string to form a valid balanced sequence.
Approach
DP with (min_open, max_open) range tracking. For each character, update the valid open-bracket range. If max_open < 0 at any point, return 0. Final answer is valid if 0 is in [min, max]. Time: O(N).
Given a weighted graph, count pairs of nodes (u, v) where the shortest path length falls within a given range [L, R]. "Beauty" of a pair is defined by the path cost. Tests shortest path + range counting.
Approach
Run Dijkstra's from every source node. Collect all-pairs shortest paths. Use a sorted array + binary search to count pairs in [L, R]. Time: O(V * (E log V) + V² log V). Space: O(V²).
Given an array of N integers, count the number of non-empty subsets whose XOR equals exactly K. For large N, a naive O(2^N) solution will TLE.
Approach
For small N (≤20): Bitmask enumeration O(2^N). For N>20: Meet-in-the-Middle — split array, enumerate XOR of all subsets of each half, then for each XOR value in the left half, binary search for K⊕left in the right half. Time: O(2^(N/2) * N).
Round 2 is where the SP track ends and the PP track begins. These patterns have appeared consistently. Every solution must be optimal — test cases are designed to TLE O(N²) and worse.
Select the maximum number of non-overlapping activities. Each activity has start and end time. Sort by end time and greedily pick. Extended variants: weighted job scheduling (DP + binary search).
Connect all cities/nodes with minimum total edge weight. Kruskal's uses Union-Find + sort edges. Prim's uses a min-heap. HWI variants often pre-connect some nodes (use Union-Find to handle).
Find LIS with constraints (max diff D between elements, K replacements allowed, etc.). Standard O(N²) DP TLEs — need O(N log N) patience sorting with binary search (lower_bound).
Count numbers in range [L, R] satisfying a digit-based condition (e.g., digit sum divisible by K, no two adjacent digits same, count of a specific digit ≤ M). State: (position, tight, carry/sum).
Problems where the state depends on subtree properties. Common: max independent set on tree, tree diameter, rerooting technique for "all-root" answers. Post-order DFS + memoization.
Assign N tasks to M workers (N, M ≤ 20) minimising cost. State: bitmask of assigned tasks. Transition: try assigning next task to next worker. Also used in TSP variants.
Pick your target track before you start preparing. The SP track and PP/Champion track require completely different preparation intensity.
| Role | CTC | How to get it | Prep (months) | LeetCode target |
|---|---|---|---|---|
| Systems Engineer (SE) | ₹3.6–4.0 LPA | Infosys NQT (not HWI) | 1–2 months | LeetCode Easy (50 problems) |
| Digital Specialist Engineer (DSE) | ₹6.25 LPA | HWI Round 1 — partial solve | 2–3 months | LeetCode Easy–Medium (100 problems) |
| Specialist Programmer (SP) | ₹9.5–11.0 LPA | HWI Round 1 — solve all 3 | 3–5 months | LeetCode Medium–Hard (150+ problems) |
| Power Programmer (PP) | ₹10.0–12.0 LPA | HWI Round 2 / Round 3 | 6–8 months | Codeforces 1200+ / LeetCode 200+ Hard |
| SP Level 1 / Level 2 | ₹16.0–21.0 LPA | Grand Finale Champion | 8–9 months | Codeforces Specialist 1400+ / LeetCode Knight 1800+ |
Most guides stop at Round 2. This is what the Grand Finale actually looks like — from someone who has been there.
Most students read the pattern and move on. The ones who get placed practice it. Get the Infosys HackWithInfy question bank — real questions, model answers, verified by 2024–25 placed students.
Every DP pattern, every Graph algorithm, every Round 2 template — in one bundle.
Get the Complete 22 PDF Prep Bundle — ₹79SP/PP/Champion tracks · Round 1 & 2 patterns · Grand Finale prep · 22 curated PDFs
Technical Round Simulator
Timed coding rounds, HWI difficulty levels
DSA Progress Tracker
Track LeetCode problem count by topic
Aptitude Simulator
Practice MCQ round under timed conditions
HackWithInfy is a pure coding challenge. Strengthen your DSA patterns and speed.
100+ DSA problems in a real interview environment — Monaco editor, Python/Java/C++/JS, AI code review.
Track solved problems, streak, topic-wise coverage — stay consistent leading up to your test date.
CS fundamentals — DBMS, OS, CN, OOPs — with adaptive difficulty and detailed explanations.
Preparing for multiple companies? These guides cover the full 2025–26 placement season.
Global coding contest → direct Ninja/Digital offer
Ninja → Digital → Prime roles in one test
Earn while you learn — sponsored M.Tech
GenC → GenC Elevate → GenC Next tracks
Analyst → Analyst Star → Senior Analyst
ASE → AASE → AE — full-stack evaluation
Also check out our Aptitude Simulator and Placement Roadmap for a complete prep plan.
View all company roadmaps