Hi Everyone,
I just gave my goldman sach telephonic interview.
Some one from New York called me for this telephonic round.
He asked a lot about my projects and how I handled so many api calls in my project
Then he asked me a question where I was stuck
He asked to find a pair whose sum is closest to a given number K in infinte stream of unsorted data :
- basic logic -> two pointer concept that is mentioned in the *** but it does not apply here because we cannot store the data in the main memory.
- I told him to store the data in storage then divide it into chunks sort it in the main memory and then use merge sort concept or divide and conquer rule to find the closest sum.
Please help me to know what possible approaches I can take to solve this problem.
Thanks in advance.