Bridge Officer's Test
From Memory Alpha, the free Star Trek reference
The Starfleet bridge officer examination was a series of tests for Starfleet officers who wished to be able to take command, besides the command officers such as captain, first officer, and second officer. The test had many stages, but the final exam required the officer to make a choice that sent one person under their direct command to certain death. No one who failed the test could serve as a command officer on the bridge of a starship except in emergency situations.
In 2370, after attending her Starfleet Academy reunion, Deanna Troi felt she was one of the few classmates who had not risen to command level status. This combined with the bitter memory of how badly she acted under pressure two years earlier when the Enterprise hit a quantum filament, led her to talk to Commander Beverly Crusher. Crusher, who on occasion took the night watch of the bridge to stay informed of operations and tactical procedures, told her that she took the exam in 2362 when she wanted to contribute more than just in sickbay. (TNG: "Disaster", "Thine Own Self")
This led Deanna to try the test, which Commander Riker administered. The final portion of the test, which also included a question and answer portion, was to make decisions in a holodeck simulation. In it, the officer was required to order an officer to sacrifice themselves to save the ship. She had failed the final exam several times before realizing that its purpose was to ascertain whether or not she would be able to send a subordinate, especially a personal friend, to certain death. Afterward she passed the exam, and was promoted to commander. (TNG: "Thine Own Self")
