Infosys interview experience Real time questions & tips from candidates to crack your interview

Specialist Programmer

Infosys
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Journey
I started with the basics and gradually built my skills through consistent practice in coding, DSA, and problem-solving. There were failures and moments of self-doubt along the way, but I kept learning and improving. I also worked on projects and interview preparation regularly. When the opportunity came, all the small daily efforts paid off, and I was able to crack the interview. My journey taught me that consistency and patience matter more than starting perfectly.
Application story
I got this opportunity through HackWithInfy. There were multiple categories: candidates in the top category were selected for the hackathon interview, while those in the next category were interviewed for full-time opportunities.
Why selected/rejected for the role?
Strong problem-solving skills that I developed during my preparation helped me solve the coding problems quickly during the interview.
Preparation
Duration: 2.5 months
Topics: Data Structures and Algorithms, OOP, Operating Systems, DBMS, C++
Tip
Tip

Tip 1: Practice problems regularly.

Tip 2: Participate in contests.

Tip 3: Attend mock interviews.

Application process
Where: Campus
Eligibility: no eligibility criteria (Salary Package: 11 LPA)
Resume Tip
Resume tip

Tip 1: Have projects.

Tip 2: Mention all your achievements.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration180 minutes
Interview date12 Jul 2025
Coding problem2

It was a 3-hour assessment conducted in the morning, divided into sections.

1. Monotone Increasing Digits

Moderate
35m average time
65% success
0/80
Asked in company
SAP Labs

You are given a non-negative integer ‘N’. Your task is to find the largest number that is less than or equal to ‘N’ with monotone increasing digits.

Note:

An integer has a monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.

For example:

Given ‘N’ = 987
The answer is 899 because that is the greatest monotone increasing number possible that is less than ‘N’.
Problem approach

Step 1: I observed that only adjacent elements matter, so I used a simple loop.

Step 2: For every pair, I calculated:

d = A[i+1] - A[i]

Step 3:

If d > Y, upward movement fails.
If -d > X, downward movement fails.

Then I immediately returned:

2 * (i + 1)

Step 4: If no failure happens till the end, I returned:

N + 1

Try solving now

2. Sub-array Sums Divisible By K

Moderate
25m average time
75% success
0/80
Asked in companies
MicrosoftUKG (Ultimate Kronos Group)BarRaiser

Given an array of integers of size ‘N’ and a positive integer ‘K’. Return the number of non-empty subarrays whose sum is divisible by K.

A subarray is a contiguous subset of an array.


For Example :
Consider an array of size four. The elements of the array are { -4, 5, 6, 1}. 
The value of K is 4. 
The subarrays whose sum is divisible by 4 are as  follows:
[ -4 ] 
[-4, 5, 6, 1] 
[ 5, 6, 1] 
Hence, there are three subarrays whose sum is divisible by 4. 
Problem approach

Step 1:
Initialize a hashmap to store the count of each divisor.

Step 2:
For each number in the array:

Find all its divisors using loop from 1 to sqrt(num)
For each divisor d:
Increment count of d
If d != num/d, increment count of num/d

Step 3:
Now iterate over all divisors stored in hashmap.

Step 4:
For each divisor K:

If it appears in at least 2 elements:

total = K * count
Update maximum result.

Step 5:
Return the maximum value.

Try solving now
02
Round
Medium
Face to Face
Duration90 minutes
Interview date6 Sep 2025
Coding problem1

We were asked to solve one problem out of the given set. Around 1 hour was allotted for this. Later, a 30-minute discussion was conducted on projects, achievements from the resume, and questions on computer science fundamentals.

1. Gas Stations

Moderate
10m average time
90% success
0/80
Asked in companies
AtlassianOlaGoldman Sachs

You have been given a circular path. There are 'N' petrol pumps on this path that are numbered from 0 to N - 1 (Both inclusive). Each petrol pump has two values associated with it:

1)The amount of petrol that is available at this particular petrol pump.
2)The distance to reach the next petrol pump.

You are on a truck having an empty tank of infinite capacity. You can start the tour from any of the petrol pumps. Your task is to calculate the first petrol pump from where the truck will be able to complete the full circle or determine if it is impossible to do so.

You may assume that the truck will stop at every petrol pump and it will add the petrol from that pump to its tank. The truck will move one kilometre for each litre of petrol consumed.

Problem approach

Step 1: Understand the Mapping

Each gas station points to exactly one other gas station using g[i].

So this behaves like a directed graph where:

Node = gas station
Edge = i → g[i]

We need distance of every node to station 1.

Step 2: Brute Force Idea

For every station:

Start from that station
Keep moving using g[i]
Count steps until reaching station 1

But this repeats calculations many times.

Time Complexity:
O(n2)

This is too slow for n = 10^5.

Step 3: Optimize Using DP / Memoization

If we already know the time for one station, reuse it.

Example:

5 → 3 → 2 → 1
If C[3] = 2, then:
C[5]=1+C[3]=3

So:

C[i]=1+C[g[i]]

Base case:

C[1]=0
Step 4: DFS / Recursion with Memoization

For each station:

If already computed, return stored answer.
Else compute recursively:
C[i] = 1 + C[g[i]]

Then sum all values.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What does the SQL function NOW() return?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3848 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 11 problems
Interviewed by Infosys
128 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 5 problems
Interviewed by Infosys
76 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 8 problems
Interviewed by Infosys
84 views
0 comments
0 upvotes