It was common for the show to borrow plots from other famous movies. In this one not only do they borrow the "Kobayashi Maru" from Star Trek's The Wrath of Khan, but also the basic plot of Fatal Attraction.
This story is a little unusual in that the murder doesn't happen until about the half way mark.