A pyramid has a square base of side length $6$ and height $6$. A cube is placed inside the pyramid with one face on the base and the opposite face having all its edges on the lateral faces of the pyramid. What is the volume of the cube?
At height $s$ above the base, the horizontal cross-section of the pyramid is a square with side $6\left(1-\frac s6\right)=6-s$, by similar triangles.
The top face of the cube, at height $s$ (the cube's edge), has its edges on the lateral faces exactly when it equals this cross-section: $s=6-s$, so $s=3$.