The 'locked room' mystery is one of the most intriguing sub-genres of crime writing. These books depict a crime committed in what appears to be an entirely impossible situation such as a locked room where the killer has seemingly vanished into thin air.
The concept of a behind-closed-doors mystery has been a plot device since the heyday of Ancient Greece but it was not established as a sub-genre of crime fiction until the 19th century. One of the earliest examples is Edgar Allan Poe’s The Murders in the Rue Morgue where a woman and her daughter are murdered by someone speaking an unintelligible foreign language within an inaccessible room, which has been locked from the inside and is located on the fourth floor of a building. Several other authors (Joseph Conrad, Sheridan Le Fanu and Wilkie Collins) also made early attempts at this style of mystery.
The real kick-starter for the genre came in 1892 when Israel Zangwill used the same locked room puzzle concept for his primary plot device in The Big Bow Mystery. However, he added another classic mystery writing element, the red herring. In Zangwill’s story, a union agitator is found with his throat cut in his apartment which contains no windows, a door locked from the inside and no murder weapon (eliminating a suicide). But unlike Poe’s example, where the detectives end up catching their man, it is discovered that a small detail was overlooked by everyone except one clever detective. This story created the template for what became a well loved crime fiction sub-genre.
John Dickson Carr, who also wrote as Carter Dickson, is probably the king of the locked room mysteries and The Hollow Man is the Dickson Carr book to read to encounter the best example. Also look up The Mystery of the Yellow Room by Gaston Leroux.