August 29, 2026

Top 80 Questions for Infosys Round 2 Offline Practice SP/DSE Coding Preparation for Beginner Intermediate and Advance

Infosys SP DSE coding questions, Infosys Round 2 preparation, Infosys SP DSE preparation, Infosys coding questions, Infosys coding round questions, Infosys Round 2 coding preparation, Infosys SP DSE coding round, Infosys coding test preparation, Infosys coding questions practice, Infosys DSA questions, Infosys SP coding questions, Infosys DSE coding questions, Infosys previous year questions, Infosys PYQ coding questions, Infosys LeetCode questions, Infosys coding assessment preparation, Infosys Round 2 DSA, Infosys SP DSE LeetCode questions

Infosys SP/DSE Round 2 Preparation 2026 – Coding, DSA & Interview Guide

Infosys SP/DSE Round 2 is approaching, and if your DSA preparation is not strong yet, do not panic. With limited time available, the biggest mistake you can make is trying to solve hundreds of random coding questions without understanding the patterns behind them.

A better approach is to first identify your current preparation level, understand which DSA patterns deserve the most attention, practise representative problems, and then improve your speed through timed practice.

This guide is designed around the supplied Infosys SP/DSE Round 2 preparation material. It divides candidates into three broad preparation categories: students who are new to coding, intermediate DSA students who are comfortable with basic topics but weak in DP/Graphs/Trees, and candidates who already know advanced DSA but need more speed, accuracy and assessment practice.

The reference material describes Round 2 preparation around a coding assessment containing multiple coding problems and hidden test cases. However, this page should be treated as a preparation strategy and practice guide, not as an official Infosys syllabus or a guaranteed list of questions.

Important: The questions and patterns discussed below are for practice. They should not be treated as predictions of the exact questions that will appear in your assessment. Hiring processes and assessment patterns can change between drives and roles.

Which Category of Student Are You?

Category 1 — New to Coding or Very Weak in DSA

If you are genuinely new to coding and have only a few days remaining, do not suddenly attempt to learn every advanced Dynamic Programming, Graph and Tree algorithm from scratch. That may consume most of your preparation time without giving you enough opportunity to practise.

Instead, concentrate on a smaller collection of high-value patterns: Greedy, Sliding Window, Two Pointer, HashMap/Prefix Sum and Bit Manipulation.

The goal for this category is not to become an advanced competitive programmer in a few days. Your goal should be to become comfortable enough with several common patterns that you can identify an easier problem, implement it correctly and handle basic edge cases.

A practical target is to solve the easiest problem completely and then attempt another problem with a correct baseline approach if time permits.

Category 2 — Intermediate DSA but Weak in DP/Graph/Tree

If you already understand arrays, strings, sorting, recursion and basic data structures, your main weakness may not be coding itself. It may be pattern recognition.

For this category, spend more time on:

  • Dynamic Programming
  • Knapsack and Partition DP
  • Graph BFS and DFS
  • Topological Sort
  • Shortest Path basics
  • Tree recursion
  • Tree DP fundamentals

Do not spend the entire preparation period watching tutorials. Learn a pattern, close your notes and implement it yourself. For DP, remember: State → Transition → Base Case → Iteration Order → Answer.

For Trees, first understand what your recursive function returns to its parent. For Graphs, identify whether the problem is about reachability, connected components, ordering, shortest path or minimum connection cost.

Category 3 — You Already Know DP, Graph and Tree

If you are already comfortable with advanced DSA, your preparation should look different. Do not spend most of your remaining time watching beginner tutorials.

Your biggest gains will now come from:

  • Speed
  • Pattern switching
  • Implementation accuracy
  • Edge-case handling
  • Complexity analysis
  • Hidden-test robustness
  • Time management

Use timed mixed sets, coding contests, previous-question-pattern practice and Infosys-style coding practice. After every session, record why you failed a question. Was it a pattern-recognition issue? An implementation bug? Poor complexity? An overlooked edge case? Or simply running out of time?

The 80 Questions You Should Practise

The following 80-question structure follows the pattern-wise organization of the supplied preparation material. Direct LeetCode problems are linked wherever a suitable match exists. For generic academic problems, a relevant practice resource is used rather than pretending that there is an exact LeetCode equivalent.

