Round 1
Questions: The task was to find the sum of the dot products of two compressed vectors. A compressed vector is a tuple [value, count], where value is the number itself and count is how many times it appears.
The input consists of two arrays of compressed vectors:
Example: [(2, 4)] [(1, 4)]
In this case, you should multiply and sum the values like this: 2 * 1 + 2 * 1 + 2 * 1 + 2 * 1 (4 times).
If the vectors have different total lengths, you should return an exception.
Example: [(2, 5)] [(1, 4)] Correct case: [(2, 1), (1, 9)] [(2, 4), (3, 5), (4, 1)]
Candidate's Approach
I found the correct solution using two pointers, but I received negative feedback because the interviewer almost completely explained the solution to me. It felt weird. I wasn’t familiar with compressed vectors, so I had to ask questions.
Interviewer's Feedback
The interviewer provided a lot of guidance during the problem-solving process, which made the candidate feel uncomfortable.