Star Trek: 10 Best Holodeck Episodes
5. Deep Space Nine: Our Man Bashir
Julian Bashir was absolutely fascinated with the idea of being a spy. This is part of the reason he was so quick to befriend Elim Garak, the only Cardassian living on Deep Space Nine. Garak claimed to be a simple tailor but station rumors were that he was a former member of the Obsidian Order, the feared and secretive Cardassian intelligence department. Naturally, it was eventually confirmed to be true.
Bashir was trying to relax in a holosuite program where he played a secret agent in the 1960s. The tone of the program was comparable to the early James Bond movies with Sean Connery. Garak busted in, and convinced Bashir to begrudgingly let him tag along. Unfortunately for Bashir, Garak spent much of the story criticizing it as unrealistic. Spies don't act that way.
At the same time, several member of the senior staff were caught in an incident on a sabotaged ship that required an emergency escape via the transporter, which was also damaged. Their physical patterns ate up up most of the station's memory, causing them to be placed in Bashir's program and taking over various in game characters.
The twist was that if the characters die or the program shuts down, Bashir and Garak's friends would also die. They are forced to play through the story with more restraint until the rest of the crew are safe and they can get out. This episode is amazing simply to watch Avery Brooks play the part of an old school Bond villain, a role he excelled at.