Do not treat these 80 questions as 80 separate topics. The purpose is to identify the underlying patterns. If you understand why several problems belong to the same pattern, you will be better prepared to solve an unfamiliar question.

1. Greedy — Must Do

Greedy problems are useful during short preparation windows because many of them can be solved once you understand the correct local decision. The important part is not memorising the final code. You should be able to explain why the greedy choice does not prevent an optimal solution later.

  1. Activity Selection — Sort activities by finishing time and repeatedly choose the earliest compatible activity. Practise Activity Selection
  2. Jump Game — Track the farthest position that can currently be reached. LeetCode #55 — Jump Game
  3. Jump Game II — Treat reachable positions like expanding ranges and determine when another jump becomes necessary. LeetCode #45 — Jump Game II
  4. Gas Station — Understand why a failed starting position can be skipped. LeetCode #134 — Gas Station
  5. Partition Labels — Use the last occurrence of characters to determine valid partition boundaries. LeetCode #763
  6. Assign Cookies — Sort the requirements and available cookies and satisfy the smallest requirement first. LeetCode #455
  7. Non-overlapping Intervals — Keep intervals that finish earliest to maximise the number of compatible intervals. LeetCode #435
  8. Minimum Arrows to Burst Balloons — Sort by endpoint and place each arrow as early as possible. LeetCode #452
  9. Boats to Save People — Sort the people and use two pointers to pair the heaviest person with the lightest possible partner. LeetCode #881
  10. Task Scheduler — Understand how the most frequent task determines the required scheduling structure. LeetCode #621

2. Sliding Window / Two Pointer — Must Do

Sliding Window is one of the most useful patterns to practise when preparation time is limited. Before writing code, clearly define what makes your current window valid and what condition forces you to shrink it.

  1. Longest Substring Without Repeating Characters — Variable-size window with frequency or last-seen information. LeetCode #3
  2. Longest Repeating Character Replacement — Maintain a window where the number of replacements required remains within the allowed limit. LeetCode #424
  3. Permutation in String — Practise a fixed-size frequency window. LeetCode #567
  4. Minimum Window Substring — Expand until the window becomes valid and then contract it while maintaining validity. LeetCode #76
  5. Fruit Into Baskets — Find the longest subarray containing at most two distinct values. LeetCode #904
  6. Max Consecutive Ones III — Maintain a window containing at most k zeroes. LeetCode #1004
  7. Subarray Product Less Than K — Practise multiplicative sliding-window reasoning for positive values. LeetCode #713
  8. Count Number of Nice Subarrays — Learn the exactly-k technique through prefix counting or an at-most formulation. LeetCode #1248
  9. Longest Subarray With At Most K Frequency — Maintain frequency restrictions while moving the window. LeetCode #2958
  10. 3Sum — Sort the array, fix one value and use two pointers while carefully handling duplicates. LeetCode #15

3. HashMap / Prefix Sum — Must Do

HashMap and Prefix Sum techniques are particularly useful because they can convert apparently quadratic subarray problems into much more efficient solutions. The important concept is understanding what information you should store while scanning the array.

  1. Two Sum — Store previously seen values and search for the required complement. LeetCode #1
  2. Subarray Sum Equals K — Combine prefix sums with a frequency map. LeetCode #560
  3. Subarray Sums Divisible by K — Store prefix-sum remainders and handle negative modulo carefully. LeetCode #974
  4. Longest Subarray With Sum K — Store the earliest index for each prefix sum. Practise Longest Subarray With Sum K
  5. Longest Consecutive Sequence — Use a hash set and start counting only when the previous value is absent. LeetCode #128
  6. Group Anagrams — Build a canonical frequency-based key. LeetCode #49
  7. Top K Frequent Elements — Combine frequency counting with a heap or bucket-based approach. LeetCode #347
  8. First Unique Character in a String — Count frequencies and then perform a second traversal. LeetCode #387
  9. Longest Zero-Sum Subarray — Equal prefix sums indicate that the section between them has zero sum. Practise Zero-Sum Subarray
  10. Count Subarrays With XOR K — Use prefix XOR together with a frequency map. Practise XOR K

