Shakespeare may have invented the knock-knock joke. In Macbeth, a porter twice asked "knock, knock! Who's there?" in a manner very similar to the joke, which possibly sprouted off of that scene. The running joke may also have originated in medieval castles, where bored guards would goof around with people on the other side of the door. In any case, usage for such humor has shown to increase over time. The word knock can be traced to the Middle English word knokken, from the Old English word cnocian, or "to pound", which is of an onomatopoeic origin, unsurprisingly (though I dare you to knock your knuckles on anything and ask yourself if it really sounds like cnocian). Knock took on several sexual senses such as knocked up, knockers, and knockout because in the sixteenth century, knock took on a vulgar double definition as a euphemism for sex; it's easy to see why. This mostly faded out but its descendants remained. The silent k in knock is characteristic of Germanic words: it used to be pronounced KUH-nock, but that changed when people decided that that version was harder to pronounce than if the syllable was dropped altogether.
Adam Aleksic, a freshman studying linguistics at Harvard University, has been described as the internet's sixth most famous etymologist. He has disturbing interests in words, vexillology, geography, board games, limericks, and law, and he loves writing about himself in the third person.
The Etymology Nerd