← All 70 questions
Question 19·St John's College·2025·Standard first-round question — reachable by everyone, but the interview is about whether you flatten the solid or drown in 3D coordinates
Optimisation with a geometric constraint — reducing a 3D surface geodesic to a planar straight line by flattening
8–12 minutes at interview pace
Live video, shared whiteboard. Everything under BOARD is written with the pen; everything under SAY is spoken over it, at the same time. Never write a line in silence, and never say a line you have not put on the board.
An ant is at one vertex of a solid cube and wants to walk to the diagonally opposite vertex. If it can only walk on the surface of the cube, what is the shortest path?
Answer: 5 for a unit cube (i.e. s5 for side length s), attained by a straight segment across two adjacent faces, crossing their shared edge at its midpoint.

The whiteboard, beat by beat

1 · Orient · beat 1 of 9

Name the solid, the two points, and the constraint

free scale: unit cube [0,1]3
A=(0,0,0),B=(1,1,1)(space-diagonal pair)
constraint: surface path, no tunnelling
Goal: min⁡ length⁡(γ) over surface paths γ:A→B
What you say, out loud

Before I compute, let me say what the object is. Scale is irrelevant to a shortest-path question, so I will take the cube to be a unit cube sitting on nought to one in each direction.

The ant is at the origin and wants the vertex diagonally opposite in space, the point one, one, one. The whole difficulty is the constraint: it can only walk on the faces, so it may not use the straight line through the middle.

My goal is a genuine minimisation: shorten the curve among all paths that stay glued to the surface.

Why this beat exists: The interviewer is checking you notice the solid-vs-surface distinction and that you set a scale. Naming the constraint as the enemy is the whole orientation.
2 · Set up · beat 2 of 9

The move is dimensional reduction, not 3D algebra

flatten crossed faces⟹ straight segment
A∈{x=0,y=0,z=0},B∈{x=1,y=1,z=1}
2-face route: A-face + B-face
not parallel: 3×3−3=6 pairs
What you say, out loud

Here is the key idea, and it is the thing this question is really testing. On a single flat face the shortest route is obviously straight, and the surface only bends where faces meet at an edge. So if I cut along edges and lay the relevant faces flat, a candidate shortest path turns into a straight line in the plane.

So I do not want to write down a 3D arc-length integral. I want to flatten. That dimensional reduction is the move.

Now, which faces can the ant use? A lies on three faces, the ones where a coordinate is nought; B lies on the three where a coordinate is one. To get from A to B crossing just one edge, I pick one face from A's triple and one from B's triple, but the two have to actually share an edge. The only forbidden choice is the parallel pair. Three by three is nine, minus three parallel pairs, gives six candidate nets.

Why this beat exists: Flattening, then a clean count of candidate unfoldings. The interviewer is listening for 'unfold then draw a straight line', not brute-force 3D calculus.
3 · Draw · beat 3 of 9

Unfold two adjacent faces into a 2-by-1 rectangle

face z=0 (through A) + face x=1 (through B)
unfold about shared edge x=1,z=0
net: A=(0,0),B=(2,1)
L=22+12=5
crossing =(1,12), folds back to (1,12,0)
ABmidpointrun = 2rise = 1sqrt(2^2+1^2) = sqrt5face through Aface through Bdashed = shared edge, crossed at its midpoint
Laying the two adjacent faces flat gives a 2-by-1 rectangle. The ant's shortest route is its diagonal, sqrt5, and it crosses the shared edge at the midpoint — the one place the straight line stays legal when folded back up.
What you say, out loud

Let me draw one of the six nets concretely. I keep the bottom face, through A, fixed, and I swing the right-hand face up about the edge they share. Both are unit squares, so together they are a two by one rectangle.

In that rectangle A lands in the bottom-left corner and B lands in the top-right corner. The shortest path in the plane is the straight line, and its length is the hypotenuse of a two-by-one right triangle: root of four plus one, which is root five.

Note this: that straight line cuts the shared edge at its midpoint, at height one half. That is the fold-back point: it says on the real cube the ant goes in a straight line on the bottom, crosses the edge exactly in the middle, then goes straight on the side face.

Why this beat exists: The picture is doing the optimisation. Say explicitly that the crossing is the midpoint, because that is the non-trivial geometric fact.
4 · Compute · beat 4 of 9

Get the candidate length, then refuse to trust it yet

leg: run 1, rise 12
leg =12+(12)2=1.25≈1.118034
L=21.25=5≈2.236068
one net, one guess
true minimiser? right net?
What you say, out loud

So the candidate answer is root five, about two point two three six. To see it another way: the diagonal is split by the midpoint into two equal legs, each of run one and rise one half, so each is root one and a quarter, about one point one one eight, and twice that is root five.

But I do not want to accept one lucky drawing. Two things need checking: first, that among paths crossing this one edge the midpoint really is the shortest, and second, that no other unfolding beats it. So a numerical check, then a comparison.

