Infosys Coding Interview Questions
These are the coding problems tagged as asked at Infosys in interviews and online assessments reported by candidates. Use the list to see which topics repeat, then solve the problems in order of difficulty: basics first, then the intermediate and advanced ones.
Reported questions change over time and are not a guarantee of what you will be asked, so treat them as a map of the patterns Infosys tends to test rather than a list to memorise. For each problem, practise explaining your approach, its time and space cost and the edge cases before you write the code.
Coding problems
- Two Sum (Basic)
- Contains Duplicate (Basic)
- Best Time to Buy and Sell Stock (Basic)
- Maximum Subarray (Intermediate)
- Valid Parentheses (Basic)
- Longest Substring Without Repeats (Intermediate)
- Product of Array Except Self (Intermediate)
- Move Zeroes (Basic)
- Search Insert Position (Basic)
- Rotate Array (Intermediate)
- Climbing Stairs (Basic)
- House Robber (Intermediate)
- Coin Change (Intermediate)
- Longest Increasing Subsequence (Advanced)
- Reverse String (Basic)
- Valid Palindrome (Basic)
- Kth Largest Element (Intermediate)
- Majority Element (Basic)
- Missing Number (Basic)
- Intersection of Two Arrays (Basic)
- Two Sum in a Sorted Array (Basic)
- Minimum Size Subarray Sum (Intermediate)
- Longest Consecutive Sequence (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Container With Most Water (Intermediate)
- Trapping Rain Water (Advanced)
- Longest Palindromic Substring (Intermediate)
- Valid Anagram (Basic)
- Power of Two (Basic)
- Fibonacci Number (Basic)
- Sort Colors (Basic)
- Squares of a Sorted Array (Basic)
- Largest Rectangle in Histogram (Advanced)
- Daily Temperatures (Intermediate)
- Reverse Words in a String (Basic)
- Integer to Roman (Intermediate)
- Roman to Integer (Intermediate)
- Add Binary (Basic)
- Edit Distance (Advanced)
- Reverse Integer (Intermediate)
- Longest Valid Parentheses (Advanced)
- Search in a Rotated Sorted Array (Advanced)
- Minimum in a Rotated Sorted Array (Intermediate)
- Peak Index in a Mountain Array (Intermediate)
- Concatenation of an Array (Basic)
- Merge Intervals (Intermediate)
- Partition Labels (Intermediate)
- Candy Distribution (Advanced)
- Is Subsequence (Basic)
- Maximum Product of Three (Basic)
- Zigzag Conversion (Intermediate)
- Find K Closest Elements (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Minimum Path Sum (Intermediate)
- Maximum Circular Subarray (Intermediate)
- Best Time to Buy and Sell Stock II (Intermediate)
- House Robber II (Intermediate)
- Next Permutation (Intermediate)
- Gas Station (Intermediate)
- Container With Most Water (Intermediate)
- Top K Frequent Values (Intermediate)
- Longest Palindromic Subsequence (Intermediate)
- Minimum Window Substring (Advanced)
- Course Schedule Feasible (Intermediate)
- Weighted Job Scheduling (Intermediate)
- Reverse Linked List (Basic)
- Merge Two Sorted Lists (Basic)
- Palindrome Linked List (Basic)
- Odd Even Linked List (Intermediate)
- Reorder Linked List (Intermediate)
- Maximum Depth of Binary Tree (Basic)
- Binary Tree Maximum Path Sum (Advanced)
- Delete Node in a BST (Intermediate)
- Number of Islands (Basic)
- Rotting Oranges (Intermediate)
- Keys and Rooms (Basic)
- Regular Expression Matching (Advanced)
- Delete and Earn (Intermediate)
- Find First Occurrence (Basic)
- String to Integer (Intermediate)
Related
- Company interview roadmaps
- Practice coding problems online
- System design interview questions
- SDE-2 interview preparation
- All interview question topics
Frequently asked questions
How should I use the Infosys problem list?
Sort by the topics you are weakest in, solve a problem under a timer, then read the explanation. Repeat until the patterns feel familiar, and finish with a mock interview.
Are these the exact Infosys interview questions?
They are problems candidates reported being asked. Companies rotate questions, so use them to learn the patterns, not to predict the exact question.