Infosys on campus OA -> SE+DSE Interview
- Location
- Indore
- Posted
- 9 Oct 2026
Summary
I attended Infosys campus OA and on‑site interview but was unable to solve the DSA problems presented during the interview, and I was not offered a position.
How it went
The Online Assessment part Infosys's on campus oa - gave it on 17th sept , interviews were to be taken on 18th , but were postponed. I solved 1.5 problems out of 4 (any 3 were to be done). problems came in sets , some got extremely hard sets, some got kinda easy(only the first problem).
I got a set in which the first problem was easy , they named it buy and sell stocks 2, but had nothing related to stock buying problems .It was a simple, greedy , pick highest value packets from odd and even indices alternatingly from a fixed budget. Sorted the array and picked greedily , done in 15 mins. 12/12 private passed
Second problem was exactly same as trapping rainwater problem, but some pillars were contaminated, which basically ruined the water touching them , so we had to exclude that water and return the total collected water. solved using greedy , 1 TC passed, applied segment tree coz why not (shouln't have wasted time) but still it got me 3-4 more private testcases so yeah , that's it around 1.5 problems solved.
The third problem was -> given a string , let's say s = abcbba
find the number of partitions of s, such that the count of unique elements in each partition is same
for example , a | b | c | b | b | a is a valid partition , because each partition has a freq of unique alphabet as 1
abc(uniques = 3) | bba (uniques 2) is not a valid partition
and so on , we had to count all valids in a string of size 10^5
brute force couldn't even pass 1 hidden test case, although it worked on public cases , but they don't count
4th problem was the final boss , had to partition an array to match gcd(l....r)*w[r] w was some integer array , and do some sorcery typa shit. was untouchable for me , couldn't even think brute force on that.
Still got shortlisted for SP+DSE interview, roles were not mentioned yet. Interview was as Infosys Indore
5th oct -> the interview
it was supposed to start at 9AM , but began at around 11AM
total 71 candidates were present from multiple colleges
My interview started at around 3PM , interviewer asked me to sit comfortably without worrying , he was very chill , started with my introduction , moved to my projects , tech , architecture based questions , scenario based questions like how would your app handle 1 million domain blocking etc. I expalined a caching approach that would work, Moved on to my next project , I followed production level architecture in that , so now the focus was mostly on LLD , asked factory design , SOLID Principles , and basic oops. That was mostly it , he just asked whether or not i know sql , to which i said yes , but he didnt ask any queries , He really liked my domain blocker app and asked me to publish on play store, i explained to him why it can't be done , everything was going very frank.
Then he opened wingspan on his laptop, gave me 2 dsa questions , had to solve 1 out of them withing 30 mins. He started taking interview of other candidate while i was asked to solve those questions. (it was a classroom type hall in which about 6-7 interviews were going on simultaneously, so a little bit distracting).
The questions were kind of in my range , the type of problems i usually do in 2-5 mins during contests , But there , my brain froze , couldn't even think straight , missed out on those easy problems and most probably that will cost me the role.
first problem was -> given a binary string , like 10101010001 , an operation refers to -> flipping any bit from 0 to 1 or vice versa
you cannot apply operation on two adjascent characters,
find the min number of operations to make string alternating. Wasn't able to solve this shit . just had to check with 0101010 pattern and 10101010 pattern
second problem -> given an array , a gap is defined as the difference of max product of two elements from array a1 , and min product of two elements from array a2.
a1 can be constructed using given array by selecting only even index elements
a2 contains all odd index elements
maximize the gap
again , a very doable problem , just had to lay down cases on paper and it would have been done.
I don't have answers to why i couldn't solve these problems , but this is what it is.
was extremely disappointed for 2 days , kinda back to normal now , will try harder now , will have to fix this brain freeze otherwise all the hardwork will be undone.
Questions asked (5)
- 01
Buy and Sell Stocks 2 (Greedy Selection)
Data Structures & Algorithms
Given an array of packet values and a fixed budget, select packets alternatingly from odd and even indices, always picking the highest available value each time, to maximize the total value within the budget.
- 02
Trapping Rain Water with Contaminated Pillars
Data Structures & Algorithms
Given an elevation map, some pillars are marked as contaminated and cannot hold water. Compute the total amount of water that can be trapped while excluding the water that would touch the contaminated pillars.
- 03
String Partition with Equal Unique Count
Data Structures & Algorithms
Given a string S (|S| ≤ 10^5), count the number of ways to partition S into contiguous substrings such that each substring contains the same number of distinct characters.
- 04
Binary String Minimum Flips for Alternating Pattern
Data Structures & Algorithms
Given a binary string, you may flip any bit (0 → 1 or 1 → 0) but you cannot flip two adjacent characters. Determine the minimum number of flips required to make the string alternating (either 0101… or 1010…).
- 05
Maximize Gap Between Products of Even and Odd Index Subsets
Data Structures & Algorithms
Given an array, construct A1 using elements at even indices and A2 using elements at odd indices. Let maxProd be the maximum product of any two elements from A1, and minProd be the minimum product of any two elements from A2. Find the maximum possible value of maxProd - minProd.