Jump to content

Who can figure this out?


MollynDiesel

Recommended Posts

I got it pretty quick, but, man, that's a mean one to ask in an interview!!!

I've been asked to write code during a programming interview; I've also been handed code that was supposed to be good that was really bad. I think the idea in both the math case and getting handed bad code is the same - how well, how quickly do you think on your feet and how well, how badly do you present your response.

Link to comment
Share on other sites

  • Replies 36
  • Created
  • Last Reply

Top Posters In This Topic

2, If one side is lighter than the other, discount the 3 heavier ones plus the odd one, then put one ball in each side. If they're level the one that's left out is broken, if not it'll be apparent which one's lighter - place the lighter one & the 'odd' one from the beginning in each side to show that one's lighter & again they've all been weighed at least once

same answer but with a bit more added. It meets the criteria just didn't need saying ;)

Sorry but I am still not getting it. Maybe I am being a bit dumb, but how's that meeting the criteria?

If you discard the three heavier ones + the odd one out, then proceed to comparing two of the three lighter ones, then the odd one out has obviously not been weighed.

If you do the same thing and then place the lighter ball on one side and the odd one out on one side, then you have used three attempts.

The way I see it, if you have to have EVERY ball on the scales at least once, it is impossible to do in two attempts. Maybe I am just not seeing the logic...

Link to comment
Share on other sites

Contrary to the original directions:

The balls are NOT all exactly the same, one assumes that the statement should have read that they all appear to be the same with the one exception.

And again, it must either take three attempts if every ball must be put on the scale; or, if both balls on the scale at the second attempt weigh the same one assumes that the odd ball is the lighter one.

In any case, while the challenge could have been phrased more accurately, the intent was obvious ... I assume ...

Link to comment
Share on other sites

Oh, c'mon, pick your sense of humour up, dust it off and stick it back on. The mathocrats are gonna nit-pick unless it's phrased absolutely correctly and the rest of us are just gonna have some fun with it.

An expression I think of now and again "You can't fly with the eagles if you hang with the turkeys!" Don't let the turkeys get you down! (( me included!! ))

Link to comment
Share on other sites

I know this one! Take 3 balls and place on one side of the scales, and 3 on the other, leaving 1ball beside the scales. If the scales balance then the remainder is the lighter one. If they don't then you know its in the lighter 3 on the scales. Out of the lighter 3, weigh two of them on scales. Its the same principle as before, thus leaving you with the lightest ball. Voila!

Sent from my HTC Sensation XL with Beats Audio X315e using Tapatalk 2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy , along with dressing your husky as a unicorn on the first Thursday of each month