Knock-knock jokes are a format in which the joke teller sets up with "knock knock," and he and another person follow a back-and-forth script that ends in humorous wordplay. Knock-knock jokes are a variation of Who's There jokes ending in wordplay from the early 1900s.
One of the first knock-knock jokes ever published is: "Knock! Knock!" "Who's there?" "Al!" "Al, who?" "Al be seeing you in Detroit." The joke appeared in the Altoona Tribune in 1936 and was pointed at New Deal Democrats.
The format's simplicity was criticized soon after knock-knock jokes began to be published, and today they are so common as to be considered ubiquitous, according to NPR. The pun-based humor was originally thought to be a passing craze and more recently is simply criticized for being half-witted.