Why this beat exists: Volunteering that the drawing is only a candidate, and saying what would falsify it, is the pass-to-strong-pass marker.
5 · Check numerically · beat 5 of 9

Sweep the crossing point and bracket the answer

crossing at height t, 3D length:
ℓ(t)=1+t2+(1−t)2+1.
 t00.250.50.751ℓ(t)2.4142142.280776𝟐.𝟐𝟑𝟔𝟎𝟔𝟖2.2807762.414214
min at t=12, matches net
bracket: 3≈1.732051 forbidden, edge =3
answer between: 3<5<3
What you say, out loud

Let me sweep the crossing point by hand instead of trusting the picture. If the ant crosses the shared edge at height t, the path is two straight segments: one of length root of one plus t squared, and the other of length root of one minus t, squared, plus one.

Now I read values: at t equals nought it is two point four one four; nudge to a quarter, two point two eight one; at exactly one half it drops to two point two three six, which is root five; then it climbs back up to two point four one four at t equals one. Symmetric, with a clean minimum in the middle, so the midpoint is genuinely the minimiser, not my drawing bias.

And a sanity bracket. The straight line through the solid is root three, about one point seven three two, but that is illegal because it goes through the interior, so it is only a lower bound. Walking the three edges costs exactly three, an upper bound. Root five is in between, which is where a legal surface path has to live.

Why this beat exists: The sweep proves the midpoint; the bracket proves the number is plausible. Both are cheap and both signal distrust of your own first answer.
6 · Justify · beat 6 of 9

Why two faces is globally optimal, and how many such paths there are

Compare families (unit cube):
 faceslength212+22=5≈2.2362, via vertex2+1≈2.414
min⁡=5,attained by 6 symmetric 2-face nets.
What you say, out loud

Now why is this the true answer rather than just a short path? Any shortest surface path is a geodesic, and a geodesic, once you unfold exactly the faces it crosses, is a straight segment. So the global minimum is the smallest net diagonal over every legal face sequence. I have reduced an infinite-dimensional problem to comparing finitely many rectangles.

Two-face nets give root five, two point two three six. There is no shorter candidate: unfold whatever faces the walk uses and the target lands on an image at least that far from the start, so root five is the minimum and the six nets above all tie. The visible competitor is the route that corners through a vertex of the solid, one face diagonal plus one edge, root two plus one, about two point four one four - strictly longer, and all six of those agree by symmetry. So two faces is optimal.

And because the two endpoints are space-diagonal opposites, there is nothing special about which coordinate is which, so all six two-face nets are congruent, and all six give the same root five.

Why this beat exists: Reducing to a finite comparison of nets is the rigorous core. Naming the count of shortest paths (six) is the flourish the interviewer waits for.
7 · Cross-check · beat 7 of 9

Fold it back into 3D and re-measure with segment vectors

A=(0,0,0)→P=(12,1,0)→B=(1,1,1)
AP→=(12,1,0),  ‖AP→‖=14+1=1.25
PB→=(12,0,1),  ‖PB→‖=14+1=1.25
L=21.25=5≈2.236068(agrees with the net)
ABedge midpointbase face then side face: two runs, one kink
The same route folded back onto the solid: two straight segments meeting at the midpoint of an edge. Measuring their 3D vectors independently returns root five, agreeing with the flat net.
What you say, out loud

Let me get the number a second, independent way, by folding the path back onto the solid and measuring with 3D vectors, never touching a net.

The path goes from A to the midpoint of the edge where the bottom face meets the vertical face through B, the point one half, one, nought, and then to B at the point one, one, one. The first segment vector is one half, one, nought, of length root of one quarter plus one, that is root one and a quarter. The second is one half, nought, one, the same root one and a quarter.

Two times root one and a quarter is root five, two point two three six. This matches the flat unfolding exactly, and it also confirms the route is legal: each segment lies flat in one face and they only meet on the shared edge.

Why this beat exists: Two independent routes to the same constant, one by planar unfolding and one by 3D segment vectors, is the strongest signal on the board.
8 · Conclude and generalise · beat 8 of 9

Answer, widen to a box, and find where the obvious net breaks

 Unit cube: Lmin⁡=5≈2.236 (side s: s5) 
Cuboid a×b×c: three distinct nets
Lmin⁡=min⁡{(a+b)2+c2, (a+c)2+b2, (b+c)2+a2}.
base a, height h: sides 4a2+h2 vs top (a+h)2+a2
tie at h=a; h<a top, h>a side
a=1,h=0.5: 1.8028<2.0616; a=1,h=1.5: 2.5<2.6926
What you say, out loud

So for the unit cube the shortest surface walk is root five, and for a cube of side s it is s root five.

The square root was never the point: for a rectangular box the same flattening gives three genuinely different nets, and the answer is the least of three quantities: a plus b, squared, plus c squared, all under one root; a plus c, squared, plus b squared, all under one root; and b plus c, squared, plus a squared, all under one root.

