Round 1
Questions: Given 2 lists and an integer k, find the first k integers from the first list, then take the first k elements from the second list, if there is any element which is common then remove that element from the second list. Continue this process until there is no intersection between first k elements from the first list and first k elements from the second list, return the second list.
0 < k <= +inf
I/P-
list1 - [1,2,3,4,5,6,7]
list2 - [1,3,7,6,2,7,8]
k = 3
O/P-
[7,6,7,8]
Candidate's Approach
- Initially provided a brute force solution.
- Conducted a dry run and corrected one mistake during the process.
- Improved the solution to an O(N) complexity and performed another dry run.
Interviewer's Feedback
The interviewer wanted to ask more questions but due to lack of time, couldn't do so.