Clerks.

Dante Hicks, a 22-year-old retail clerk at the Quick Stop convenience store in Leonardo, New Jersey, is called into work on his day off by his boss to cover a few hours for another employee who is sick. Arriving at the store, he finds that the locks to the security shutters are jammed closed with chewing gum, so he hangs a sheet over them with a message written in shoe polish: "I ASSURE YOU; WE'RE OPEN."
Dante's day is spent in the purgatory of serving a succession of customers while repeating the fact that he is "not even supposed to be here today". Stressed with the demands of his job, Dante passes time in wide-ranging conversations with his best friend, Randal Graves. Randal is an irresponsible slacker who works in the next-door video store, RST Video, although he spends most of the entire day at the Quick Stop. They converse about many things to pass time, such as whether or not the contractors working on the second Death Star when it was destroyed at the end of Return of the Jedi were innocent victims. Other events of the day include the discovery that Dante's high school girlfriend, Caitlin Bree, whom he has been having early morning phone conversations with, is engaged to be married. Dante's current girlfriend, Veronica Loughran, also stops in to bring him homemade lasagne. The two talk about Dante's stuck-in-a-rut lifestyle with no motivation to change before having an argument about her past sexual partners.
Learning that he is stuck working the store all day, as his boss went to Vermont, Dante convinces his friends to play hockey on the store roof, though the game is short; twelve minutes in, an enraged customer shoots their only ball off the roof and into a sewer. Reopening the store, Dante finds another of his ex-girlfriends has died and her wake is today. Randal talks him into closing the store again and going to the wake. The visit is catastrophic, with Randal and Dante running out to escape in their car. What happened in the wake is not shown, but a subsequent conversation between the two reveals that Randal accidentally knocked over the casket by leaning on it.
That night, Caitlin surprises Dante with a visit. After she assures Dante that the engagement announcement was premature and arranged by her mother, the two trade banter and Dante becomes torn between her and Veronica. He finally decides to take Caitlin on a date and goes home to change. He returns to discover that Caitlin had sex with a dead man in the unlit bathroom, having mistaken the man for Dante (the man had earlier entered the bathroom with a pornographic magazine and had suffered a fatal heart attack while masturbating). An ambulance takes a catatonic Caitlin away along with the man's body.
Jay and Silent Bob, a pair of slackers who have spent all day loitering (and dealing marijuana) outside RST Video, enter the Quick Stop to shoplift. Dante turns down Jay's offer to party with them. Aware of Dante's problem, Silent Bob pauses before following Jay outside and offers the following wisdom: "You know, there's a million fine-looking women in the world, dude. But they don't all bring you lasagna at work. Most of 'em just cheat on you." Dante then realizes that he loves Veronica. When she returns to the Quick Stop, however, Randal complicates things by revealing that Dante asked Caitlin out. Veronica angrily breaks up with Dante, telling him that Randal informed her of the planned date with Caitlin.
When Randal enters the Quick Stop after closing RST, Dante attacks him and the two fight. Afterwards, they lie on the floor exhausted. Dante claims that Randal does nothing for him but make his life miserable by getting him fined, offending his customers, and ruining his relationship. For the first time, Randal loses his temper and verbally explodes, saying that Dante deserves the blame: Dante, not Randal, closed the store to play hockey, closed it again to go to the wake, and closed it yet again to try to hook up with his ex-girlfriend, cheating on his current one in the process. He then says that Dante came to work of his own free will and "overcompensates for having a monkey's job". He claims Dante thinks he is more advanced than the customers and storms off with "if we're so fucking advanced, what are we doing working here?" leaving Dante speechless on the floor.
They reconcile and Dante says he will try to talk to Veronica, visit Caitlin, and possibly get some direction in his life. The film ends with Randal walking out of the store, popping back in briefly to toss Dante's sign at him stating, "You're closed!"[1]

Question: Who did Caitlin have sex with?
Answer: A dead man