In the Star Trek universe, The Kobayashi Maru is the name of a Starfleet Academy test that all cadets must take in order to graduate. The test is designed to be a no-win situation, so that students' behavior under pressure can be observed. From these evaluations, cadets are put onto tracks that ultimately decide what their careers within Starfleet will be.
The test itself is a battle scenario. The cadets are stationed on a training starship that receives a distress call from an unarmed ship named "Kobayashi Maru." It is under attack by enemy forces and has no way to fight back. The signal is coming from inside the Klingon Neutral Zone, where, by treaty, Federation ships are not allowed to go. However, Federation ships are also required to answer any distress signal they encounter, Federation craft or no. The cadets plot a course to rescue the Kobayashi Maru.
Once the training ship reaches the given co-ordinates of the Kobayashi Maru, no disabled ship is found, only small pieces of wreckage. Several Klingon vessels decloak and attack the training ship. It's a trap. The cadets are outgunned and outclassed, in almost every way possible. As the attack continues, systems fail, the hull is breached, and cadets "die." The rescue ship cannot retreat and must face complete annihilation.
The simulation ends when the cadets' ship is destroyed. No one is really dead, though minor injuries (things like sprains, broken bones, burns, and small lacerations, abrasions and hematomas) often occur.
It is notable that in the history of Starfleet Academy, there is only one person who ever beat the Kobayashi Maru simulation. James T. Kirk hacked into the Academy's computer systems and reprogrammed the simulation to allow him to win. As a result, he was given a commendation for original thinking and kicked up into officer training.
In and around the Star Trek universe, and among its fans, the phrase "Kobayashi Maru" has come to refer to any no-win situation.
The information about Kirk's encounter with the simulation was culled from http://www.startrek.com on the Kirk biography page. "James T. Kirk" is a trademark of Paramount Pictures, as is "Kobayashi Maru".