5

Can You Solve Amazon’s Hanging Cable Interview Question?

 2 years ago
source link: https://mindyourdecisions.com/blog/2018/07/12/can-you-solve-amazons-hanging-cable-interview-question/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Can You Solve Amazon’s Hanging Cable Interview Question? – Mind Your Decisions

Mind Your Decisions

Math Videos, Math Puzzles, Game Theory. By Presh Talwalkar

About Me: Presh Talwalkar

I run the MindYourDecisions channel on YouTube, which has over 1 million subscribers and 200 million views. I am also the author of The Joy of Game Theory: An Introduction to Strategic Thinking, and several other books which are available on Amazon.

(As you might expect, the links for my books go to their listings on Amazon. As an Amazon Associate I earn from qualifying purchases. This does not affect the price you pay.)

By way of history, I started the Mind Your Decisions blog back in 2007 to share a bit of math, personal finance, personal thoughts, and game theory. It's been quite a journey! I thank everyone that has shared my work, and I am very grateful for coverage in the press, including the Shorty Awards, The Telegraph, Freakonomics, and many other popular outlets.

I studied Economics and Mathematics at Stanford University.

Feel free to send me an email [email protected]. I get so many emails that I may not reply, but I save all suggestions for puzzles/video topics.

My Books

If you purchase through these links, I may be compensated for purchases made on Amazon. As an Amazon Associate I earn from qualifying purchases. This does not affect the price you pay.

Book ratings are from January 2022.

(US and worldwide links) https://mindyourdecisions.com/blog/my-books



Mind Your Decisions is a compilation of 5 books:

(1) The Joy of Game Theory: An Introduction to Strategic Thinking (2) 40 Paradoxes in Logic, Probability, and Game Theory (3) The Irrationality Illusion: How To Make Smart Decisions And Overcome Bias (4) The Best Mental Math Tricks (5) Multiply Numbers By Drawing Lines



The Joy of Game Theory shows how you can use math to out-think your competition. (rated 4.2/5 stars on 224 reviews)





40 Paradoxes in Logic, Probability, and Game Theory contains thought-provoking and counter-intuitive results. (rated 4.1/5 stars on 38 reviews)





The Irrationality Illusion: How To Make Smart Decisions And Overcome Bias is a handbook that explains the many ways we are biased about decision-making and offers techniques to make smart decisions. (rated 4/5 stars on 24 reviews)





The Best Mental Math Tricks teaches how you can look like a math genius by solving problems in your head (rated 4.2/5 stars on 76 reviews)



Multiply Numbers By Drawing Lines This book is a reference guide for my video that has over 1 million views on a geometric method to multiply numbers. (rated 4.3/5 stars on 30 reviews)





Mind Your Puzzles is a collection of the three “Math Puzzles” books, volumes 1, 2, and 3. The puzzles topics include the mathematical subjects including geometry, probability, logic, and game theory.

Math Puzzles Volume 1 features classic brain teasers and riddles with complete solutions for problems in counting, geometry, probability, and game theory. Volume 1 is rated 4.4/5 stars on 87 reviews.

Math Puzzles Volume 2 is a sequel book with more great problems. (rated 4.1/5 stars on 24 reviews)

Math Puzzles Volume 3 is the third in the series. (rated 4.2/5 stars on 22 reviews)

Kindle Unlimited

Teachers and students around the world often email me about the books. Since education can have such a huge impact, I try to make the ebooks available as widely as possible at as low a price as possible.

Currently you can read most of my ebooks through Amazon’s “Kindle Unlimited” program. Included in the subscription you will get access to millions of ebooks. You don’t need a Kindle device: you can install the Kindle app on any smartphone/tablet/computer/etc. I have compiled links to programs in some countries below. Please check your local Amazon website for availability and program terms.

US, list of my books (US) UK, list of my books (UK) Canada, book results (CA) Germany, list of my books (DE) France, list of my books (FR) India, list of my books (IN) Australia, book results (AU) Italy, list of my books (IT) Spain, list of my books (ES) Japan, list of my books (JP) Brazil, book results (BR) Mexico, book results (MX)

Merchandise

Grab a mug, tshirt, and more at the official site for merchandise: Mind Your Decisions at Teespring.

Free Newsletter

Sign up for the newsletter! You'll get exclusive content like a free chapter of a book. I send the newsletter to for book releases and other big news. (I send it 1 or 2 times a year, and I only collect your email to send this news). You can sign up for the newsletter here: http://eepurl.com/KvS0r

Support

Most YouTube channels of my size have a staff of 5 people with a large budget and sponsors. As of 2019, I make most of the videos myself and have declined all sponsors. This has only been possible thanks to tremendous support from everyone that watches and shares my videos and blog posts. I am also grateful to donations through Patreon. Right now MindYourDecisions is going ad-free on new blog posts thanks to generous support from patrons. It costs thousands of dollars to run the blog and your support matters. If you like the posts and videos, please consider a pledge on Patreon.

