JD's fantasy sequence with his son and the espresso machine is a spoof of similar anti-drug PSA's that ran on television in the 80's.
When the Janitor and Troy are trying to figure out the riddle, the Janitor says he went to Yale. When trying to figure out the same riddle in "Scrubs" (2001) {My Lucky Night (#3.4)}, he says he went to Harvard.
This episode contains numerous references, gags, and plot points featured in prior episodes, in some cases recreated word-for-word.
The first 8 seasons were filmed in North Hollywood Medical Center, a decommissioned hospital.
In the scene with "floating head doctor", when JD and Dr.Cox are first seen walking and talking together, you can see the silhouette of a second body on the left hand side.