The correct option is
D had been waiting ; saw
Option C: 'Had been waiting' is in the past perfect continuous tense. 'Saw' is a simple past tense verb.
The first clause 'I ... for 20 minutes' is the main clause. The second clause 'when I...the name of the restaurant...' is the dependent clause.
When the first clause is in present perfect continuous tense 'had been waiting' then the subsequent action is in simple past tense 'saw', as it interrupts the first action. So the action is a short one (as an interruption).
This option is relevant to the sentence in structure and meaning. Hence option C is correct.
Option A: Was waiting' and 'was seeing' are both in past continuous tense. Both can't be in the same tense, since one happened after the other.
Option B: 'Had waited' is in past perfect tense. It states a completed action in the past. But the verb 'saw' interrupts the previous action 'waited'. It cannot interrupt an action that is already completed. The action 'waiting' must be continuous.
Option D: 'Waited' is in simple past and 'had seen' is in the past perfect. But, the action 'waited' happened first, hence it would go one tense back, i.e. past perfect. The action 'had seen' should be in simple past 'saw'.
Hence options A, B and D are incorrect.