Round 1
Questions:
-
Behavioral Questions:
- Tell me about a time you made an independent decision, what result you got, and what you learned from it.
- Tell me about a time when you had a problem in the project and how you resolved it.
-
Coding Questions:
-
Given a matrix (m,n) with only 1’s and 0’s values, return the lowest row index where it has the most number of ones. Return the lowest index if multiple rows have the same number of 1’s.
- Follow up: Return the lowest index where it has the most significant number. Return the lowest index if multiple rows have the same number of 1’s.
Matrix = [[0, 1, 0, 1, 0], [1, 1, 1, 1, 0], [1, 0, 0, 1, 0], [1, 1, 1, 0, 1] ] Output for lowest index: 1 , Output for highest index: 3
-
Given nums = [4, 0, -2, 3, 6, -1, -3], and target=4: return the tuples whose sum is equal to the target given that there are no duplicates in the array.
- Output: [[4,0], [-2, 6]].
- Follow-up question: Can you optimize this further with O(1) space complexity? The interviewer is assuming in-place sorting takes O(1) space complexity.
-
Candidate's Approach
For the first coding question, I analyzed the matrix to count the number of 1's in each row and tracked the row index with the maximum count. For the follow-up, I adjusted my logic to ensure I returned the correct index based on the criteria provided.
For the second coding question, I initially implemented a solution using a HashMap to store sums and their corresponding indices. After discussing the follow-up, I optimized my approach using a two-pointer technique to achieve the desired result with O(1) space complexity.
Interviewer's Feedback
The interviewer appreciated my initial approach to both coding questions and provided positive feedback on my optimization strategy for the second question. They encouraged me to continue practicing similar problems on Leetcode.