This is an extremely broad question, I will limit my response to Ch'an/Zen Buddhism.
Starting in the earliest schools of Ch'an in Sung China, we find the practice of a stimulus/response ritual the Japanese call sassho. It usually (but not necessarily) takes the form of a question-answer dialog between master and student and is used to both invoke and verify insight/realization. Some of these dialogs have become (in)famous and were compiled into Kung'An/Koan collections still used today.
The basic philosophy behind sassho is to verify whether the answer to a teacher's question is free-flowing or (pre)conceived. In the latter case, the answer would be rejected and the student would be requested to meditate further on the question.