99 problems · 31 Easy, 53 Medium, 15 Hard · Ranked #14 of 458
Difficulty breakdown
31 Easy
31% · avg 23%
53 Medium
54% · avg 59%
15 Hard
15% · avg 18%
Top topics
array
60.6%
string
24.2%
math
22.2%1.8x
dynamic-programming
21.2%
sorting
17.2%
two-pointers
17.2%
Interview profile
Based on 99 reported problems, Infosys interviews are in line with industry averages - 15% Hard vs 18% overall. The majority (54%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.
Compared to the industry average, Infosys puts unusual emphasis on number-theory (2% of problems, 3.9x the industry average), combinatorics (2% of problems, 3.6x the industry average), segment-tree (2% of problems, 3.3x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (60.6%), string (24.2%), math (22.2%), dynamic-programming (21.2%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 99 problems
Problem
Difficulty
Frequency
Topics
Two Sum
Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.
You are given an integer n and an integer p representing an array arr of length n where all elements are set to 0's, except position p which is set to 1. You ar...
You are given an integer array nums. Transform nums by performing the following operations in the exact order specified: Replace each even number with 0, replac...
You are given an integer array pizzas of size n, where pizzas[i] represents the weight of the ith pizza. Every day, you eat exactly 4 pizzas. When you eat pizza...
You are given an array points of size n and an integer m. There is another array gameScore of size n, where gameScore[i] represents the score achieved at the it...
You are given an integer array coins of length n which represents the n coins that you own. The value of the ith coin is coins[i]. You can make some value x if...
There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You are also given a 2D...
You are given two 0-indexed integer arrays nums and removeQueries, both of length n. For the ith query, the element in nums at the index removeQueries[i] is rem...
You are given an integer array nums. Your task is to find the number of pairs of non-empty subsequences (seq1, seq2) of nums that satisfy two conditions: the su...
You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of length 10 that maps each digit 0-9 to anoth...
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number....
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, an...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is inc...
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then ret...
There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer ex...
You are given an integer n and an integer p representing an array arr of length n where all elements are set to 0's, except position p which is set to 1. You ar...
You are given an integer array nums. Transform nums by performing the following operations in the exact order specified: Replace each even number with 0, replac...
You are given an integer array pizzas of size n, where pizzas[i] represents the weight of the ith pizza. Every day, you eat exactly 4 pizzas. When you eat pizza...
MediumVery Likely
greedyarraysorting
Maximum Sum of Subsequence With Non-adjacent Elements
You are given an array points of size n and an integer m. There is another array gameScore of size n, where gameScore[i] represents the score achieved at the it...
HardVery Likely
greedyarraybinary-search
Find the Minimum Possible Sum of a Beautiful Array
You are given an integer array coins of length n which represents the n coins that you own. The value of the ith coin is coins[i]. You can make some value x if...
There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You are also given a 2D...
You are given two 0-indexed integer arrays nums and removeQueries, both of length n. For the ith query, the element in nums at the index removeQueries[i] is rem...
You are given an integer array nums. Your task is to find the number of pairs of non-empty subsequences (seq1, seq2) of nums that satisfy two conditions: the su...
You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of length 10 that maps each digit 0-9 to anoth...
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number....
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, an...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is inc...
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then ret...
There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer ex...
Given an integer array nums, find three numbers whose product is maximum and return the maximum product.
EasySometimes
arraymathsorting
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Infosys interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your Infosys coding interview
Infosys interviews focus heavily on array, string, math problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. Infosys interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does Infosys ask in interviews?add
Infosys has been reported to ask 99 distinct coding problems. The most common topics are array, string, math. 31 are Easy difficulty, 53 are Medium, and 15 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are Infosys coding interviews?add
Based on 99 reported problems, Infosys interviews are in line with industry averages - 15% Hard vs 18% overall. 54% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a Infosys coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, math. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real Infosys coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.