Round 1: Online Assessment (OA)
Questions:
- 6 easy MCQs focused on OOP, mainly interfaces and exception handling.
- Two coding questions:
- Counting letters and finding the first letter with a frequency of 1.
- Calculating the total number of candles that can be used if K wax is left.
- SQL question:
- Finding all fields greater than a given number.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 2: Technical Round 1 (R1)
Questions:
- Find Majority Element Without Extra Space.
- Minimum number of stations required to accommodate all trains.
Candidate's Approach
- Initial approach: Sort based on Arrival and Departure and count using two pointers (O(n log n)).
- The interviewer was not satisfied with this solution, so I used the Line Sweep technique:
- Mark Arrival index with +1 and Departure index with -1.
- Calculate the Prefix Sum and find the maximum (O(n) time, space O(2401)).
Interviewer's Feedback
No feedback provided.
Round 3: Technical Round 2 (R2)
Questions:
- Remove duplicates from Sorted Array without using extra space and replace extra elements with null.
- Buy and sell Stock (O(n)).
- SQL: Given Student, Subject, and Marks, find Max Marks obtained by Student in descending order.
- A CSV file is given; store it somewhere so that we can find an element in O(1) and the previous element also.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 4: Technical Round 3 (R3)
Questions:
- How to remove duplicate files from a folder?
- First Approach: Using Multithreading to compare all files with the help of threads.
- Second Approach: Using HashSet and Multithreading to compare all files and store the binary converted to string.
- Follow Up: How will you handle collision?
- How can we prevent a server from being taken down by an IP sending excessive requests, considering the threshold is 100 requests per second per IP?
- My approach: Create a new section in the database to store request data. If an IP exceeds 100 requests per second, disconnect that IP or use Kafka Rate Limiter.
- Implement a retry mechanism in Java that attempts to execute a function multiple times before failing (Assume we are retrying a certain number of times before disconnecting).
- Function is of generic type. Hint: use Exception handling.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.