Professional Documents
Culture Documents
Gold For 7 Days of Work My Tech Interviews
Gold For 7 Days of Work My Tech Interviews
HOME
CHAL L E NGE
T OP 10
ADVE RT IS E WIT H US
AB OUT
S UB S CRIB E
MYTECHINTERVIEWS
PREPAREFORATECHNICALINTERVIEW
Goldfor7DaysofWork
6Jan10
Search
Tweet Quest ion:Youvegotsomeoneworkingforyouforsevendaysandagoldbarto
paythem.Youmustpaytheworkerfortheirworkattheendofeveryday.Ifyou
RA NDO M
areonlyallowedtomaketwobreaksinthegoldbar,howdoyoupayyourworker?
ExampleofInterviewTestForFrontEnd
(Assumingequalamountofworkisdoneduringeachdaythusrequiringequalamountof
Developers
payforeachday)
BeforeYouTryToGetATechJob,Build
Answer:Thetrickisnottotryandhowtocutinsuchawaytomake7equalpiecesbut
Stuff
rathertomaketransactionswiththeworker.Maketwocutsonthegoldbarsuchthatyou
AnagramsinanArrayofStrings
havethefollowingsizesofbars.
1/7,2/7and4/7.Forconveniencesake,Iwouldjustrefertothebarsas1,2and4.
FO LLO WUS
AttheendofDay1:GiveBar1(You2and4,Worker1)
AttheendofDay2:GiveBar2,TakebackBar1(You1and4,Worker2)
AttheendofDay3:GiveBar1(You4,Worker1and2)
Wheredidarcadegamesgo?
AttheendofDay4:GiveBar4,TakebackBar1andBar2(You1and2,Worker4)
CA T EG O RIES
AttheendofDay5:GiveBar1(You2,Worker1and4)
Array(1)
AttheendofDay6:GiveBar2,TakebackBar1(You1,Worker2and4)
BitManipulation(4)
Challenge(5)
AttheendofDay7:GiveBar1(YouEmpty,Worker1,2and4)
General(15)
Thatshouldtakecareofeverything.
LinkedLists(4)
Pointers(5)
Ifyouhaveanyquestions,pleasefeelfreetosendmeanemail
Probability(5)
atsupport@mytechinterviews.com.Ifyouhaveanyinterviewquestionswhichyoufeelwould
Programming(15)
benefitothers,Iwouldlovetohearaboutit.
Puzzles(37)
StringManipulation(7)
Relatedposts:
Trees(2)
I. 6Pirat esFight for1GoldCoin
Uncategorized(8)
A RCHIV ES
April2016(1)
V. 12Ident icalBallsProblem
March2016(3)
February2016(10)
February2015(1)
FiledinPuzzles
Taggedc,distribution,gold,puzzle,transcation,tricky,work
10Comments
April2011(4)
March2011(2)
February2011(4)
10Responses
June2010(1)
March2010(4)
February2010(17)
XiPhang
January2010(32)
M AR C H 1 8,2 01 6 AT 7 :30AM
canimeltitthegold??
1/4
4/28 /2016
schimschone
D EC EM B ER 1 ,2 01 4 AT 2 :07 P M
Whilethereispossiblysomemeritinaskingthequestion..youknow,seeifan
employeehasacreativeresponsetoabadsituation..theanswerthatappearstobe
wantedisjustplaindaft.
Imean,whatsthepointofpayinganemployeeifyourplanistobartersomeamount
ofwhatyoupaidthembackatsomefuturepoint.Employeestakepaymentfortheir
servicessothattheycaninturnbuythegoodsandservicestheyneedtosurvive..and
thuskeepworkingforyourscroogedass.Theonlyreasononewouldpayan
employeepriortocompletingtheirworkwouldbetosupporttheirneedspriorto
completion.IftheemployeecantspendthemoneybecauseIwilllaterhavetotradeit
backtothem,thenwevenegatedthewholereasonforthetrade.
Thatstatedthen,theresthreerealanswers:First,paythemuponcompletion.Second
paythemoneblockapproximatelyevery3rdofaweek.Orthird,paythemsomeinitial
goodfaithamountwiththerestuponcompletion.
Yes,whileIrealizethisposesamathematicalproblembeggingforanefficientanswer,
aspartofaninterviewforanythingotherthanamathspecificpositionitshowsa
completelackofgroundinginreality.Doreallywanttohiresomeonewhoisso
groundedinefficiencythattheyllneveractuallybeabletonegotiateastrategywith
anotherhumanbeingbyaccountingforthatpersonsneeds?
Yash
AP R IL 6 ,2 01 1 AT 1 0:2 6 AM
Initiallybreakthe7segmentblockintofollowingsegments
i(blocksegment)
ii(blocksegment)
iiii(blocksegment)
1day>Givei(blocksegment)
2day>Giveii(blocksegment)&
takebacki(blocksegment)
3day>Givei(blocksegment)
4day>Giveiiii(blocksegment)&takebacki,iiblocksegments
5day>Givei(blocksegment)
6day>Giveii(blocksegment)&
takebacki(blocksegment)
7day>Givei(blocksegment)
TalAchit uv
AP R IL 1 ,2 01 1 AT 6 :4 0AM
Whenyoureaskedthisduringaninterview,yourthoughtprocessshouldbe:
1)Ineedtocutthebarinto7equalpieceswithonlytwocuts.Thisisclearly
impossible.
2)Letsrestatetheproblem:
Theworkerneedstohave1/7ofabarattheendofday1and2/7ofabarattheend
ofday2,andsoon
Whiletheoriginalassumedrequirementwasclearlyimpossibletosatisfy,thisre
statedoneisnotimpossibleoratleastitisnotasclearthatitisimpossible
2/4
4/28 /2016
Youshouldtrytofigureoutawayofsolvingitorprovingthatitaswellisimpossible.
Hopefullywhiletryingtodothatyoullthinkoftheoptionoftransactions.
Ace
M AR C H 1 2 ,2 01 1 AT 4 :1 7 P M
whatifIspentthegoldbytheendofthenextday?
Candy
M AR C H 4 ,2 01 1 AT 1 1 :5 7 AM
sailee
N OVEM B ER 2 9,2 01 0AT 4 :03P M
disisdsameanswerithoughtfordispuzzle
imconvinced.
IQ250
SEP T EM B ER 2 7 ,2 01 0AT 5 :1 2 AM
Youmustpaytheworkerfortheirworkattheendofeveryday.
FirstwearegivingthemmorethantheirwagesandthenafterrealiZintakinthm
bak
watdhellisdis??
Doggie
J U N E9,2 01 0AT 1 1 :03P M
Isntlikeaskingforchange?
You:Doyouhavechangefor2/7ofagoldbar?
Worker:OfcourseIdo,hereyougo
Doc
J U N E9,2 01 0AT 1 0:2 2 P M
Whowouldansweritthisway?Idontseewhyanyonewouldthinkabouttakingmoney
backfromsomeoneyoupay?Youcantcountonthemoneybeingthereonday2,3,
etc.Peoplehaveahabitofspendingmoney.
LeaveaReply
Name
Mail
3 /4
4/28 /2016
Website
SubmitComment
UsingGravatarsinthecommentsgetyourownandberecognized!
XHT ML:Thesearesomeofthetagsyoucanuse:<a href=""> <b> <blockquote>
<code> <em> <i> <strike> <strong>
MyTechInterviewsispoweredbyWordPressusingthemeTribune
4/4