Group chat from anywhere using the web, IM, email or your phone.
CareerCup provides technical interview prep for engineers.
guest793889 posted from a guest
amazon phone interview: Q. how do u multiply a no by 7..tell an efficient method
guest793889 posted from a guest
Q2: there r 7 buckets of water and infinite no for flies....one the buckets is poisoned...you need to find which 1 by putting the fly in it..bt it will take 7 days for the fly to die..and for u to know...tht d bucket is poisoned..also u need to send one of the buckets to ur friend in 1 week...hw will u find out the poisoned bucket in least no of flies?
guest793889 posted from a guest
this is also amazon qns
James Bond posted from a guest
If we could take a sample of water from buckets, then make 2 groups, mix water from 1,2,3,4 and water from 5,6,7, At the end of 7th day, you would find corrupt group and you can send the bucket from clean group to the friend....using this idea you can find poison bucket in 21 days with 3 flies..
James Bond posted from a guest
What do u think?
guest793889 posted from a guest
the interviewer wants us to find a method in which we r in a position to know which bucket is poisoned in 7 days..with min mo of flies
guest793889 posted from a guest
i said put 6 flies in 6 buckets and leave one without any..on the 7th day u ll know which 1 is poisoned..he wanted more optimized ans
James Bond posted from a guest
without any further information, I do not think there is anything better than 6 because you need to test atleast 6 buckets and any water mixing approach is going to take more flies...
CareerCup posted from the web
can't you do it in four? use fly1 for buckets 1, 2, 3, 4 and fly2 for buckets 5, 6, 7. fly3 for 1, 2. fly4 for bucket 1.
CareerCup posted from the web
sorry, that was wrong. 3 flies. use fly1 for buckets 1, 2, 3, 4. fly2 for 1, 2. fly3 for bucket 1.
guest786585 posted from a guest
how do i build the word ladder?
James Bond posted from a guest
@CC how can 3 flies solve this problem with the approach u said? what if the fly is in bucket 4,5,6 or 7? u can find a fly with above approach only in buckets 1 or 2
CareerCup posted from the web
Well, if the fly1 doesn't die after trying 1, 2, 3 and 4, then you know bucket 5, 6, or 7 is poisoned. So then you have fly2 try a {5, 6} mixture.
CareerCup posted from the web
(by the way, this is basically just binary search)
James Bond posted from a guest
but 2nd try will be only after 7 days which is the basic problem
CareerCup posted from the web
why is that a problem?
James Bond posted from a guest
before 7 days u need to find the poison bucket
CareerCup posted from the web
are you sure? that's not what the original problem said. "also u need to send one of the buckets to ur friend in 1 week"
CareerCup posted from the web
you're trying to send your friend a NON-POISONED bucket
James Bond posted from a guest
thats what I was corrected by the guest793889
James Bond posted from a guest
I also thought the same as u initially
CareerCup posted from the web
I think he misinterpreted the problem...
James Bond posted from a guest
even I feel so..
CareerCup posted from the web
why would you send your friend a poisoned bucket? that doesn't make sense
CareerCup posted from the web
he originally typed "u need to send one of the buckets to ur friend in 1 week". I think he didn't see the difference between the two problems...
CareerCup posted from the web
anyway, if you need to know which bucket is poisoned within 7 days, then the best you can do is 6 flies.
James Bond posted from a guest
@CC since u have interviewed people at many places and have been part of hiring committee can u tell why companies like Amazon, MSFT and Google conduct 2 or 3 phone interviews..
James Bond posted from a guest
I stay close to them...still amazon is having 3rd phone interview with me
guest769794 posted from a guest
many places?
James Bond posted from a guest
and I believe even MSFT and Goog does the same thing...
CareerCup posted from the web
in general, it's because interviews are incredibly expensive. It costs $1000 - $1500 to do a round of interviews with someone.
James Bond posted from a guest
does it mean a weak candidate or more groups interested in u?
CareerCup posted from the web
the companies need to do things to cut their costs, which means not bring unqualified people onsite
James Bond posted from a guest
ok
intel posted from a guest
any nice link for wild card pattern matching question
James Bond posted from a guest
which language?
intel posted from a guest
c will work
intel posted from a guest
also what is *,? in c coding
intel posted from a guest
i m getting confused with perl
James Bond posted from a guest
U need to go thru a tutorial..i would suggest doing it in perl..as all other languages try to copy the features of perl
James Bond posted from a guest
or rather have copied.
intel posted from a guest
no i am asking from point of view of wild caRD pattern matching wquestion
intel posted from a guest
simillarly algo for substring matching
intel posted from a guest
?
guest776774 posted from a guest
can someone explain this? In perl: if $z="P01", how does $z++ = P02
James Bond posted from a guest
for perl operation +, any leading part of string before number gets retained and number is added and trailing parts are removed, so if $z="P01ABC", $z++ = P02
guest776774 posted from a guest
thanks
SS posted from a guest
http://careercup.com/question?id=686684
SS posted from a guest
Any one please help me with the solution
guest793405 posted from a guest
how to get call 4rm amazon?
Don't miss the conversation - get group messages sent to your IM or Email!
 
 
Chatting as guest795215. Change name
admins
members
Loading members...
guests
Loading guests...