Microsoft Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
0
of 0 vote

We will have a cluster of hosts, each host having some numbers. Then, we use parallel quick sort. Use MPI programming in C, to quick sort the numbers using MPI communication mechanisms.

- Gangadhar July 14, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Using a bunch of servers to store all the numbers. If all the numbers are within a specific range, we can use bucket sort which is pretty fast. Also external merge sort is a good idea.

- Code ganker July 19, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the best solution for this situation is to scale horizontally and make use of GPUs. At a speed of 10 million inputs (* sizeof(int) to get an idea about memory) each 4 s, 20 machines could sort that 1pb of data in between 2 to 4 days.

- ionel munteanu July 31, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Assuming sizeof int is 4 bytes, to store all possible integer numbers would cost just 34 GB storage. So 1 Peta Byte of numbers should have lot of repetions. So device a number map table in an 1 TB harddrive with following mapping:

<Number, NumOccurrances> table should have 2^32 entries with NumOccurrances set to Zero initially. Start reading the hard drive where unsorted numbers are stored. And as the numbers are read increase the corresponding NumOccurrances instance in the table. Just to ensure that the NumOccurrances does not overflow, pick that as 64 bit long integer.

This solution works assuming integer size is 4 bytes. If the size taken is more than 4 bytes, alternative approach need to be taken as our above assumption will not longer hold good

- Pkar December 15, 2015 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More