I post to the following sites, mostly with updates for new content.

My Blog

YouTube

Facebook

Twitter

Instagram

Patreon

Contact me by email: [email protected]

Send me your favorite puzzles/suggestions by email. I get so many emails that I may not reply, but I save all suggestions. *I am not pursuing sponsors/guest posts/partnerships at this time. But I may in the future, and feel free to email me if there's an offer I couldn't possibly pass up ;)
amazon-hanging-cable-problem-600.jpg

Can You Solve Amazon’s Hanging Cable Interview Question?

If you buy from a link in this post, I may earn a commission. This does not affect the price you pay. As an Amazon Associate I earn from qualifying purchases. Learn more.

Posted July 12, 2018 By Presh Talwalkar. Read about me, or email me.

A version of part (b) was asked as an Amazon interview question.

A cable of 80 meters (m) is hanging from the top of two poles that are both 50 m from the ground. What is the distance between the two poles, to one decimal place, if the center of the cable is:

(a) 20 m above the ground?
(b) 10 m above the ground?

I added part (a) since it is interesting mathematically. And I admit I did not solve it, but it was fun so I wanted to share. Watch the video for a solution.

Can You Solve Amazon’s Hanging Cable Interview Question

Or keep reading.
.
.

"All will be well if you use your mind for your decisions, and mind only your decisions." Since 2007, I have devoted my life to sharing the joy of game theory and mathematics. MindYourDecisions now has over 1,000 free articles with no ads thanks to community support! Help out and get early access to posts with a pledge on Patreon.

.
.

.
.
.
.
M
I
N
D
.
Y
O
U
R
.
D
E
C
I
S
I
O
N
S
.
P
U
Z
Z
L
E
.
.
.
.
Answer To Amazon’s Hanging Cable Interview Question

(Pretty much all posts are transcribed quickly after I make the videos for them–please let me know if there are any typos/errors and I will correct them, thanks).

First let’s solve (a) 20 m above the ground. The diagram is like the following.

I didn’t remember how to solve this, and most of the references focused on physics concepts (weight, tension). Luckily I found a nice paper from Neil Chatterjee and Nita Bogdan with equations that made sense to me: The hanging cable problem for practical applications.

The setup is as follows. Due to symmetry, we can consider half the problem from one pole to the center. We can then double this distance for the distance between the two poles.

Also we will use a convenient coordinate system, centered at the lowest point of the hanging cable (which takes the shape of a catenary). We get the following “half diagram”:

The equation for a catenary tangent/touching the ground/x-axis is:

y = a cosh(x/a) – a

arc length = a sinh(x/a)

The parameter a is unknown, and we want to solve for the value of x of the pole.

Note the top of the pole is (x, 30), so we get one equation:

a cosh(x/a) = 30 + a

We also know that half of the cable length is 40 m, so using the equation for arc length of a catenary, we get another equation:

a sinh(x/a) = 40

We divide both equations by a to get:

cosh(x/a) = (30 + a)/a
sinh(x/a) = 40/a

We then use the hyperbolic identity:

cosh2t – sinh2t = 1

Substituting, we get:

(30 + a)2/a2 – (40/a)2 = 1

We can solve this to get:

a = 35/3

Then we use the equation:

(35/3) sinh (x/(35/3)) = 40

x = (35/3) arcsinh(120/35)

x = (35/3) ln(120/35 + √((120/35)2 + 1)) ≈ 22.7

As this is half the hanging chain, the distance between the two poles is then double this value:

2x = (70/3) ln(7) ≈ 45.4 m

Now let’s proceed to the second part.

(b) 10 m above the ground

Now we could try the same half diagram as in case (a)

We then get the equations:

cosh(x/a) = (40 + a)/a
sinh(x/a) = 40/a

We then use the hyperbolic identity and substitute the above results to get:

(40 + a)2/a2 – (40/a)2 = 1

But if you try to solve this there is a problem. This equation has no solution! So what is going on?

Let’s think about this logically.

If the cable is 80 m, then half of it is 40 m. But notice 40 m from the top of a 50 m pole is already 10 m above the ground. The cable therefore is hanging directly downward! The cable has to be doubled back upon itself, and the two poles must be coincident and 0 m apart!

This part is actually a trick question: the two poles are a distance of 0 apart. No physics was required to solve this one, just logical thinking!

Now an employee that uses common sense before wasting time with unnecessary calculations…I’d imagine that is probably an employee you want to hire.

I admit I did not solve this problem as I did not recognize the trick. But I like to learn about these problems, because it’s like the old saying goes.

