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 termsminimise the total costmade 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 (2)


