Microsoft Interview Question for Senior Software Development Engineers


Country: United States




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

The solution will depend on the format of the file and whether they are sorted based on id or not, if we assume thet the each line contains an entry for each id with comma separating id and name or id and address and a given line in the two file correspond to the same id then it will be a simple solution.

- The Artist May 24, 2020 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

in case of the files' data are not sorted in that case we can some of external sorting ... if sorted then simply algorithm of merging two sorted data will work

- dj@coder May 24, 2020 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

one basic clarifying question is : are there different people with the same name?
basically are there two or more entries in the first file which have the same name but different ids?

- Rafi September 17, 2020 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

So you want to have one (or more) sender who reads the file and multiple machines processing and building the output file. Depending on the size of each machine's memory, we need to come up with hashing function. Run the id through has and find out which machine (1-16 for ex) will be processing it. Note that both files with same id has to go to the same machine to process it.
Each machine will receive the id -> name or id ->address and it needs to merge the records by keeping the id in hashSet.
Once all the machines are done processing it, they can write to single file one by one.

int ids won't be usually preferred as it does not have enough range. GUID is usually preferred and in this case you can simply take the first char of GUID and send it to corresponding machine if we decide to take 16 machines each capable of running
memory = total possible number of Ids / 16

- yash October 31, 2021 | 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