Spoiler alert: it really isn't obvious that you are allowed to take links back from the landlord. But maybe that's just me. It's been so long since I've used cash (I live in Norway) that the idea of change has been forgotten.
My question is!!! Who the hell asks such questions in an interview I would literally panic to death if someone asked me such questions in an interview 😂😂😂😂
They're often used in interviews for software engineers/developers. Having great maths skills and problem solving skills as demonstrated in these kinds of puzzles is really useful in their line of work. My brother frequently tries to catch me out with them...and succeeds because I'm terrible at them :D
@Damn Dude Good question!! I wasn't able to make use of that hint at 0:57 neither. Thanks to your question and thanks @Arshad Khan's answer it adds up now ;-)
Another simpler solution: Decompose these links in a binary distribution (as powers of 2): 1,2,4,8,16,32,64. Using these nunbers it is possible to come up with any number till 149. However, we have the additional constraints of fewest cuts. Since we know that a link cut can give two smaller chains along with a single link, make the 4 cuts such that it yields smaller chains of 64,32,16,8 and 3. Along with this we also have 4 single links. So the final configuration is :1,1,1,1,3,8,16,32,64. Even with this config, we can accomodate any number from 1 thru 149. Plus we have made no more than 4 cuts!
2:48 "Apply this logic to the chain of 149 links and 149 weeks. 75th is the middle week..." Either you have to prove that this logic leads to an optimal solution (which is not trivial), or you would have to prove that the riddle can't be solved with 3 cuts. I would prefer the latter, because you could derive a formula from your idea around 5:45 : w(n) = (n+1)*2^(n+1)-1; n in setN is the number of cuts, w(n) is max weeks. w(3) = 63 < 149
"pause the video and think about it" 10 seconds later... "The landlord doesn't spend any of them till he has them all" um WTH was that? You didn't mention that fact before.
Really mind-blowing! Your puzzles helps me to think out of the box, and educate to read more propperly, indeed, what's great!! All my respect to you and thanks a lot
Shubham... i purposely gave the hint in the beginning so that it should be clear that we can exchange the sets.. and importantly concentrate on minimizing the number of cuts
LOGICALLY YOURS yeah.. I still couldn't figure that out.. I have a suggestion if you would like to consider.. How about you put a difficulty level for every puzzle.. Something out of 10 or may be like IQ level.. Just so that we can follow up our progress. Like how sharp we are getting at analyzing problems and situations
Ok just pointing out a flaw in this... From what i heard its never specified what he is cutting the chain with, so if he had the right tools he could just cut the chain horizontaly ( cut each link in half) which means only one cut no matter how big the chain is
No no, thus he is paying 9 links for 5 weeks...the target is the landlord to have the number of links as the number of weeks passed....means, for per week he is paying one link.... By your explanation....you paid 5 links for 5th week, so the total raised to 9, means at the end of 5th week the landlord got 9links but he had to get 5only....
I couldn't understand the concept of links. I thought making a cut between 7 links would end up in 3+4 links. Expected the answer to be in similar lines though. Good explanation.
Thanks for your videos I went to a interview and they asked me some of your riddles and I answered fastly They were quite impressed in me Thanks so much
I think not all the people is lazy enough to cut the gold chain link once per week since it's a soft metal. Or you can cut only the 74 "in between links" once per two weeks. Or, if you lazy enough to cut those soft metal, you can just give all the 149 links to the landlord as a payment in advance for 149 weeks, and no chain cutting is needed.
@Super Cool I know that but tell me who pays "links" as a payment mode?? Instead of thinking like that just pay attention what's the question asking exactly and don't try to find factual faults in it then try to solve it as it is.
I think cutting the link at particular position would result chain into two parts but not of 3(you've explained in that way) Ex: Cutting the chain of length 7 at position 3 would result in two chains of length 3 and 4 but not of 3 of lengths i.e 2,1 and 4(Earlier explained in the video) And if I follow ur procedure will result in 8 cuts which can be done in 7 cuts. How do I get in 7 cuts ##Dividing a chain of any length into "n" parts takes (n-1) cuts. ##Idea is any number can be represented as sum of powers of 2 Ex : 7= 1+2+4 1.Divide the chain of 149 links into 8 parts of lengths 1,2,4,8,16,32,64 and 22 which consumes 7 cuts. So,you can get any number less than 150 as the sum of certain numbers in the above set and u can give corresponding no.of links on a particular week. Ex : 1 =1 3 = 1+2 7 = 1+2+4 15 = 1+2+4+8 31 = 1+2+4+8+16 63 = 1+2+4+8+16+32 127 = 1+2+4+8+16+32+64 137 = 22+64+32+16+4+1
@Mani... when u cut a link, it can be taken out individually... making three separated portions... suppose u have a chain of 3 connected links. Cut the central link, take it out... now u have 3 separate links... That's why this puzzle is different from goldbar puzzle.... your explanation is valid for goldbar.
Hi Umasankar.... you are correct. We will need an extra cut to first break the circle. However, it won't create any tricky calculation for distribution. So, for this particular puzzle, a linear chain was suitable.
Hi Ammar, thanks for the puzzle. At duration 4:21, when we are looking for gold links for week 5, we can pay with 9 links and take the 4 links back, making it 5 cumulatively. Is there anything wrong with that?
Believe me or not the merge sort algo was pondering in my mind and I could really make it out how to do it. However while starting I started of with 5 links instead of 149 and I had made a cut at the middle -1 I.e the 2nd ring
The interviewer asked one puzzle to my friend, which is ' There are two doors - hell and heaven. At each door one Guard is standing. In one of them always lies. Then the puzzle is how can you define the door by asking only one question'.
Explanation is nice, but I think the puzzle is difficult to solve in short time. It took too much time for me to solve. First I thought it is similar to your Gold bar puzzle, but it was different
Zubair... yes there is a huge difference between "Goldbar puzzle" and "Gold chain puzzle". Although it's not easier one, but a sesnsible interviewer checks your approach rather than the end result.
No Sunil.... 149 links are purposely given. With just 4 breaks you can pay for a maximum of 159 weeks... and for 149 weeks as well you need 4 breaks.. You can watch the part from 6:30 to 6:40...
Big fan, thanks for all the great content. If it hasn't been requested yet, can you please create videos with dark backgrounds. The white background is harsh in the evening.
It would have helped if the question stated the old guy kept the gold links... Also, the old man will sooner or later be blackjacked for the gold links for sure.
Practically we can not expect landlord to return previously given links. Therefore its much better to change the wordings of the question. Something like how many minimum number of partitions of 149 balls you can have in order to express numbers from 1 to 149 in terms of sums of such partitions.
WTF to get a broken parts of a chain every week, he can get it as a whole Also, the best part is no use for that link unless the landlord sells it for money or something. What's the guarantee that those link won't be sold by the landlord in that week and he will keep it. Like the disclaimer in the movie, it is just fictional problem with more and more fictional solution. But still i liked it...👍
Dont cut any links, pay in advance. Give the landlord the whole chain.
But the sum of the links is a chain, and is worth more
@@timmy18135 but we are paying full 149 links to the guy by the end
and next day the landlord kickoff the person 😂😂
@@suman-majhi we have to do on paper contract
I made your no. of likes to 149 😎
Spoiler alert: it really isn't obvious that you are allowed to take links back from the landlord. But maybe that's just me. It's been so long since I've used cash (I live in Norway) that the idea of change has been forgotten.
this type of thinking is the reason why i am not able to crack onterviews😂😂
My question is!!! Who the hell asks such questions in an interview I would literally panic to death if someone asked me such questions in an interview 😂😂😂😂
They're often used in interviews for software engineers/developers. Having great maths skills and problem solving skills as demonstrated in these kinds of puzzles is really useful in their line of work. My brother frequently tries to catch me out with them...and succeeds because I'm terrible at them :D
Jessica Taylor Thank you for the information! Haha! You better go through these questions well if you want to face your brother lol 😂😂
Well u need to talk to the landlord in advance
Classic recursion dynamic programming problem asked all time for software engineers
logical people would pay the landlord beforehand with zero cuts 😑and obtain a receipt of the payment
Then u will lose the whole paid amount if you want to shift to another place after a few weeks
Tjata correct,technically zero,is a valod answer with no cuts made
Excellent explanation...this is best logical channel
Badhiyo
Well just a doubt. What makes you think that the landlord would have kept the links with him and not have sold them?!🤔🤔🤔
Because if he sell the links then the person will not be able to exchange links
Coz that was told during the question, it was already given that he won't sold any links till the end of 149th week.
@Damn Dude Good question!! I wasn't able to make use of that hint at 0:57 neither. Thanks to your question and thanks @Arshad Khan's answer it adds up now ;-)
Then just cut every even link. I missed that clue at first, too.
Arshad Khan . You are right. But it also did not say that the land lord will KEEP it with him. Let’s say that he hid it in a bank 🏦.
please present all the conditions when giving the puzzle at the starting of video.. you oftenly place incomplete conditions
It doesn't matter. We will still not be able to 😁😁
@@timewalker2447 always not..
I wish I’d understood the problem better before trying to solve. It never occurred to me that the landlord would tolerate you asking for links back
Another simpler solution: Decompose these links in a binary distribution (as powers of 2): 1,2,4,8,16,32,64. Using these nunbers it is possible to come up with any number till 149. However, we have the additional constraints of fewest cuts. Since we know that a link cut can give two smaller chains along with a single link, make the 4 cuts such that it yields smaller chains of 64,32,16,8 and 3. Along with this we also have 4 single links. So the final configuration is :1,1,1,1,3,8,16,32,64. Even with this config, we can accomodate any number from 1 thru 149. Plus we have made no more than 4 cuts!
exactly how I was thinking about it
Keep going. Your work is really outstanding.we really admire it.
Hi Meet... To me such an appreciation is more important than silver play button :)
@@LOGICALLYYOURS BECAUSE THERE IS NO CHANCE FOR YOU TO REACH THE DESTINATION 1M SUBSCRIBER😆😆👻💩💩. LOGICALLY I THINK SO😎
I'd rather not stay in a place where I have to give so much gold as weekly rent.
You don't know, how thick is this chain, one link may weight for example 0.5 gram
2:48 "Apply this logic to the chain of 149 links and 149 weeks. 75th is the middle week..."
Either you have to prove that this logic leads to an optimal solution (which is not trivial), or you would have to prove that the riddle can't be solved with 3 cuts.
I would prefer the latter, because you could derive a formula from your idea around 5:45 :
w(n) = (n+1)*2^(n+1)-1; n in setN is the number of cuts, w(n) is max weeks.
w(3) = 63
< 149
The animation explains it very well.
Unbelievable! super. you are a fantastic man! thanks for the knowledge. May God bless you with more knowledge and happiness man
Thanks Naasif :)
Perfect explanation!, after watching one time we are able to understand completely.
Thanks Ram, really good to know that the explanation helped you.
Really 🙄🙄
I would do 4 cuts, like 5,10,20,40,70. This gives 4-single cut pieces. Its very easy to manage and easy to extend the binary algorithm to any number.
Very nice question, it challenges all the logical ability in us
Thanks Vamsi :)
"pause the video and think about it"
10 seconds later... "The landlord doesn't spend any of them till he has them all" um WTH was that? You didn't mention that fact before.
Good quality of questions 🔥🔥
Really mind-blowing!
Your puzzles helps me to think out of the box, and educate to read more propperly, indeed, what's great!!
All my respect to you and thanks a lot
Thank u for making such videos..
Thanks a lot Gourav :)
Excellent "Question and explanation "
Nice explanation in pictorial form
This one was truly amazing.. One I couldn't solve.. It never appeared to me that he can take the links back as it wasn't spent by landlord
Shubham... i purposely gave the hint in the beginning so that it should be clear that we can exchange the sets.. and importantly concentrate on minimizing the number of cuts
LOGICALLY YOURS yeah.. I still couldn't figure that out.. I have a suggestion if you would like to consider.. How about you put a difficulty level for every puzzle.. Something out of 10 or may be like IQ level.. Just so that we can follow up our progress. Like how sharp we are getting at analyzing problems and situations
you were right , as it was never mentioned that he can take the links back.
Yes, but it's not a hint. It's part of the definition if the problem.
Very nice logical solution.
Thanks à lot for your logical puzzle
I àm a big fan of you
Many thanks Nanda... trust me it took huge efforts for this video but I got my reward with beautiful comments... :)
@@LOGICALLYYOURS
Hard work will always result a sweet outcome
I really appreciate you
Nice I loved this puzzle ☺
Many thanks Rahul :)
real good explanation Ammar.
Good one bro..Great logic..neat explanation..Keep posting..Logic Rocks..
Thank Afrose. Really nice to see this comment.
Very well explained 👍
4:23 actually you can give the 9linked and take the 4 links from him.
Rohit Reddy doesn’t it mean that you give 9 for 5 week?
@@monolizm yeah
Rohit Reddy but you should give 5link
@@monolizm I'll take the 4 links from him which I had previously given.
At the end of week 5.. he should only have 5 link in total. Not a link more..
Ok just pointing out a flaw in this... From what i heard its never specified what he is cutting the chain with, so if he had the right tools he could just cut the chain horizontaly ( cut each link in half) which means only one cut no matter how big the chain is
4:31
To pay for the 5th week he can give the chain with 9links and take 4 individual links from the landlord
No no, thus he is paying 9 links for 5 weeks...the target is the landlord to have the number of links as the number of weeks passed....means, for per week he is paying one link....
By your explanation....you paid 5 links for 5th week, so the total raised to 9, means at the end of 5th week the landlord got 9links but he had to get 5only....
@@palashpratimdeka230 ok got it
Nice explanation.
Wonderful logical videos
Great. Very nice puzzle
Seriously awesome solution
I appreciate your efforts. You are guineous
I couldn't understand the concept of links. I thought making a cut between 7 links would end up in 3+4 links. Expected the answer to be in similar lines though. Good explanation.
Watch from 1:47 , you will understand why 2+1+4 & not 3+4
Great video bro👌
Super bro. I love your videos
Thanks Harish :)
You earned yourself a subscriber i love this content and question keep positing these pls
Mind blowing 🤯🤯😱😱
Based off language of the question, can't I cut the chain once? Just lengthwise, get all the links on a single cut...?
Thinking outside the.. link?
Wow 👏👏 truly admirable ..🤩
Mind blowing bro
Thanks for your videos
I went to a interview and they asked me some of your riddles and I answered fastly
They were quite impressed in me
Thanks so much
The question made no sense. Did anyone know the landlord could give you back links?
Excellent explanation
I think not all the people is lazy enough to cut the gold chain link once per week since it's a soft metal. Or you can cut only the 74 "in between links" once per two weeks.
Or, if you lazy enough to cut those soft metal, you can just give all the 149 links to the landlord as a payment in advance for 149 weeks, and no chain cutting is needed.
And the interviewer will give you the salary for a year in advance.
@@sabyasachirimpa That was hilarious.... can't stop laughing....
@Bagus.... for a puzzle we shouldn't consider practical situation.
@Super Cool I know that but tell me who pays "links" as a payment mode?? Instead of thinking like that just pay attention what's the question asking exactly and don't try to find factual faults in it then try to solve it as it is.
Beautiful
That was a beauty
Bro...you are really awesome
Thsnks a lot Ravi :)
Impressive 💯💯
This is why I'm a painter
Excellent 👍
Clever very clever 😅
You want us to answer this in the given time of 10sec? *Claps sarcasticly*
I think cutting the link at particular position would result chain into two parts but not of 3(you've explained in that way)
Ex: Cutting the chain of length 7 at position 3 would result in two chains of length 3 and 4
but not of 3 of lengths i.e 2,1 and 4(Earlier explained in the video)
And if I follow ur procedure will result in 8 cuts which can be done in 7 cuts.
How do I get in 7 cuts
##Dividing a chain of any length into "n" parts takes (n-1) cuts.
##Idea is any number can be represented as sum of powers of 2
Ex : 7= 1+2+4
1.Divide the chain of 149 links into 8 parts of lengths 1,2,4,8,16,32,64 and 22 which consumes 7 cuts.
So,you can get any number less than 150 as the sum of certain numbers in the above set and u can give corresponding no.of links on a particular week.
Ex :
1 =1
3 = 1+2
7 = 1+2+4
15 = 1+2+4+8
31 = 1+2+4+8+16
63 = 1+2+4+8+16+32
127 = 1+2+4+8+16+32+64
137 = 22+64+32+16+4+1
@Mani... when u cut a link, it can be taken out individually... making three separated portions... suppose u have a chain of 3 connected links. Cut the central link, take it out... now u have 3 separate links...
That's why this puzzle is different from goldbar puzzle.... your explanation is valid for goldbar.
excellent explanation
I was able to solve this one ☺️
Sir,
The gold chain look like a straight line or a rounded shape
if it is rounded shape so the minimum cut is 5
Its linear....means their end are not joint
Hi Umasankar.... you are correct. We will need an extra cut to first break the circle. However, it won't create any tricky calculation for distribution. So, for this particular puzzle, a linear chain was suitable.
Excellent!
Very interesting video :-)
Thanks buddy :)
Amazing 👏
Super bro
Well explained...
It was really helpful thanks :))
The way question asked could have been more elaborated.
Amazing puzzle
very good puzzle
it's awesome
thanks a lot....
I love it keep doing
Awesome 👌
Hi Ammar, thanks for the puzzle. At duration 4:21, when we are looking for gold links for week 5, we can pay with 9 links and take the 4 links back, making it 5 cumulatively. Is there anything wrong with that?
because the landlord has 9 links not 5
1st viewer
Huh. I ended up going for the general ('beautified') solution first.
Believe me or not the merge sort algo was pondering in my mind and I could really make it out how to do it. However while starting I started of with 5 links instead of 149 and I had made a cut at the middle -1 I.e the 2nd ring
The interviewer asked one puzzle to my friend, which is ' There are two doors - hell and heaven. At each door one Guard is standing. In one of them always lies. Then the puzzle is how can you define the door by asking only one question'.
"Which door would that other guard say leads to heaven?"
beautiful
Explanation is nice, but I think the puzzle is difficult to solve in short time. It took too much time for me to solve.
First I thought it is similar to your Gold bar puzzle, but it was different
Zubair... yes there is a huge difference between "Goldbar puzzle" and "Gold chain puzzle". Although it's not easier one, but a sesnsible interviewer checks your approach rather than the end result.
Super
If i were the landlord i would not agree in trading back links because it suits the merchant.
Incredible
Super..r..b
But...
Just one correction...
...
U started with 149 links and ended on 159 weeks...
No Sunil.... 149 links are purposely given. With just 4 breaks you can pay for a maximum of 159 weeks... and for 149 weeks as well you need 4 breaks.. You can watch the part from 6:30 to 6:40...
Excellent
Big fan, thanks for all the great content. If it hasn't been requested yet, can you please create videos with dark backgrounds. The white background is harsh in the evening.
Am I the only one who didn't get the last part yet.
i did it a different way and just figured out the maximum for 2,3,4,5 cuts. You can do 159 with 4 cuts
i got your point John... in fact when your are working with timer based exams, your approach will get faster result.
Good job
Bohot hard
It would have helped if the question stated the old guy kept the gold links... Also, the old man will sooner or later be blackjacked for the gold links for sure.
Nice
good puzzle
Also 5,10,20,40,70, and many other ways with the same 4 cuts.
Practically we can not expect landlord to return previously given links. Therefore its much better to change the wordings of the question. Something like how many minimum number of partitions of 149 balls you can have in order to express numbers from 1 to 149 in terms of sums of such partitions.
WTF to get a broken parts of a chain every week, he can get it as a whole
Also, the best part is no use for that link unless the landlord sells it for money or something. What's the guarantee that those link won't be sold by the landlord in that week and he will keep it.
Like the disclaimer in the movie, it is just fictional problem with more and more fictional solution.
But still i liked it...👍
Google interview puzzle: There are 8 bottles of wine and one is poisonous. How many rats are required to find which bottle is poisonous in 1 hour!
Zero rats. I don't drink wine. It will kill me even without poison.😂😂😂
Some data is missing in your question.
toughe one 👏
trying to talk my landlord into agreeing to this seems like way more of a hassle than cutting a chain every two weeks