4. Bit Manipulation — Must Do

Bit Manipulation has a relatively small set of recurring ideas. Instead of memorising many separate solutions, understand XOR, bit shifts, set-bit operations and the lowest-set-bit technique.

  1. Single Number — XOR cancels equal pairs. LeetCode #136
  2. Single Number II — Count bits when other numbers occur three times. LeetCode #137
  3. Counting Bits — Build the answer using a recurrence based on lower values. LeetCode #338
  4. Power of Two — A positive power of two contains exactly one set bit. LeetCode #231
  5. Number of 1 Bits — Practise Brian Kernighan's lowest-set-bit technique. LeetCode #191
  6. Missing Number — XOR indices and values to cancel matching numbers. LeetCode #268
  7. Reverse Bits — Construct the result one bit at a time. LeetCode #190
  8. Divide Two Integers — Use shifts and subtraction while respecting integer boundaries. LeetCode #29
  9. Maximum XOR of Two Numbers in an Array — Explore trie-based and greedy-prefix reasoning. LeetCode #421
  10. Bitwise AND of Numbers Range — Identify the common high-bit prefix. LeetCode #201

5. DP — Knapsack / Partition / Subset

If you fall into Category 2, this section deserves serious attention. Do not memorise individual DP solutions. Instead, understand the reusable concepts behind take/skip decisions, subset reachability, counting DP and unbounded choices.

  1. 0/1 Knapsack — Learn the take/skip transition and understand both 2D and space-optimized implementations. Practise 0/1 Knapsack
  2. Subset Sum — Boolean DP that determines whether a target sum can be formed. Practise Subset Sum
  3. Partition Equal Subset Sum — Convert equal partition into a subset-sum problem. LeetCode #416
  4. Count of Subsets With Sum K — Counting DP with special attention to zero values. Practise Count of Subsets
  5. Target Sum — Understand the transformation from sign assignment to subset-sum reasoning. LeetCode #494
  6. Minimum Difference Partition — Determine reachable sums and minimise the difference between two groups. Practise Minimum Difference Partition
  7. Coin Change — Unbounded choice where the objective is to minimise the number of coins. LeetCode #322
  8. Coin Change II — Count combinations and understand why iteration order matters. LeetCode #518
  9. Unbounded Knapsack — Understand how reusable items change the transition and iteration pattern. Practise Unbounded Knapsack
  10. Partition Array for Maximum Sum — Partition DP based on the previous k positions. LeetCode #1043

6. Graph — BFS / DFS / Topological Sort / Shortest Path

Graph preparation becomes much easier when you stop treating every problem as a completely new algorithm. First identify what the nodes and edges represent. Then determine whether the problem requires DFS, BFS, Topological Sort, Dijkstra, a bounded shortest-path approach or a Minimum Spanning Tree.

  1. Number of Islands — Practise DFS/BFS traversal on a grid. LeetCode #200
  2. Rotting Oranges — Multi-source BFS where each level represents another unit of time. LeetCode #994
  3. Clone Graph — Map original nodes to cloned nodes while traversing the graph. LeetCode #133
  4. Detect Cycle in Undirected Graph — Use DFS with parent tracking or DSU. Practise Cycle Detection
  5. Detect Cycle in Directed Graph — Use DFS recursion-stack logic or Kahn's algorithm. Practise Directed Cycle Detection
  6. Course Schedule II — Topological ordering combined with cycle detection. LeetCode #210
  7. Network Delay Time — Dijkstra's algorithm using a min-heap. LeetCode #743
  8. Cheapest Flights Within K Stops — Practise bounded shortest-path reasoning. LeetCode #787
  9. Word Ladder — BFS on an implicit graph. LeetCode #127
  10. Minimum Cost to Connect All Points — Practise Minimum Spanning Tree using Prim or Kruskal. LeetCode #1584

7. Trees / BST — Recursion + Tree DP

