Status: 5 years of experience
Location: Bengaluru, India
Date: July 2021
Codility Online Test:
2 questions with 40mins time limit.
Round 1:
- Valid parentheses given only one type of bracket. Used stack to solve it (I was used to this method) and then optimized it to using O(1) space. I missed initially that the given strings had only one kind of brackets. Wrote the code in coderpad for this.
- https://leetcode.com/problems/generate-parentheses/. Came up with some solution on my own and explained the algorithm. Wrote the code in coderpad, couldnt handle edge case properly and was getting null pointers. Could have fixed if I had some time, but had already consumed enough time by then and interviewer decided to proceed to next question
- Array of random unsorted elements. Top k elements less than element 'x' are to be returned. Just explained the approach, interviewer dint ask me to code probably because we were out of time
Round 2:
- Unsorted array of random elements including negative numbers. Return the smallest missing number greater than 0. Gave the O(nlogn) TC solution and then O(n) TC with O(n) SC. He wanted me to further optimize it to O(n) TC and O(1) SC which I couldnt think of.
- Given a sets of login and logout time pairs in two arrays, find the time slot where most users have logged in and the count of the users during that time. I came with two approaches, one using hashmap and the other by sorting both the given arrays. Couldnt optimize further which interviewer was expecting
After this round, received the call and mail regarding my candidature and it was negative. I wasnt expecting it given that 3rd round was already scheduled and recruiter had informed me before that only if the first two rounds go very bad (which I think dint), 3rd round will be cancelled. I am suspecting not being super quick and failure to further optimize the solutions are the major reason for the rejection. I havent got any particular feedback from the recruiter though. Open for other thoughts...
My other interview experiences: https://leetcode.com/discuss/interview-experience?currentPage=1&orderBy=hot&query=&tag=anonymousengineer