“Fool me once, shame on you. Fool me twice–you can’t get fooled again.”

Sources

CareerCup
https://www.careercup.com/question?id=7949664

Chatterjee, Neil, and Bogdan G. Nita. “The hanging cable problem for practical applications.” Atlantic Electronic Journal of Mathematics 4.1 (2010).
http://euclid.trentu.ca/aejm/V4N1/Chatterjee.V4N1.pdf

https://mav.vic.edu.au/resources/online-mav-puzzle/item/298-two-flagpoles.html

http://themathmompuzzles.blogspot.com/2014/02/oscar-ropes-puzzle.html

Published by

PRESH TALWALKAR

I run the MindYourDecisions channel on YouTube, which has over 1 million subscribers and 200 million views. I am also the author of The Joy of Game Theory: An Introduction to Strategic Thinking, and several other books which are available on Amazon.

(As you might expect, the links for my books go to their listings on Amazon. As an Amazon Associate I earn from qualifying purchases. This does not affect the price you pay.)

By way of history, I started the Mind Your Decisions blog back in 2007 to share a bit of math, personal finance, personal thoughts, and game theory. It's been quite a journey! I thank everyone that has shared my work, and I am very grateful for coverage in the press, including the Shorty Awards, The Telegraph, Freakonomics, and many other popular outlets.

I studied Economics and Mathematics at Stanford University.

People often ask how I make the videos. Like many YouTubers I use popular software to prepare my videos. You can search for animation software tutorials on YouTube to learn how to make videos. Be prepared--animation is time consuming and software can be expensive!

Feel free to send me an email [email protected]. I get so many emails that I may not reply, but I save all suggestions for puzzles/video topics.

MY BOOKS

If you purchase through these links, I may be compensated for purchases made on Amazon. As an Amazon Associate I earn from qualifying purchases. This does not affect the price you pay.

Book ratings are from January 2022.

(US and worldwide links)
https://mindyourdecisions.com/blog/my-books

Mind Your Decisions is a compilation of 5 books:

(1) The Joy of Game Theory: An Introduction to Strategic Thinking
(2) 40 Paradoxes in Logic, Probability, and Game Theory
(3) The Irrationality Illusion: How To Make Smart Decisions And Overcome Bias
(4) The Best Mental Math Tricks
(5) Multiply Numbers By Drawing Lines

The Joy of Game Theory shows how you can use math to out-think your competition. (rated 4.2/5 stars on 224 reviews)

40 Paradoxes in Logic, Probability, and Game Theory contains thought-provoking and counter-intuitive results. (rated 4.1/5 stars on 38 reviews)

The Irrationality Illusion: How To Make Smart Decisions And Overcome Bias is a handbook that explains the many ways we are biased about decision-making and offers techniques to make smart decisions. (rated 4/5 stars on 24 reviews)

The Best Mental Math Tricks teaches how you can look like a math genius by solving problems in your head (rated 4.2/5 stars on 76 reviews)

Multiply Numbers By Drawing Lines This book is a reference guide for my video that has over 1 million views on a geometric method to multiply numbers. (rated 4.3/5 stars on 30 reviews)

Mind Your Puzzles is a collection of the three "Math Puzzles" books, volumes 1, 2, and 3. The puzzles topics include the mathematical subjects including geometry, probability, logic, and game theory.

Math Puzzles Volume 1 features classic brain teasers and riddles with complete solutions for problems in counting, geometry, probability, and game theory. Volume 1 is rated 4.4/5 stars on 87 reviews.

Math Puzzles Volume 2 is a sequel book with more great problems. (rated 4.1/5 stars on 24 reviews)

Math Puzzles Volume 3 is the third in the series. (rated 4.2/5 stars on 22 reviews)

KINDLE UNLIMITED

Teachers and students around the world often email me about the books. Since education can have such a huge impact, I try to make the ebooks available as widely as possible at as low a price as possible.

Currently you can read most of my ebooks through Amazon's "Kindle Unlimited" program. Included in the subscription you will get access to millions of ebooks. You don't need a Kindle device: you can install the Kindle app on any smartphone/tablet/computer/etc. I have compiled links to programs in some countries below. Please check your local Amazon website for availability and program terms.

US, list of my books (US)
UK, list of my books (UK)
Canada, book results (CA)
Germany, list of my books (DE)
France, list of my books (FR)
India, list of my books (IN)
Australia, book results (AU)
Italy, list of my books (IT)
Spain, list of my books (ES)
Japan, list of my books (JP)
Brazil, book results (BR)
Mexico, book results (MX)

MERCHANDISE

Grab a mug, tshirt, and more at the official site for merchandise: Mind Your Decisions at Teespring.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK