Flipkart SDE 3 | 5 YOE | India

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-12-17Added By Anonymous
Source: Link
Company: Flipkart
Role: SDE 3
YOE: 5
Location: India

Experience:
First Round (PSDS):
* Given an incoming stream of IPs, return list of IPs that are occuring more than K times. Note - Can't use HashMap, HashSet, Dictionary. Storage and retrieval of IP should be done in constant time O(1). I used tries. Interviewer was convinced.
* There are N blocks for each of them length is given which is positive. We have to merge these blocks one by one to make it single block in the end. There are a cost associated with each merge.
* Merge Cost = sum of two block length getting merged. We have to minimise the total cost of merge all elements.
* Return the total merge Cost.
Seeing the terms `minimise the total cost` made me think at first Its DP. But After running it with some examples, I saw its plain greedy. Solved it instantly. Interviewer seemed convinced.

Waiting for feedback. Will update further rounds if any here.
Comments