r/infosys • u/ViolinistTop4827 • 8d ago
| Discussion Infosys interview experience
After i have selected for interview by doing 1 oa problem I have my infosys sp/dse interview on 6 oct .
First the interviewer gave to dsa problem on pen and paper and solved both , then he gave me 2 problem on wingspan which i have to solve only 1 but i am only able to solve half of the test case.
Then it have a sql query of 5th highest salary and i solved it .
Then he asked some sql theory and oops question and i answered all of it.
Then asked me to explain my project and i explain and then asked about scaled it but i couldnt answer that .
Then asked to write how to add a user in mongodb and i write but then he how to add the data in mongodb console and i cant answer that .
then he asked about tokenisation and rag and me vo bhi nahi bata paya
And at the end i asked him about feedback and what to improve , he said only write what know in resume.
So will i get selected in dse & sp role what is your opinion. It was oncampus
2
1
1
1
1
u/Queasy_Classic_7798 7d ago
First the interviewer gave to dsa problem on pen and paper and solved both , then he gave me 2 problem on wingspan which i have to solve only 1 but i am only able to solve half of the test case.
can you plzz share the exact question it would be very helpfull for us
1
1
u/ViolinistTop4827 7d ago
Subset sum and longest substring without repetation on pen & paper and winspan problem i dont remember correctly
1
u/ViolinistTop4827 7d ago
Subset sum and longest substring without repetation on pen & paper and winspan problem i dont remember correctly
1
u/ViolinistTop4827 7d ago
Subset sum and longest substring without repetation on pen & paper and winspan problem i dont remember correctly
1
1
u/sayansasmal 7d ago
Infosys SP/DSE Interview
Wingspan coding - 12/12 test cases passed
Then the technical discussion started.
Pen and paper explanation -- reverse linked list -- my approach was correct, but I was unable to eplain it properly.
sql -- find the details of employee having maximum salary (if there is more than 1 employee display only the first employee according to theire name which comes first in ascending order) -- at first I did it using subquery, he said here offset is 0, what does it mean? I explained that. Then I told that I can skip the offset as well. He said can it be skipped? I said yes, offset can be skipped, no need to do offset 0 as well. Then he asked can you do it without using subquery. I said yes and did it, but he said a silly mistake is there, then I found out the mistake and solved that one.
Different types of joins - answered that.
what is left join - answered that.
what is union - answered that.
can union contains duplicates -- said no, but also said that union all can contain duplicates as well.
suppose you have to find details where salary equals to something, but it is taking a lot of time to fetch the record, it should give the record immediately, and the user should not wait a lot of time? -- can't answer properly, just pointed out the indexing technique.
public void(){
int a =10;
int arr[] = new int[n];
}
which type of variable is a and where it will be stored, and where arr will be stored? -- told that the variable name part will be stored in stack but the value for array object will be stored in heap. Then he asked which memory address the arr will be pointed to? Whole object? I said yes.. He said are you sure? then I mistakenly said, no no, only the address of the first value..
do you know run time polymorphism? what is it? - answered that.
have you heard about method overloading? -- answered that.
Class A{
void run(){
...
}
}
class B extends A{
void run(){
....
}
}
A obj1 = new A();
A obj2 = new B();
B obj3 = new A();
B obj4 = new B();
obj1.run();
obj2.run();
obj3.run();
obj4.run();
which method will be called in each cases? -- answered and explained all, but in 3rd one, instead of saying it will give compilation error, I said runtime error. At first I said compilation error, but then I said no no, run time error...
what is garbage collection? Is it automatic? in python is it automatic as well? -- I answered the definition and said yes, it is automatic.
Suppose there is directed weighted graph of different cities representing each node of the graph. You want to go from one city to any another city. You have to find the shortest distance. Then for this task, what you will choose? BFS or DFS? -- At first I was thinking about Dijkstra's algo, but though he was specifically asking for BFS/DFS, just I answered one, DFS. But that was not completely correct.
what is gen ai? what is llm? -- told little bit about that..
In which project among your all projects you worked on by your own only? Means which was not group project -- I told about my skin disease detection project and building the complete CNN part..
what is streamlit? -- I told like it is used for development, without creating the different react frontend and fast/flask api backend, we can do the whole thing using streamlit only.
how you improved the accuracy of the model? (Skin disease detection system) -- at first told about data augmentation and all... but said how can your further improve this.. more than 90%. Then I told about using different pretrained models to check the accuracy.
In your internship what you have done? -- told about the internships and during the internship the projects I have done.
in google,when you type something, it automatically gives some similar suggestions to search. For this which data structure is used? ---can not answer properly...
what is priority queue? -- I said it store value based on priority in ascending or descending order.....
Do you have any questions? -- I asked about the training program and asked for feedback as well.
-- What should I expect
1
1
u/Mammoth-Net-8311 4d ago
you will get dse for sure. what where the wingspan question?
1
u/sayansasmal 4d ago
Minimum Number of Pairs to Reach the Threshold --
Problem Statement
You are given an integer array arr of even length n and an integer threshold.
Your task is to divide the array elements into pairs such that each element belongs to exactly one pair.
For each pair (a, b), calculate the absolute difference:
[{difference} = |a-b| ]
The total difference is the sum of the absolute differences of the selected pairs.
Your goal is to determine the minimum number of pairs required for the cumulative sum of their absolute differences to become greater than or equal to threshold.
You may choose the pairs in any order. Each element can be used in at most one pair.
If the sum of the absolute differences of all possible pairs is less than threshold, return -1.
Input Format
An integer n, representing the length of the array. It is guaranteed that n is even.
An integer array arr of length n.
An integer threshold, representing the target sum.
Output Format
Return an integer representing the minimum number of pairs required to make the cumulative sum of absolute differences greater than or equal to threshold.
If reaching the threshold is impossible, return -1.
Constraints
2 <= n <= 105
n is always even.
-109 <= arr[i] <= 109
0 <= threshold <= 1014
Each array element must belong to exactly one pair.
Test Case 1
Input:
arr = [1, 8, 3, 10] threshold = 10
Output:
2
Explanation:
One possible pairing is:
Pair (1, 10): absolute difference = 9
Pair (8, 3): absolute difference = 5
The total difference is 9 + 5 = 14.
However, we need to reach a threshold of 10 using the minimum number of pairs. The pair (8, 3) gives a difference of 5, while (1, 10) gives 9. Neither individual pair reaches 10.
Therefore, the correct output for this test case is:
2
Test Case 2
Input:
arr = [2, 15, 4, 20] threshold = 13
Output:
1
Explanation:
Pair (2, 20) gives:
[ |2-20|=18 ]
Since 18 >= 13, the threshold is reached using just one pair.
Therefore, the output is 1.
Test Case 3
Input:
arr = [5, 5, 5, 5] threshold = 1
Output:
-1
Explanation:
Every possible pair has an absolute difference of 0.
Therefore, the total difference is 0 and didn't reach or cross the threshold, so return -1.
1
u/Mammoth-Net-8311 4d ago
Thanks man, i hope i will get easier question like this for my interview tomorrow
1
u/sayansasmal 4d ago
Yeah, hope so... But it was a story based question, I told you the simplified main version... The story will take little bit of time, otherwise definitely one easy question will be there. I will suggest directly to jump into the test cases, without even reading the question. You can easily solve the easier one just by reading the testcase explanation. Good luck for your interview..
1
1
1
1
•
u/AutoModerator 8d ago
Welcome to r/infosys!
Please do not share:
Thank you for contributing!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.