Infosys oncampus OA experience
Easy qn:
Will be given a String and Weight array both of length N.
String will only contain two characters L and R.
Cut the string in substrings such that sums of weights of L and R are equal in each substring.
Output : No of such substrings possible
Solved Completely --> 12/12
Medium qn:
You will be given n
You will be given m
N sized integer array
Output length of longest subsequence from n which is strictly increasing such that sum of excluded elements should not be more than m
Solved partially --> 9/12
Hard qn:
N sized array given
Divide array in two sets such that
One set can only hold x elements
Other set have even odd parity condition..
After division calculate discomfort according to give condition
For 1set set- for ith element - i*S1[i]
For 2nd set - f * i * S2[i] (f will be given)
Array should be divided in such a way that discomfort is minimized
Couldn't able to solve --> only 2 public test cases passed
Complex question:
given k(an integer)
two large integers given as strings ==> low and high which represent inclusive range..
we need to find the total count of numbers whose diff between all adjacent digit pairs is either 1 or k.
Solved but wrote brute force ..none of the private test cases passed..
Hope it is helpful..
Posted Aug 21, 2026, 2:22 AM UTC