And the interesting part is where the obvious choice fails. Take a box with a square base a and height h. If you go around the side faces you get four a squared plus h squared under a root; if you cut over the top you get a plus h, squared, plus a squared, under a root. Those two are equal exactly when h equals a, that is, the cube. Make the box flat, height below a, and the over-the-top route is shorter; make it tall and the around-the-sides route wins. Numerically, at height nought point five the top route is one point eight zero three against the sides' two point zero six two; at height one point five it flips, sides two point five beating top two point six nine three. The cube sits precisely on the crossover.

Why this beat exists: Generalising to the box and then locating the failure boundary is the classic closing move; it also pre-empts the follow-up about rectangular boxes.
9 · Only if invited · beat 9 of 9

How many shortest paths, and a structural fact

6 geodesics, length 5; symmetries fixing AB
midpoint crossing, no face revisits
convex geodesic: no face twice
What you say, out loud

If you want the structure rather than the single number: there are six shortest paths, not one. They are the six two-face nets, all congruent, all root five, permuted by the rotations that hold the diagonal from A to B fixed.

Each one crosses a single edge at its exact midpoint, and no shortest path ever re-enters a face it has already used. That last fact is why the check reduces to finitely many nets: on a convex solid, a geodesic that revisited a face could be shortened, so it would not have been minimal to begin with.

I offer this as a bonus; the question only asked for the shortest length.

Why this beat exists: Going here unprompted reads as showing off; going when invited, and labelling it beyond the question, reads as depth with judgement.

Where the interviewer pushes next

“What if the ant is forced to walk only along edges?”
What you say, out loud

Then it becomes a graph shortest-path problem on the cube's twelve edges, and the answer changes completely. From A to the opposite vertex you must change all three coordinates, and each edge moves exactly one coordinate, so you need at least three edges. Three edges of unit length give exactly three.

So restricting the ant to edges inflates the path from root five, about two point two three six, up to three. That is precisely because the diagonal across faces is the saving the surface gives you.

edge-only: d(A,B)=3⋅1=3>5≈2.236
“A box of size 3 by 3 by 1 — which net is shortest?”
What you say, out loud

Let me not eyeball it, let me use the formula. The three nets are root of the quantity 3 plus 3, squared, plus 1 squared, which is root 37, about six point zero eight three, and two copies of root of the quantity 3 plus 1, squared, plus 3 squared, which is root 25, exactly five.

So the shortest is five, not six point zero eight. The 'obvious' route that wraps around the two big faces is the longest one. For a flat box you want to cross the short dimension on the way, which is the failure case I flagged when generalising.

min⁡{37, 25, 25}=5<37≈6.083
“How do you know the unfolded straight line is still legal after folding back?”
What you say, out loud

Because the only thing that could make it illegal is if it left the two faces, but a straight segment inside the net rectangle stays inside, and the net is exactly those two faces. Where the segment crosses the shared edge, folding maps the two half-segments onto the two real faces meeting along that edge.

The fold preserves length on each face because it is a rigid rotation, and the two images agree at the crossing point since it lies on the seam. So the folded path is continuous, lies on the surface, and has the same length, root five.

fold rigid, length-preserving
“Could a curved path, not made of straight pieces, be shorter?”
What you say, out loud

No. Restricted to any single face, the face is flat, so the shortest connection between the two points where the path enters and leaves that face is the straight segment, and any curve there is longer. A shortest path has to be piecewise straight, and it bends only at edges.

That is why I only ever compare straight segments in nets: I am not assuming the answer is straight, I am proving each piece of a minimal path must be straight.

flat face: geodesic is straight
⇒ piecewise-linear, bends at edges

Traps on this question

  • Reporting the space diagonal root three. It passes through the interior, which the ant cannot use; root three is only a lower bound, never a surface path.
  • Assuming the shortest walk runs along edges. It gives three, but the geodesic cuts straight across two faces and is shorter at root five.
  • Unfolding the wrong pair of faces: the two chosen faces must share an edge. Picking a parallel pair, such as x equals nought and x equals one, produces a straight line that is not on the surface at all.
  • Drawing one net and stopping. For a cube all six two-face nets happen to tie, but you must still say so, and for a general box the nets differ, so you have to compare all three and take the minimum.
  • For a flat or tall box, choosing the visually obvious 'wrap around the big faces' net. For a 3 by 3 by 1 box that net is the longest option; the shortest cuts over the small face.

What gets written on the assessor’s form

  • Named the interior straight line as forbidden and treated it as a lower bound, not an answer.
  • Reduced the 3D problem by flattening to a net and read the shortest route as a straight segment.
  • Did not trust one drawing: swept the crossing point to prove the midpoint, then bracketed the value between root three and three.
  • Justified global optimality by comparing all face-sequence nets and stated the count of shortest paths.
  • Cross-checked with independent 3D segment vectors, then generalised to a box and located where the obvious net fails.