Data Structures & AlgorithmsModerateTCS NQT · Accenture

Problem: What is the LCM of the array [4, 6, 10, 15]?

  1. A. 3600
  2. B. 30
  3. C. 120
  4. D. 60

Correct answer: D. 60

Fold lcm(a, b) = a·b / gcd(a, b): lcm(4, 6) = 12, lcm(12, 10) = 60, lcm(60, 15) = 60. Multiplying all values gives 3600, treating 4 as contributing only one factor 2 gives 30, and multiplying lcm(4, 6) by 10 without dividing by the gcd gives 120.

More Coding Interview Problems questions

Exams that ask this topic