Sei sulla pagina 1di 8

uest|on Pow many Llmes a day do Lhe mlnuLe and hour hands of a clock overlap?

Answer uld you Lhlnk Lhe answer was 24 Llmes? Well lf you dld lL's Llme you Lhlnk
agaln LeL's do some maLh
ln 1 hours Lhe mlnuLe hand compleLes 1 laps ln Lhe same amounL of Llme Lhe hour
hand compleLes 1/12 laps
1he flrsL Llme Lhe mlnuLe and hour hands overlap Lhe mlnuLe hand would have
compleLed 1 lap more Lhan Lhe hour hand So we have 1 1/12 + 1 1hls lmplles LhaL
Lhe flrsL overlap happens afLer 1 12/11 hours (103 am) Slmllarly Lhe second Llme
Lhey overlap Lhe mlnuLe hand would have compleLed Lwo more laps Lhan Lhe hour
hand So for n overlaps we have 1 1/12 + n
Slnce we have 24 hours ln a day we can solve Lhe above equaLlon for n
24 24/12 + n
24 2 + n
N 22
1hus Lhe hands of a clock overlap 22 Llmes a day 1hus Lhe hands of Lhe clock overlap
aL 1200 103 210 313 420 323 630 733 840 943 1030 noLe
LhaL Lhere ls no 1133 1hls becomes 1200
Pave a beLLer soluLlon? LeL us know Lhrough our commenLs secLlon
1
uest|on 1hree anLs are slLLlng aL Lhe Lhree corners of an equllaLeral Lrlangle Lach anL
sLarLs randomly plcks a dlrecLlon and sLarLs Lo move along Lhe edge of Lhe Lrlangle WhaL
ls Lhe probablllLy LhaL none of Lhe anLs colllde?
Answer So leL's Lhlnk Lhls Lhrough 1he anLs can only avold a colllslon lf Lhey all declde Lo
move ln Lhe same dlrecLlon (elLher clockwlse or anLlclockwlse) lf Lhe anLs do noL plck
Lhe same dlrecLlon Lhere wlll deflnlLely be a colllslon Lach anL has Lhe opLlon Lo elLher
move clockwlse or anLlclockwlse 1here ls a one ln Lwo chance LhaL an anL decldes Lo
plck a parLlcular dlrecLlon uslng slmple probablllLy calculaLlons we can deLermlne Lhe
probablllLy of no colllslon
(no colllslon) (All anLs go ln a clockwlse dlrecLlon) + ( All anLs go ln an anLl
clockwlse dlrecLlon) 03 * 03 * 03 + 03 * 03 * 03 02S
Llked Lhls posL? lease ulgg or SLumble lL
2
uest|on ou've goL someone worklng for you for seven days and a gold bar Lo pay Lhem
ou musL pay Lhe worker for Lhelr work aL Lhe end of every day lf you are only allowed Lo
make Lwo breaks ln Lhe gold bar how do you pay your worker? (Assumlng equal amounL
of work ls done durlng each day Lhus requlrlng equal amounL of pay for each day)
Answer 1he Lrlck ls noL Lo Lry and how Lo cuL ln such a way Lo make 7 equal pleces buL
raLher Lo make LransacLlons wlLh Lhe worker Make Lwo cuLs on Lhe gold bar such LhaL you
have Lhe followlng slzes of bars
1/7 2/7 and 4/7 lor convenlence sake l would [usL refer Lo Lhe bars as 1 2 and 4
AL Lhe end of uay 1 Clve 8ar 1 (ou 2 and 4 Worker 1)
AL Lhe end of uay 2 Clve 8ar 2 1ake back 8ar 1 (ou 1 and 4 Worker 2)
AL Lhe end of uay 3 Clve 8ar 1 (ou 4 Worker 1 and 2)
AL Lhe end of uay 4 Clve 8ar 4 1ake back 8ar 1 and 8ar 2 (ou 1 and 2 Worker 4)
AL Lhe end of uay 3 Clve 8ar 1 (ou 2 Worker 1 and 4)
AL Lhe end of uay 6 Clve 8ar 2 1ake back 8ar 1 (ou 1 Worker 2 and 4)
AL Lhe end of uay 7 Clve 8ar 1 (ou LmpLy Worker 1 2 and 4)
3
uest|on ou have 10 boxes of balls (each ball welghlng exacLly10 gm) wlLh one box wlLh
defecLlve balls (each one of Lhe defecLlve balls welgh 9 gm) ou are glven an elecLronlc
welghlng machlne and only one chance aL lL Pow wlll flnd ouL whlch box has Lhe defecLlve
balls?
Answer lor convenlence sake leL's name Lhe boxes from 1 Lo 10 ln order Lo solve Lhls
problem you have Lo leverage Lhe facL LhaL you know exacLly whaL each good ball ls
supposed Lo welgh and whaL each defecLlve ball ls supposed Lo welgh Many of us
lnsLlncLlvely wlll Lake one ball ouL of each box and Lry Lo flnd a way Lo make lL work buL Lhe
Lrlck Lo Lake dlfferenL number of balls from each box
1he number of balls you plck from each bag ls equal Lo Lhe box number lor example plck
1 ball from box 1 2 balls from box 2 and so on ln LoLal you wlll have 33 balls lf all of Lhe
boxes have good balls Lhen Lhe LoLal welghL of Lhese balls would be 330gm
lf box 1 has defecLlve balls Lhen Lhe LoLal welghL should be 1gm less Lhan expecLed (only
one ball welghlng 9 gm) lf box 2 has defecLlve balls Lhen Lhe LoLal welghL should be 2gm
less Lhan expecLed (Lwo balls welghlng 9 gm) So once you welgh Lhe seL of chosen balls
flnd ouL Lhe dlfference beLween Lhe LoLal welghL and Lhe expecLed welghL 1haL number
represenLs Lhe box number whlch conLalns Lhe defecLlve balls
4
W uest|on lour people need Lo cross a rlckeLy brldge aL nlghL unforLunaLely Lhey
have only one Lorch and Lhe brldge ls Loo dangerous Lo cross wlLhouL one 1he
brldge ls only sLrong enough Lo supporL Lwo people aL a Llme noL all people Lake
Lhe same Llme Lo cross Lhe brldge 1lmes for each person 1 mln 2 mlns 7 mlns
and 10 mlns WhaL ls Lhe shorLesL Llme needed for all four of Lhem Lo cross Lhe
brldge?
W Answer 1he lnlLlal soluLlon mosL people wlll Lhlnk of ls Lo use Lhe fasLesL person as
an usher Lo gulde everyone across Pow long would LhaL Lake? 10 + 1 + 7 + 1 + 2
21 mlns ls LhaL lL? no 1haL would make Lhls quesLlon Loo slmple even as a warm
up quesLlon
W LeL's bralnsLorm a llLLle furLher 1o reduce Lhe amounL of Llme we should flnd a
way for 10 and 7 Lo go LogeLher lf Lhey cross LogeLher Lhen we need one of Lhem
Lo come back Lo geL Lhe oLhers 1haL would noL be ldeal Pow do we geL around
LhaL? Maybe we can have 1 walLlng on Lhe oLher slde Lo brlng Lhe Lorch back
Ahaa we are geLLlng closer 1he fasLesL way Lo geL 1 across and be back ls Lo use 2
Lo usher 1 across So leL's puL all Lhls LogeLher
W 1 and 2 go cross
2 comes back
7 and 10 go across
1 comes back
1 and 2 go across (done)
W 1oLal Llme 2 + 2 + 10 + 1 + 2 mlns
W lf you have any quesLlons please feel free Lo send me an emall
3
6
1here are 100 bulbs arranged ln a row Lach bulb has lLs own swlLch and ls currenLly Lurned
off ln Lhe flrsL round you Lurn every swlLch on ln Lhe second round you fllp Lhe swlLch of
every second bulb (le bulb 2 4 6 8 and so on) ln Lhe Lhlrd round you fllp Lhe swlLch of
every Lhlrd bulb and so on WhaL ls Lhe sLaLe of bulb 9 afLer 100 rounds? Also how many
bulbs are on afLer 100 rounds?
Answer Sounds easy enough? LeL's Lake our usual meLhodlcal approach
LeLs Lhlnk abouL Lhe round ln whlch each bulb geLs fllpped ln round 2 every even
numbered bulb geLs fllpped ln round 10 every bulb LhaL ends ln a zero wlll geL fllpped
So leLs plck bulb 48 per say lL geLs fllpped ln rounds 1 2 3 4 6 8 12 16 24 and 48 So
essenLlally every round LhaLs a facLor of 48 lf you noLlce carefully you wlll see LhaL Lhese
facLors always come ln palrs llke (1 48) (2 24) (3 16) and so on Slnce Lhey occur ln palrs
for each fllp LhaL Lurns Lhe bulb on Lhere ls a fllp LhaL Lurns lL off
8uL whaL happens Lo bulb 81 So lf we flnd Lhe facLors of 81 we geL (1 81) (3 27) and (9
9) 8uL round 9 only happens once So for every number LhaL has a palr of facLors LhaL are
equal (aka perfecL squares) Lhere wlll be an odd number of fllps So Lhls leaves all bulbs
off excepL Lhose bulbs whlch are perfecL squares
Slnce 9 ls a perfecL square lL wlll be CN afLer 100 rounds Also slnce Lhere are 10 perfecL
squares from 1 Lo 100 (bulbs 1 4 9 16 23 36 49 64 81 100) Lhere wlll be 0 bu|bs LhaL
remaln CN afLer round 100
7
uest|on ou are sLandlng ouLslde a room nexL Lo Lhree swlLches all of whlch are off Lach
swlLch operaLes a dlfferenL llghL bulb ln Lhe room 1he room door ls closed so you cannoL see
whlch swlLch operaLes whlch bulb ou are only allowed Lo go lnLo Lhe room once ueLermlne
whlch swlLch operaLes whlch bulb
Answer SLumped? 1he lssue lles ln Lhe facL LhaL Lhere are only Lwo posslble poslLlons for each
swlLch (on or off) buL Lhree bulbs Lo ldenLlfy ldenLlfylng one bulb ls super easy [usL seL one
swlLch on and Lhen go lnLo Lhe room Lo check whlch one ls on 8uL Lhen how do we deLecL Lhe
oLher Lwo?
So leL's Lhlnk deeper whaL are Lhe oLher properLles of a llghL bulb operaLed by a swlLch? LlghL
bulbs deflnlLely produce llghL buL Lhey also produce heaL (a noL so very lmporLanL
characLerlsLlc!) Any chance we can use Lhls ldea Lo help solve our problem? Slnce a llghL bulb
would Lake someLlme Lo lose lLs heaL afLer belng swlLched off you could sLlll deLermlne lf lL had
ever been on by Louchlng lL
So now we can easlly deLermlne whlch bulb ls operaLed by whlch swlLch llrsL we Lurn Lhe flrsL
swlLch on and leave Lhe oLher Lwo off AfLer 3 mlnuLes we Lurn Lhe flrsL swlLch off Lurn Lhe
second swlLch on and leave Lhe Lhlrd swlLch off 1hen we go lnLo Lhe room and Louch one of Lhe
bulbs whlch ls Lurned off AfLer LhaL lL would be easy Lo Lell LhaL Lhe flrsL swlLch maLches Lhe
warm bulb Lhe second swlLch maLches Lhe bulb LhaLs Lurned on and Lhe Lhlrd swlLch maLches
Lhe colder bulb
Many mlghL Lhlnk LhaL Lhls quesLlon would be a cheap shoL aL a Lrlck quesLlon aL an lnLervlew
1rusL me l LhoughL Lhe same 8uL when l was asked Lhls quesLlon on an lnLervlew my LhoughLs
changed So when prepplng for a sofLware lnLervlew be weary of Lhese klnds of quesLlons!
8
BurnIng SLIcks
Question: You have two sticks and matchbox. Each stick takes exactly an hour
to burn from one end to the other. The sticks are not identical and do not burn
at a constant rate. As a result, two equal lengths of the stick would not
necessarily burn in the same amount of time. How would you measure exactly
4S minutes by burning these sticks?
Answer: This puzzle used to be asked in Wall Street interviews long time ago. !t
is very rare for this question to be asked now but it is a very good question to
help you think a little outside the normal thought process.
The answer is really simple. Since the sticks do not burn at a constant rate, we
can not use the length of the stick as any sort of measurement of time. !f we
light a stick, it takes 60 minutes to burn completely. What if we light the stick
from both sides? !t will take exactly half the original time, i.e. 30 minutes to burn
completely.
0 minutes - Light stick 1 on both sides and stick 2 on one side.
30 minutes - Stick 1 will be burnt out. Light the other end of stick 2.
4S minutes - Stick 2 will be burnt out.

Potrebbero piacerti anche