Oracle (OCI) | Phone | Sort Array by Increasing Frequency
Company: Oracle (OCI)
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
Yesterday I had my OCI technical phone round. Interviewer started with his introduction followed by my introduction. Then I was asked a standard behavioural question - Tell me about a time when you had a conflict with your team member.
After that I was given a LC easy problem.
Problem: You are given an array of n integers, sort the array in ascending order first by their frequency then by their value.
Similar LC Problem: Sort Array by Increasing Frequency
Sample Input: [3, 4, 5, 6, 4, 3]
Sample Output: [5, 6, 3, 3, 4, 4]
Solution:
We used hackerrank platform for coding. After coding we went through the code together and gave a dry run on the sample test case. I used hash map in the problem and interviewer also asked how the hash map works and the time complexity of my code.
Then we had a discussion on the following problem - Suppose we have an api to put list of names in the DB. It's only responsibility is to put data in DB. Once the DB starts to grow it starts to have higher latency. How'd you proceed to find the problem in the system.
In the end I was given another problem, a simplified version of Valid Parentheses, we assumed only '(' or ')' is allowed. I didn't have to code this, just had to explain the solution in words.
After that I asked a few questions about OCI and his team. Then we concluded the interview. Interviewer was very nice and friendly.