Like all of the Sherlock Holmes stories, "A Scandal in Bohemia" belongs to the genre of detective fiction. This is a genre that comes with many concrete expectations. When picking up a work of detective fiction, a reader typically expects a crime or mystery of some kind, a character that serves as an investigator either formally or informally, false suspects (or false suspected explanations), a plot twist, and finally a resolution.
Other likely motifs and devices could include disguises, red herrings, a sidekick character, and a previous failure on the part of other investigators or a police force at solving the crime. As an early work belonging to the genre, this and other Sherlock Holmes stories helped shape the expectations that a reader enters a detective story with. Nevertheless, although Doyle's writing introduced devices that have since become conventions in the genre, Doyle was not the first writer of detective fiction and Holmes is not the original fictional detective.
While the story certainly delivers on several of the expectations that come with the genre, it also defies them on a certain level. There is no question that Holmes is the investigator, and he makes ample use of disguises. Nor is there any question that the story ends with a plot twist: Holmes and Watson believe they trick the innocent Irene Adler, but she ultimately unearths their scheme and tricks them in return. However, in this story, Holmes's investigation is aimed neither at solving a crime nor at unveiling a mystery. Rather, the King of Bohemia hires him to retrieve a photograph. As a result, the story's princpial mystery is the location of this photograph and, by extension, Irene Adler's way of thinking.
Doyle's subversion of the genre becomes especially clear in the plot twist that comes at the end. Rather unexpectedly, Holmes does not succeed in his aims. Despite his brilliance, he fails at retrieving the original photograph and at understanding Irene Adler's mind before she has understood his. Thus, the story lacks both a real crime or mystery and a proper resolution. These divergences from the genre's conventions suggest that Doyle is more interested in revealing Holmes's process of working than setting up each story as a perfect detective narrative.
The length and form of the story are also important elements of its genre. Doyle wrote both novels and short stories about Sherlock Holmes. "A Scandal in Bohemia" is Doyle's third story overall but his first short story featuring Holmes. Two novels, A Study in Scarlet and The Sign of the Four precede it. He went on to produce over 50 more short stories following Holmes's crime-solving and mystery-unveiling adventures.