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.
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.
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.