Tree questions become much easier once you clearly understand what each recursive call is supposed to return. Start with traversal and depth problems before moving to LCA, path sums, construction and tree DP.

  1. Maximum Depth of Binary Tree — Base case plus maximum child depth. LeetCode #104
  2. Diameter of Binary Tree — Calculate subtree heights while maintaining the best diameter. LeetCode #543
  3. Balanced Binary Tree — Return height or a failure signal when a subtree becomes unbalanced. LeetCode #110
  4. Validate Binary Search Tree — Use valid bounds or inorder traversal properties. LeetCode #98
  5. Kth Smallest Element in BST — Remember that inorder traversal of a BST is sorted. LeetCode #230
  6. Lowest Common Ancestor of Binary Tree — Combine results from left and right subtrees. LeetCode #236
  7. Path Sum III — Prefix-sum map over root-to-node paths. LeetCode #437
  8. Construct Binary Tree from Preorder and Inorder Traversal — Use an index map and recursive boundaries. LeetCode #105
  9. Binary Tree Maximum Path Sum — Return the best downward path and update the global path through each node. LeetCode #124
  10. All Nodes Distance K in Binary Tree — Build parent relationships and perform BFS from the target. LeetCode #863

8. Binary Search on Answer / Intervals

Binary Search on Answer is an important optimisation technique. The central question is whether the feasibility condition is monotonic. If increasing the candidate answer changes the feasibility from false to true in one direction, binary search may be possible.

  1. Search in Rotated Sorted Array — At least one half remains sorted. LeetCode #33
  2. Find First and Last Position — Practise lower-bound and upper-bound style binary search. LeetCode #34
  3. Koko Eating Bananas — Binary search the minimum feasible speed. LeetCode #875
  4. Capacity to Ship Packages Within D Days — Binary search capacity and use greedy feasibility checking. LeetCode #1011
  5. Aggressive Cows — Binary search the minimum distance and greedily place cows. Practise Aggressive Cows
  6. Split Array Largest Sum — Binary search the maximum allowed segment sum. LeetCode #410
  7. Merge Intervals — Sort by starting point and merge overlapping ranges. LeetCode #56
  8. Insert Interval — Insert the new interval and merge the affected ranges. LeetCode #57
  9. Non-overlapping Intervals — Keep the interval that finishes earliest. LeetCode #435
  10. Minimum Number of Meeting Rooms — Use endpoint sweeping or a min-heap. Practise Meeting Rooms

How Should You Use These 80 Questions?

Do not try to solve all 80 questions blindly in one sitting. The objective is pattern recognition.

If you solve several Greedy problems, you should begin to recognise when a local choice may work. If you solve several Sliding Window questions, you should start identifying the window condition before writing code. If you practise DP, you should become comfortable identifying state and transition instead of memorising one solution per problem.

For Category 1 Students

Prioritise questions 1–40. You do not need to become an expert in every problem. Learn the basic patterns, solve representative questions and then move toward previous-question-style practice.

For Category 2 Students

Prioritise questions 41–80, especially DP, Graph and Tree problems. Re-code important problems without looking at the solution. If you understand a template but cannot implement it yourself, continue practising until you can.

For Category 3 Students

Use the entire list as a revision checklist. Spend more time on timed contests, mixed problem sets and previous-question-pattern practice. At this stage, your objective is not simply learning another algorithm; it is solving correctly under pressure.

What Should You Do During the Final 5–6 Days?

  1. Identify your category. Do not follow an advanced candidate's preparation plan if you are still struggling with basic DSA.
  2. Learn patterns instead of collecting questions. Ten good questions from one pattern can be more useful than fifty unrelated problems.
  3. Practise without copying. After understanding a solution, close it and implement the approach yourself.
  4. Use timed practice. Try to reproduce assessment pressure instead of solving every problem without a time limit.
  5. Maintain a failure log. Record whether your mistake was caused by pattern recognition, implementation, complexity, edge cases or time management.
  6. Do not spend the entire assessment on one difficult problem. Secure easier opportunities first and return to harder problems later.
  7. Test edge cases. Always think about empty arrays, one-element arrays, duplicate values, negative numbers, integer overflow, boundary indices and large inputs.

A Practical 5-Day Preparation Plan

Day 1 — Greedy + Sliding Window

