Data Structures & AlgorithmsHardCAT · TCS NQT

Problem: The number of ways to choose 4 people from 9 so that a specific two people are never both chosen is what value?

  1. A. 84
  2. B. 35
  3. C. 126
  4. D. 105

Correct answer: D. 105

Complement: C(9,4) − C(7,2) = 126 − 21 = 105 removes the groups containing both people. Subtracting 21 twice gives 84, excluding both people entirely gives C(7,4) = 35, and 126 ignores the restriction.

More Coding Interview Problems questions

Exams that ask this topic