Data Structures & AlgorithmsModerateTCS NQT · Accenture

Problem: The string "abcdefg" is rotated right by 3 positions. What is the first character of the rotated string?

  1. A. a
  2. B. d
  3. C. f
  4. D. e

Correct answer: D. e

A right rotation by three moves the last three characters ('e', 'f', 'g') to the front, so the first character is 'e'.

More Coding Interview Problems questions

Exams that ask this topic