Round 1
Questions:
-
Problem-1: Given an array of n integers, we define score for a pair of indices i, j as min(a[i], a[j]) * abs(i - j). Find max possible score. n <= 10^5.
-
Problem-2: Given some intervals with start day and end day and some profit associated with each interval, we need to find max possible profit that we can obtain in one day on choosing at most k of these intervals. k, n <= 10^3, profit <= 10^9.
-
Problem-3: Given a graph with n nodes and n edges and it is given that there is a cycle in the graph. We need to find the shortest distance from every node to the closest node which belongs to the cycle. Graph is connected. n <= 10^3.
-
Problem-4: It was a REST API based. Just had to invoke a given API and do some processing to obtain the final result. It wasn't a difficult problem if you have some experience doing this kind of stuff.
Candidate's Approach
Managed to solve all 4 problems with around 45 mins remaining.
Interviewer's Feedback
No feedback provided.