Round 1 (First Interview)
Questions:
- The main problem was the same as Zero Array Transformation I.
- Follow-up question: The problem was similar to Zero Array Transformation II.
- Additional follow-up: What is the number of minimum queries needed to transform the array into zeros?
Candidate's Approach
- Started with a brute-force approach for the first problem and explained the time and space complexity.
- Optimized the solution using the Sweep Line Technique.
- For the follow-up question, explained the brute-force approach and then optimized it using binary search and the sweep line technique.
- For the last follow-up, proposed an approach involving sorting and binary search.
Interviewer's Feedback
No feedback provided.
Round 2 (Second Interview)
Questions:
- The main problem involved simplifying an equation with variables (alphabets) and parentheses, including addition and subtraction, but no nested parentheses.
Candidate's Approach
- Solved the problem using a map data structure and a single loop.
- Proposed a solution using stack and map data structures for the follow-up problem involving multiple parentheses.
Interviewer's Feedback
No feedback provided.
Round 3 (Third Interview)
Questions:
- The main problem was similar to Surrounded Regions, where I had to determine how many surrounded regions are in the grid.
- Follow-up question: If given coordinates of an island in the grid, how many different surrounded regions can be reached from that point?
Candidate's Approach
- Started with observations about the grid and explained the approach to solve the problem.
- Implemented a BFS from the island to count reachable regions and explained the time and space complexity.
Interviewer's Feedback
No feedback provided.