Data Structures & AlgorithmsModerateCAT · TCS NQT

Problem: How many integers from 1 to 200 are both perfect squares and perfect cubes?

  1. A. 2
  2. B. 3
  3. C. 1
  4. D. 4

Correct answer: A. 2

A number that is both a square and a cube is a sixth power. Only 1 and 64 are sixth powers up to 200, so the count is 2.

More Coding Interview Problems questions

Exams that ask this topic