What does hitTest do?
The gist
hitTest(_:with:) answers the question "which view should receive a touch at this point". UIKit calls it on the UIWindow, and the method recurses down the tree: for each view point(inside:with:) is checked, then its subviews are visited in reverse order (the last one added — the topmost on screen — is checked first). The deepest view containing the point is returned; it becomes the first responder for the touch.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep