By the rules, it strictly fills a fifteen foot cube. If you're not in the fifteen foot cube of its effect, you're not affected.
That said, the Dungeon Master is welcome to rule in favor of a more simulationist style, and players are free to request it if they would like it.
The full rules for this are as follows:
Area of Effect
[...] Every area of effect has a point of origin, a location from which the spell’s energy erupts.
The rules for each shape specify how you position its point of origin. Typically, a point of origin is a point in space, but some spells have an area whose origin is a creature or an object.
A spell’s effect expands in straight lines from the point of origin. If no unblocked straight line extends from the point of origin to a location within the area of effect, that location isn’t included in the spell’s area. To block one of these imaginary lines, an obstruction must provide total cover, as explained in chapter 9.
Cube
You select a cube’s point of origin, which lies anywhere on a face of the cubic effect. The cube’s size is expressed as the length of each side.
A cube’s point of origin is not included in the cube’s
area of effect, unless you decide otherwise.
So: You draw the cube in space, you set the point of origin, and then any creature that's inside the cube and has an unblocked line between them and the point of origin is hit by the spell. That precludes most of the scenarios outlined in your question (e.g. a creature at the end of a 75' corridor is well outside of the boundaries of the cube, even if there is an unbroken line to them).