Microsoft Interview Question for SDE-2s


Team: Azure
Country: United States
Interview Type: In-Person




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

Trie(prefix tree). The length of a phone number is a fixed number and phone numbers in close area may share the same area code(prefix). So It will be pretty efficient for searching(O(m), m is the length of the phone number) and storing all those phone numbers inside a Trie.

- kevin.Luo91 October 07, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This can also be done by ternary search tree.

- Anonymous October 07, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I don`t think it is necessary to store all phone numbers except a new number is generated.

- maillist.danielyin October 08, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Besides, this is used to generating numbers, thus I think we need to modify the tree to store the number of leaf nodes a certain node has. This will avoid unnecessary search following branches which are already of full leaf nodes.

- maillist.danielyin October 08, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

10 Level Hashed data structure. (Multi Level Hashing with 10 levels because of 10 numbers in it.)

- smashit December 06, 2013 | 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