Data Structures & AlgorithmsModerateTCS NQT · Infosys

Problem: From the array [−10, −10, 5, 2], pick three numbers (distinct positions) to maximise their product. What is the maximum product?

  1. A. 500
  2. B. -100
  3. C. 200
  4. D. 1000

Correct answer: A. 500

With two large negatives, (−10)·(−10)·5 = 500 beats the three largest values 5·2·(−10) = −100. Using 2 instead of 5 gives 200, and 1000 multiplies all four numbers.

More Coding Interview Problems questions

Exams that ask this topic