Apply - Referral [ October 6th ]
Got Call - October 16th
Scheduled 1st Round - October 30th
Scheduled 2nd Round - November 18th [ After clearing 1st Round ]
Offer - November 26th
1st Round Question [ 1-hr] :
After brief introduction, started with coding question directly [code will be complied and tested with few inputs]-
- Given a sorted array, find the frequency of a number.
- Used Binary Search - Found index of 1st occurence and last occurence - and subtract these 2 indices.
- Coded using C++ STL( lower_bound, upper_bound), after then coded without using STL as well.
- Given n transactions between 2 banks, consolidate the transactions and print it.
- Example - Input - A gave B 10,BgaveA20, A gave B 5 ,CgaveA3
Output - B gave A 5 ,CgaveA3.
- Key thing is to use map of map datastructure.
2nd Round Question [ 1- hr ]
Same as 1 round, after brief introduction, started with coding question [ same coding platform ]
- Given 3 singly linked list, find all triplets (a, b and, c) one from each list s.t. a+b+c = target.
- Not allowed to use extra space [ like not allowed to add previous pointer into the list], so you can't traverse from last.
- Idea - sort first 2 list ascending and 3rd decending, pick one element from 1st list, then for that element find new target by subtracting it from actual target. Then start from first element from 2nd and 3rd list.
- If sum of first elements of 2nd and 3rd element ( s ) is less than new target, then move pointer of 2nd list,
- if s greater than new target, then move pointer of 3rd list,
- if equal then print it.
- Not allowed to use C++ STL for list. Have been asked to write everything on our own. Defining structure of linked list, sort the list ( which includes merge sort, merge, middle element, etc.) , then perform the above mentioned logic.