It’s not an entire show, but your opening sentence perfectly describes the premise of one episode of the original The Twilight Zone, “Five Characters In Search Of An Exit” (S3.E14, for anyone who wants to look it up). The synopsis from IMDB:
An Army major awakens in a small room with no idea of who he is or how he got there. He finds four other people in the same room, and they all begin to question how they each arrived there, and more importantly, how to escape.
The mounting tension and mystery of this short story made a lasting impression on a very young me that remained long after I’d forgotten how the episode ends, with its inevitable TZ twist.
Years ago I bought the entire show-run on DVD. I remembered only scattered images and the leftover feeling of unease from this episode, little more than is outlined in the synopsis above, and as I had forgotten its overall story, I was looking forward to seeing it as if anew. I didn’t even know the name of the episode, and avoided looking up any information beforehand – even so much as where it occurred in the order of episodes – so that as I made my way through the show’s 5-year run I could come upon it unsuspecting, to savour its re-discovery spoiler-free.
A-fucking-men.