As some students know, sometimes it is not easy to determine whether a professor (restricted to the professors in U.S.) will write a strong letter of recommendation for a student. So the question is, is it appropriate to ask questions like:
What do you think of me compared to other students you taught in the previous semester?
Am I one of the best students in your class? Top 10%? Top20%?
I know these questions are sensitive. Maybe they will dislike me immediately once I ask these questions. I don't know, but I believe that most professors are kind and will be honest to students.
By the way, if I were the professor, I would certainly answer the questions honestly and let the student know if I should be in the their choices. I would not only say something like "you did well in my classes" or "you did better than most of the rest", but also tell them directly if they are in top 1%, 3%, 10% in my mind, but I still wonder what most professors in U.S. universities would think of this.
Closely related to my answer to your linked question:
I don't think it's either necessary or particularly productive to try to interrogate a professor and determine what letter they will write. Simply tell the professor you're thinking of applying to Ph.D. programs and ask them something like:
Do you think that you would be able to write a strong letter of recommendation for me?
The "strong" is important here, because that's what will get you the honest opinion of whether the professor thinks well of you or not, and you don't want letters that are not strong.
If you try to ask the question indirectly, by asking things like "Am I in the top 10%?" then you are dancing around the question. You know you're asking for a strong recommendation, and so does the professor, so you might as well just ask.
Only the most nasty and deceptive of professors will answer dishonestly---and they probably wouldn't have given you an honest answer to your other questions either.