Microsoft Interview Question for Software Engineer in Tests






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

do the inorder traversal the second element will be the second smallest
check this number with the number returned by the given function

- pranav December 05, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

i agree with king kong upto 5.
7 and 8, u mean u will send an invalid binary search tree?

i would like to add 2 more cases
3.1-> an inbalanced binary search tree with a left subtree being empty and all nodes being on the right tree.

3.2-> two duplicate minimums

- nk August 12, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There is a general problem of finding the kth smallest element in a tree. A classic kth order statistics problem which can be solved by Augmenting datastructure[using Redblack trees]. THis operation of finding the RANK can be found in Log(N) time.

- logNguy December 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. null tree
2. tree with 1 node
3. BST tree with 2 nodes
4. BST with duplicate minimums

i guess they are asking about testing the function, not finding the 2nd minimum, am i right?

- b December 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1) Dont give it a BST
2) Let BST be null
3) Let there be only 1 element
4) Let there be 2 elements (valid case)
5) let there be n elements where n > 2
6) let there be numbers where 2nd smallest is parent of the smallest
7) let there be numbers wehre 2nd smallest is child of smallest
8) let there be numbers where 2nd smallest is child of child of smallest

- king kong January 07, 2011 | 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