Data Structures & AlgorithmsModerateTCS NQT · Infosys

Problem: Consider the sequence 1, 4, 9, 16, … of perfect squares. What is the smallest square that is greater than 500 and also ends in the digit 6?

  1. A. 576
  2. B. 676
  3. C. 529
  4. D. 256

Correct answer: A. 576

Squares above 500: 529, 576, …; 24² = 576 ends in 6. 676 = 26² is the next one, 529 ignores the last-digit rule, and 256 ends in 6 but is below 500.

More Coding Interview Problems questions

Exams that ask this topic