Question: Were people able to "lock" the Holodeck doors so that others couldn't just walk in on them? I don't recall an episode where the doors were locked that wasn't because of some malfunction. It seems like Lieutenant Barclay, for example, would either lock the doors during his "fantasies" or have some "fail-safe" that shuts the program off when being walked in on. Otherwise, it's just a really dumb thing to do (for him or anyone playing out a fantasy) knowing they could easily be caught.
The New M.A.V.O. Member - S1-E10
Question: When Teddy and his friends shrink down to get the crystals back they know that five crystals are real and one is a fake salt crystal. How did they know which ones were real and which one was fake?
Answer: Yes but MAVO had five real crystals and one fake one, and they all looked the same. There was no way of knowing which ones were real and which one was fake.
Answer: Grubby licked them and could taste the salt.
Answer: The only guess would be that the real crystals and the fake salt crystal look different somehow. They made the fake salt crystal, so they should know what it looks like compared to a real crystal. Also, they could have very easily done something to the fake crystal that was stolen from them so that they could tell it apart from the others.
Question: Is MACC inspired or copied from Johnny 5 from Short Circuit?
Answer: Although the series creators have never confirmed this, it seems fairly obvious that MACC is inspired by Johnny 5.
Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.