AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Mediumreverseletter shift

~75s

Shifted, then reversed

If BOOK is coded as LPPC, how is PEN coded?

Show the answer and the worked solution

Correct answer: B.

OFQ

Worked solution

  1. Read the code backwards: LPPC → CPPL.
  2. Against BOOK that is B→C, O→P, O→P, K→L — a shift of +1 on every letter.
  3. So the rule is: shift each letter forward by one, then reverse the word.
  4. PEN shifted by one is QFO; reversed, that is OFQ.

Answer: OFQ.

The idea

When no constant shift matches, test the code against the reversed word before trying anything more elaborate. Shift-then-reverse and reverse-then-shift are the two commonest two-step codes, and reading the given code backwards tells you which within seconds.

Shortcut. The code's first letter is the word's last letter + 1: N → O leaves OFQ and OQF, and the middle E → F picks OFQ.

Common trap. "QFO" — shifting each letter but forgetting to reverse; BOOK's code LPPC reads CPPL backwards, so the reversal is part of the rule.

Coding & Decoding

2 of 42

Level

Medium

Target time

~75s

Shifted, then reversed — Coding & Decoding Aptitude Question

Shifted, then reversed: If BOOK is coded as LPPC, how is PEN coded? Answer and worked solution on CodeKairo.

Question

If BOOK is coded as LPPC, how is PEN coded?

Options

  1. QFP
  2. OFQ
  3. QFO
  4. OQF
Show the answer and the worked solution

Correct answer: B. OFQ

Worked solution

  1. Read the code backwards: LPPC → CPPL.
  2. Against BOOK that is B→C, O→P, O→P, K→L — a shift of +1 on every letter.
  3. So the rule is: shift each letter forward by one, then reverse the word.
  4. PEN shifted by one is QFO; reversed, that is OFQ.

Answer: OFQ.

The idea

When no constant shift matches, test the code against the reversed word before trying anything more elaborate. Shift-then-reverse and reverse-then-shift are the two commonest two-step codes, and reading the given code backwards tells you which within seconds.

Shortcut. The code's first letter is the word's last letter + 1: N → O leaves OFQ and OQF, and the middle E → F picks OFQ.

Common trap. "QFO" — shifting each letter but forgetting to reverse; BOOK's code LPPC reads CPPL backwards, so the reversal is part of the rule.

All Coding & Decoding questions · placement mock tests