买杯子的那个是谁?
In this sentence, we basically see two structures:
- The “是” Sentence
- Modifier+的+Noun
1) The “是” Sentence
In this case, the verb 是 ties two things, indicating that they are identical or that the second explains or states the case of the first. The structure works the same way even if we have the interrogative word "谁".
A是B
A: 买杯子的那个(人)
B: 谁
Both forms "A是B" and "B是A" are correct (their meanings sometimes are slightly different).
买杯子的那个(人)是谁?
谁是买杯子的那个(人)?
2) Modifier+的+Noun
A modifier (i.e. any word, phrase, or clause, except conjunctions, grammatical particles, interjections, and exclamations) is used in this structure to qualify or modify a noun (headword). "的" is placed between modifier and headword.
MODIFIER + 的 + HEADWORD
MODIFIER: 买杯子
HEADWORD: 那个(人)
where do I find this grammar explained?
I just did a copy/paste from my free course (Lesson 17 and Lesson 18) at wearyourchinesename.com, but you can find an explanation of these basic structures in any Chinese course.