Can you solve the "Hanging Cable" problem, used as an Amazon interview question?

I can solve it for 10m because it’s a trick (and an obvious one at that). I can see what the problem is for 20m, but I never even learned the equation for the catenary curve, and if I had I’d have forgotten it by now.

The 10m question works as the classic gotcha question on an interview. The 20m one works for… civil engineers? Applied math people? Weird.

5 Likes

That’s the standard answer for these sorts of questions, that only seem to be of interest to tech organizations ever since the infamous ‘Why are manhole covers round’ question came out of Microsoft*.

I’ve answered them myself, I’ve asked them myself. They can be fun. But I’m not convinced they add as much value as people seem to think.

*Coding interview - Wikipedia

… The practice of asking these sorts of so-called lateral thinking questions was later formally discouraged at Microsoft.

From the talk page at above:

I quit Microsoft in 2007 and well before that time the practice of asking many of these types of questions were formally discouraged by HR. Some specifics: don’t ask the manhole cover question. Everybody is familiar with the question, you don’t get useful responses, and nothing a candidate says in response will give practical information data their ability to design, implement, or test software. Stop asking “ah ha” questions (e.g. three light bulbs, three switches, closed room). Candidates can easily either get lucky or get screwed by these questions. In hindsight, it’s pretty clear that these questions, though fun for the personality type who will probably be a good candidate, is objectively bad and doesn’t help filter in/out solid hires. I haven’t stayed in touch with old colleagues about the hiring practices but unless something changed to bring these back (which is possible but would be super surprising), these questions should be considered cultural history, but have been out of the hiring process for at least a decade. — Preceding unsigned comment added by Slipperyp (talkcontribs) 04:45, 25 June 2018 (UTC)

5 Likes

Maybe they just want to see if you know the difference.

1 Like

I took enough math that I can think out how to find the length of an arc and I can understand the pages I found that derive the arc length of the catenary function, but I never encountered the catenary function.

Oh, and I can’t do hyperbolic trig functions in my head during an interview.

It’s totally bizarre unless it’s an interview for a bridge/arch designer.

4 Likes

Very, very true. Hiring is an art that takes practice and skill. Most managers suck at hiring because the whole process is awash in terrible practices such as these. Bad hires happen all the time and there’s no reliable predictor for success or failure at any organization.

Having been on both sides of the hiring table many times I have learned to mostly go with my gut reaction and feedback from the team and if we make a mistake hiring someone who doesn’t mesh well and can’t be trained, we move on. It’s more about cultural fit and aptitude now rather than any particular skill or training. Can’t afford to drag one’s feet looking for the “perfect” candidate because they don’t exist.

(Come to think of it, I too got the manhole question interviewing for MS back in the NT4.0 days. Must have done alright cause I got the offer but didn’t want to move to Redmond).

3 Likes

I just finished an Edison bio. It talks about who he was the one who pioneered this whole “riddle me this” approach to interviewing a hundred years ago after he fired most of his staff during an economic downturn.

He was almost universally criticized for it and his new staff was really no better than the old one.

Funny how “we” keep doing the same stupid stuff

4 Likes

For the use case as demonstrated here, I think there’s applicability to software engineering.
You need to be able to build test harnesses that capture these corner cases.

You could write software to figure out a caternary curve- what would you do when a user inputs 2 100’ poles, 1 80’ cable, and the middle of the cable is 0 feet off the ground?

That’s garbage collection.
What’s the inflection point where you could have a cable and distance off the ground that would actually work beyond poles? Figure that one out.
Then FINALLY, you can run it through your calculateCaternaryArea.fn without bombing.

All good cases, and all which can be approached in a less intellectually masturbatory manner as interview questions.

2 Likes

Ahem…suspension bridge DIGITAL division.

2 Likes

If it’s 10m the distance is zero. Otherwise it’s one of those hyperbolic trig functions. Cosh, or maybe sinh. So the arc length integral, which is something like int(sqrt(1+dy/dx)) over a,b = 80, set a = 0, find b.

1 Like

I’d go with “I ain’t got time for this because I’m already behind on fulfillment shipments”

3 Likes

I usually counter with “is this representative of a real problem I would face in this position? My solution would be look up the formula, as my intuition tells me there’s some specific math behind this. I’m not a structural engineer. Unless we’re going to look at pull requests or code, I think we’re done here.”

Interviews are two-way. If BS riddles are how we screen candidates, then I’m not interested. I’ve stopped a couple of interviews for this sort of thing.

7 Likes

I imagine it’s a bit like original sin at this point, you’re born behind on fulfillment shipments.

3 Likes

Have you tried being best?

2 Likes

I think the point here is to recognize that there is a calulation for a caternary curve, and it’s unfair to assume that you’d know it off the top of your head.

As soon as you just gamely dry run a right angle triangle to approximate the distances involved, you can easily get:

If the cable is 50M off the ground, the towers would be 80M apart.
If the cable is 10M off the ground, the towers are 0M apart

Oh, wait…

So the test isn’t knowing how awesome you are at math. It’s knowing if you’ll gamely approach a problem you’ve never seen before, and at least give it a rudimentary set of checks before calling it a complete bullshit impossibility.

2 Likes

Oh sure, I get that it’s a problem-solve exercise, but I also hope to hire for (and be hired for) situations that you do have a toehold on. Knowing that you can solve brainteasers: sure, great, nice hobby. I’ve not seen that somehow prove that someone is a good software engineer (my field.) Let’s talk code.

1 Like

From the question:

What is the distance between the two poles (to one decimal point)

If they meant to just see how we approached problem solving, they shouldn’t specify a degree of accuracy.

To me it’s a dumb question unless they actually want to test if I can do that calculation.

6 Likes

9 Likes

1 Like