Morgan Stanley Interview Question
Senior Software Development EngineersCountry: India
Interview Type: In-Person
External Sorting
Let's assume 512GB is the maximum available for sorting at any moment.
1. Read 512GB from 5TB of input.
2. Sort it.
3. Save it to a 512GB block in hard disk.
4. Repeat steps 1 -> 4, 9 times until all 5TB is sorted, so we have 10 blocks of sorted data.
5. Perform Poly-phase mergesort, upon these 10 blocks, such that at any time max kept in RAM is 512 GB.
External Merge Sort
- Atharva Tripathi August 07, 2020