Begin with Greedy and Sliding Window. Solve representative problems rather than trying to complete every available problem. Focus on identifying why the pattern works and what condition changes the state of your algorithm.

Day 2 — HashMap + Prefix Sum + Two Pointer

Practise problems where storing previous information avoids repeated work. Pay special attention to prefix sums, frequency maps and two-pointer movement conditions.

Day 3 — DP

If you are Category 2 or Category 3, dedicate a large portion of the day to DP. Revise Knapsack, Subset Sum, Partition, Target Sum and Coin Change. For every problem, identify the state and transition before writing code.

Day 4 — Graph + Tree

Revise BFS, DFS, cycle detection, Topological Sort and shortest-path basics. Then practise tree recursion, BST validation, LCA, diameter and path-based problems.

Day 5 — Mixed Timed Practice

Do not learn ten new topics on the final day. Instead, simulate a coding assessment. Pick unseen problems, set a strict timer and practise moving between different patterns. After the session, review every mistake.

What If You Cannot Solve the Optimal Solution?

If the optimal approach does not immediately come to you, first ask whether you can construct a correct baseline solution. A brute-force approach may not pass every hidden test, but developing a correct starting point can help you understand where the optimisation is required.

However, do not intentionally submit inefficient code when the constraints clearly require a better solution. The objective should be to start with a correct idea and then improve its complexity whenever possible.

Before submitting, check:

  • Does the algorithm work for the smallest input?
  • Does it work for the largest input?
  • What happens with duplicates?
  • What happens with negative values?
  • Can integer overflow occur?
  • Is the time complexity acceptable?
  • Is the memory usage reasonable?
  • Have you accidentally accessed an invalid index?

Final Priority Order

If you have only a few days, a practical priority order from the supplied preparation material is:

  1. DP — Knapsack / Partition / Subset
  2. Graph — BFS / DFS / Topological Sort / Shortest Path
  3. Sliding Window / Two Pointer
  4. HashMap / Prefix Sum
  5. Trees / BST
  6. Binary Search on Answer / Intervals
  7. Greedy
  8. Bit Manipulation
  9. Segment Tree / Fenwick Tree — only if your basic DSA foundation is already strong.

This ordering should not be interpreted as an official Infosys ranking. It is a preparation strategy based on the supplied reference material and is intended to help candidates decide where to spend limited preparation time.

What About Hidden Test Cases?

One of the most important differences between practising locally and taking an actual coding assessment is the presence of hidden test cases. A solution that works only for the sample input is not enough.

Before submitting a solution, deliberately test unusual situations. For example, if your solution handles an array, try an empty or minimum-size case where allowed, a single element, repeated values, already sorted data, reverse-sorted data and values near the constraint limits.

For graph problems, think about disconnected components, cycles and isolated nodes. For trees, consider a completely skewed tree as well as a balanced tree. For DP, check zero values and boundary states.

How to Improve Speed Without Sacrificing Accuracy

Speed does not simply mean typing code faster. In a coding assessment, a large amount of time can be lost before implementation because the candidate chooses the wrong approach.

A useful habit is to spend the first few minutes understanding the constraints and identifying the likely pattern. Ask:

  • Is the input sorted?
  • Is the problem asking for a contiguous range?
  • Are we counting frequencies?
  • Can prefix information help?
  • Does the problem contain overlapping subproblems?
  • Is there a monotonic answer space?
  • Does the problem naturally form a graph?
  • Does recursion return useful information to the parent?

These questions can help you reach the right approach before writing a large amount of code.

Common Mistakes Students Make

1. Solving Random Questions

Random practice can create the illusion of progress. Instead, group problems by pattern so that you learn when and why a technique should be used.

2. Watching Too Many Tutorials

Watching a solution is not the same as being able to implement it. After learning an approach, close the tutorial and code it yourself.

3. Ignoring Complexity

A logically correct O(n²) solution may still fail when the constraints require O(n log n) or O(n). Always check the constraints before deciding your approach.

4. Not Testing Edge Cases

Many otherwise correct solutions fail because of empty input, duplicates, negative values, overflow or boundary conditions. Build the habit of testing these cases before submitting.

5. Spending Too Long on One Problem

