Microsoft Interview Question for SDETs


Country: United States




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

I have no idea what this question is, can you provide more details on the question?

- tnutty2k8 August 30, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Actually I found the problem statement which I believe is the same problem asked here:

8 ball problem. if given 8 balls with only one ball being a 
lighter weight and all other 7 being the same weight and 
given a scale, how will you find the light weight ball. do 
this in minimum number of steps

My initial thought is to divide an conquer which gives

log(N)/log(2)

so in case of 8-ball, it would be

log(8)/log(2) = 3 steps

, but you mentioned it can be done in two steps.

The above would be true depending on the meaning of 'scale'.

- If scale allows you to weigh one group at a time( ex Think of weighing yourself on scale, only one person at a time makes sense ), then I believe

log(8)/log(2)

would be true.

- If scale allows you to weight two group at a time( another type of scale ) then (after cheating and reading answer (see /question?id=8119690) ) they mention the answer is

ceil(log(N)/log(3))

But its only that because they skip the last ball weigh-in using slick process of elimination. So technically they don't weight all the balls.

While this problem is interesting, I'm not a fan of it, especially for a programming interview position( assuming ).

Best.

- tnutty2k8 August 30, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

*cough *cough * I hate this site broken functionalities *cough *cough

- tnutty2k8 August 30, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public int getHeavy(List<Integer> balls)
{
	return (int)Math.ceil(Math.log(balls.size())/Math.log(3));
{

- clk August 30, 2017 | 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