“Someone walked in on me while I was in the bathroom.”
You were using the bathroom at a restaurant, and forgot to lock the door. Someone opened the door while you were using the toilet. Now you're telling your friend what happened.
Someone walked in on me while I was in the bathroom.
To "walk in on" someone means that you come into the room when they are doing something private that you're not supposed to see. You can "walk in on" someone when they are:
- using the bathroom
- having sex
- changing clothes
- wrapping your birthday present
Use "while" to join two things that happen at the same time. The first thing can be a continuing action or a momentary action, but the second thing has to be continuing:
She did her homework while I made dinner. ("did her homework" is continuing)
He fell asleep while he was driving, and ended up in the hospital. ("fell asleep" is momentary)
Americans use the word "bathroom" to talk about the room where toilets are.
He's in the bathroom.
A more polite word for Americans is "restroom":
Excuse me, where's your restroom?
Canadians say "washroom". British people call it "the loo", I think... I don't know what Australian people call it, but they probably have a different name for it as well. But if you're in the U.S., use "bathroom".