During an assessment, your objective is to maximise the number of correctly solved problems. If a problem is consuming too much time, move to another question when the assessment format permits it.

Final Message for Students

If you are weak in DSA, do not confuse lack of confidence with lack of ability. You cannot realistically learn every advanced algorithm in a few days, but you can become significantly better at a limited number of high-value patterns through focused practice.

If you are a beginner, concentrate on: Greedy + Sliding Window + HashMap/Prefix Sum + Bit Manipulation.

If you are an intermediate candidate, concentrate on: DP/Knapsack + Graph + Tree.

If you already know advanced DSA, stop spending most of your time learning from scratch and concentrate on: timed practice + contests + previous-question patterns + speed + edge cases.

The supplied preparation material itself presents this as a strategy for maximising useful preparation rather than a promise of exact questions. Use the 80 questions as a structured checklist, not as a guarantee of what will appear in your assessment.

Most importantly, do not spend your final preparation days randomly jumping between hundreds of questions. Pick your category, follow the relevant patterns, practise deliberately, review your mistakes and enter the assessment with a clear strategy.

Quick Revision Checklist Before the Assessment

  • Can you identify a DSA pattern from a new problem?
  • Can you explain the brute-force approach?
  • Can you improve the complexity?
  • Can you state time and space complexity?
  • Can you handle duplicates and boundary cases?
  • Can you implement Sliding Window without looking at notes?
  • Can you explain Prefix Sum + HashMap?
  • Can you identify a basic DP state and transition?
  • Can you implement BFS and DFS?
  • Can you detect cycles in common graph structures?
  • Can you write basic tree recursion?
  • Can you recognise Binary Search on Answer?
  • Can you explain why a greedy choice is valid?
  • Can you use common Bit Manipulation techniques?
  • Have you completed at least one timed mixed practice session?

Frequently Asked Questions

Are these guaranteed Infosys SP/DSE Round 2 questions?

No. These are practice questions and patterns based on the supplied preparation material. They should not be considered a guaranteed question list.

Should beginners attempt all 80 questions?

No. Beginners should first focus on the earlier pattern groups and build confidence with representative problems. The goal is understanding patterns, not completing a number for the sake of completion.

Which topics should intermediate students prioritise?

Intermediate candidates who are already comfortable with basic DSA should give particular attention to DP/Knapsack, Graphs and Trees, while continuing to practise common array and string patterns.

What should advanced candidates do?

Advanced candidates should focus on timed mixed problem sets, contests, previous-question-pattern practice, speed and hidden-test robustness rather than repeatedly watching beginner tutorials.

Is solving the brute-force approach useful?

Yes, if you use it as a stepping stone. A brute-force solution can help you understand the problem and identify where optimisation is required. However, always compare its complexity with the input constraints.

How many questions should I solve every day?

There is no useful universal number. Quality matters more than a fixed count. It is better to deeply understand five representative problems from related patterns than to superficially copy twenty solutions.

Should I practise only LeetCode?

No. LeetCode can provide useful structured practice, but timed contests, previous-question patterns and assessment-style mock tests are also valuable because they introduce time pressure and unfamiliar combinations of patterns.

What is the most important thing before the assessment?

Know your patterns and your own mistakes. You should enter the assessment knowing which approaches you are comfortable with, which edge cases commonly cause bugs and when you should move on from a difficult problem.

Preparation Resource

If you are following this preparation plan, keep the 80-question checklist nearby and mark each problem according to your confidence:

  • Green: Can solve independently.
  • Yellow: Understand approach but need implementation practice.
  • Red: Cannot identify the pattern yet.

On the final revision day, spend most of your time on the yellow problems. They are often the quickest to convert into reliable solving ability because you already understand the underlying idea.

Watch the Full Preparation Series

For additional Infosys preparation, coding practice, placement preparation and hiring updates:

▶ Watch the preparation videos on YouTube — @PrashantKumar.957

Source note: This article is based on the supplied Infosys SP/DSE Round 2 preparation material. The source material identifies three student preparation categories, recommends pattern-based preparation and provides an 80-question practice structure. It also states that the material is a preparation strategy rather than an official Infosys syllabus or guaranteed question list.