3 ms·
Yeah, unfortunately you get asked to do some pretty silly stuff all the time and being able to cope with that is a critical skill.
by swiley 5y ago
Yeah, unfortunately you get asked to do some pretty silly stuff all the time and being able to cope with that is a critical skill.
- tharkun__ 5y agoActually I find this a fun thought experiment that can show if you are just a code monkey or a software developer. Let's say the answer is that it's still supposed to fly (working software you are adding a feature to), so also no stuffing ping pong balls into wings and such. Ignore fire hazards and such (no edge cases for now, build an MVP). Now a plane fuselage is basically a cylinder. At one end I assume full size but there's suddenly a wall where the cockpit and such is. The other end is more "fun" because the cylinder becomes more narrow. In any case now we are probably gonna have to find a 3D bin packing algorithm for packing spheres into a cylinder, potentially its already implemented or we might need to implement it from some research paper we find but in any case it is probably a solved problem (reinvent the wheel in-house or use a library and be done with it? Is the library good enough? Is it supported or some dude in a basement wrote and abandoned it?). Just like in physics where we ignore some forces sometimes for easier calculations for example we can probably cut the narrowing cylinder into sections of one ping ponf ball width and assume constant diameter for those. The difference this make in the end either doesn't matter (80/20 rule of software development, don't gold plate it, make it good enough) or we assume that any extra balls we "miscalculated" can fit into the nooks and crannies we have ignored anyway because a plane fuselage is not a perfectly smooth tube anyway. Never mind the landing gear and such.
- rdtwo 5y agoActually the Anwser is simple to solve at least estimate fairly accurately if you assume the Airplane has to fly. You just need to know the model and how many pallets fit into the cargo. The pallets are square with known volumes you pack them at the packing factor for spheres and you are done. There is some bulk cargo area but it’s not big so you need to account for that and That’s about it. You can ignore mass unless the problem lets you smash then then you are just packing plastic blocks into a container and you have to double check you aren’t limited by cargo capacity and range. A more interesting problem would be to suppose you needed to float a 747 that crashed and sank in tact. How would you go about calculating the right number of ping pong balls to do that.
- tharkun__ 5y agoSquare pallets sounds awesomely easy indeed. I didn't know that existed. I've only seen the ones that are wider on the top vs. the bottom. Like this one https://www.dsm.com/content/dam/dsm/dyneema/en_GB/images/applications/v2/air-cargo-containers/container_header-img.jpeg https://www.dsm.com/content/dam/dsm/dyneema/en_GB/images/app... Those look like they'd be easier to deal with too though. And in any case a great discussion in the interview can ensue regardless. Which is the point. Interesting second problem too. So you have a regular 747 you say, which I suppose has a mass I can look up somewhere, we have statistics probably about how much cargo and passenger baggage usually weigh (or maybe these are even available for the specific flight?) and passengers hopefully made it out alive since you said the aircraft was intact and didn't burst into pieces. Now would come the part of just looking stuff up that I don't know but know is known to man already so you better look it up instead of reinventing it all. Apparently from a quick google I would probably want to know how much the plane's buoyancy already works for us (it definitely sank so there's that, but did it barely sink or did it sink like a stone?) and see how much a ping pong ball wants to float. My guess is that the ping pong balls are so buoyant that we can even ignore their small plastic shell and calculate it as if the plane was directly attached to the needed volume of air to make it float.