The "locked-room" or "impossible crime" mystery is a type of crime seen in detective fiction. The crime in question, typically murder, is committed in circumstances under which it appeares impossible for the perpetrator to enter the crime scene, commit the crime, and leave undetected. A locked-room crime typically involves a situation whereby an intruder entered the crime scene. For instance, a murder victim might be found in a windowless room locked from the inside. Following the conventions of classic detective fiction, the reader is normally presented with the puzzle and all of the clues, and is encouraged to solve the mystery before the solution is revealed in a dramatic climax.
The earliest fully-fledged example of this type of story is Edgar Allan Poe's "The Murders in the Rue Morgue" (1841). The most famous locked-room mystery is probably John Dickson Carr's 1935 novel "The Hollow Man". A variant of the locked-room type puzzle is also Agatha Christie's "And Then There Were None".
More on Wikipedia