Well, firstly, if you're not outright given a chance to talk to a personal trainer before you start working with them, you should assertively insist upon being allowed to do so. You're absolutely within your rights to know who you're working with. Before I settled on my current gym, I went to multiple gyms and my interviews of the nutritionists and trainers there were extremely thinly veiled. I never once had one of them look at me cross-eyed for my questions. Sometimes it can be difficult to get the time to ask your questions, since some gyms have their staff very busy, but if you can get the time there isn't a soul who will find qualifying questions odd.
As far as what to ask, the best thing you can ask is 'What's the plan for getting me to my goals?' This puts the trainer's deeper understanding of a program on the spot. If they give you a reply that focuses on specific muscle groups, specific exercises, or specific numbers, you can be assured that their knowledge is pretty shallow and you probably don't want to work with them. Real trainers know that the numbers follow the program, not the other way around.
A good sign in answers to this question is the trainer talking about specific sub-goals to get you to your final goal. If your goal is to put on 15 pounds of muscle, you might hear that the first step is flexibility training, the second step is toning what you already have, and then the third step is full-on strength training to increase muscle size. Another good sign is to hear these sub-goals, and then hear an acknowledgment of a cycle of changing sub-goals. The body is very much interconnected, so you cannot simply do one thing all the time - this will cause other health problems. I met a bodybuilder at a local chiropractor's office who literally tore a ligament in his shoulder because his bicep was too big and heavy for it. That's a very extreme result of constant strength training without changing goals, but it can happen and a personal trainer needs to be aware of that.
Edit: Another good question to ask is to inquire how many other people they're currently training, and how many people have similar goals to you. If a trainer is seeing 15 people that all want to train for athletic competitions and you're the only one who is interested in good, old-fashioned health, it's not a good fit simply because of the trainer's current focus.