ExamShortcut

Coding - Decoding

🔒 Log in to track
high importance~4 Q in Tier 16 formulas⚡ 10 shortcuts7 subtopics
All subtopics·Subtopic 2 of 7

Letter shift coding

🔒 Log in to track
⏱ 5 min read🧩 5 question types🎯 15 practice Q
The idea in one minute

Every letter moves forward or backward by some steps in the alphabet. Find the steps from the sample pair, slot by slot. Then move the letters of the new word by the same steps. After Z the alphabet starts again at A.

01

What a letter shift is

Each letter moves forward or back by a fixed number of steps. With +2, CAT becomes ECV.

Think of the alphabet as a circle of 26 letters. After Z it starts again at A. This is the most common coding question in SSC, Railway and Banking papers.

  • Coding: the word is given, you write the code.
  • Decoding: the code is given, you bring back the word.
02

Know the positions fast

Each letter has a position: A = 1, B = 2, … Z = 26. Learn five anchors and you will never count on your fingers.

EJOTY
510152025

Every letter is at most 2 steps from an anchor. R = T − 2 = 18. H = J − 2 = 8. W = Y − 2 = 23.

Tip: Also remember M = 13 and N = 14. They sit in the middle of the alphabet.

03

Find the shift from the sample

Write the word above its code. For each slot, work out code position − word position. This list is the shift list.

KITE → MKVG. K(11) → M(13) is +2. I → K is +2, T → V is +2, E → G is +2. The shift list is (+2, +2, +2, +2). This is a flat shift.

Rule: Check at least three letters before you trust a shift. One letter can fool you.

04

Wrap-around

If the new position is more than 26, subtract 26. If it is 0 or less, add 26.

  • Y + 3: 25 + 3 = 28, and 28 − 26 = 2 = B.
  • C − 5: 3 − 5 = −2, and −2 + 26 = 24 = X.
  • W + 4: W is Y − 2, so W + 4 = Y + 2, which crosses Z and lands on A.
05

A full question, start to finish

"In a certain code, PEN is written as RGP. How is CAT written in that code?"

  1. Find the shift: P(16) → R(18) is +2. E(5) → G(7) is +2. N(14) → P(16) is +2.
  2. The rule is a flat +2 shift.
  3. Apply it to CAT: C → E, A → C, T → V.
  4. Write the code: ECV.

For decoding, run the film backwards. RGP − 2 gives P, G − 2 gives E, P − 2 gives N. You are back at PEN.

06

The five kinds of shift

  1. Flat: every letter moves the same, like +2 or −3.
  2. Rising or falling: +1, +2, +3, … or −1, −2, −3, … LAMP with −1, −2, −3, −4 gives KYJL.
  3. Alternating: +1, −1, +1, −1, … Odd places go one way, even places the other.
  4. Length-based: the shift equals the number of letters. CAT (3 letters) → FDW. FISH (4 letters) → JMWL.
  5. Decoding: the code is given and the word is asked. Undo each step. Where the rule adds 2, you subtract 2.

Example: WORD → XQUH. The shifts are +1, +2, +3, +4, a rising list. So BOOK → B+1, O+2, O+3, K+4 = CQRO. The two O's get different codes, because the place decides the shift.

07

Use the options

  • Code only the first letter. Usually one or two options survive.
  • Then code the last letter to choose between them.
  • For decoding, code your chosen option forward once. If it gives the code, you are right.
08

Question types you will see

Each type: how to recognise it, the method step by step, and one question to try.

Type 1very common2 practice Q

Flat shift (+k or −k on every letter)

How to spot it:

Every code letter is the same number of steps ahead of (or behind) its word letter.

codei=letteri+k\text{code}_i = \text{letter}_i + k
Method
  1. Subtract positions for three letters of the sample.

  2. If all differences are equal, that is k.

  3. Add k to each letter of the new word. Wrap after Z.

Why it works:

A flat rule treats every letter the same way.

Try this

In a certain code language, SILK is written as UKNM. How will COTTON be written in that language?

Show solution
  1. S→U, I→K, L→N, K→M: each is +2.

  2. COTTON +2: C→E, O→Q, T→V, T→V, O→Q, N→P.

Answer

EQVVQP

Type 2common2 practice Q

Rising or falling shift (+1, +2, +3, …)

How to spot it:

The differences are not equal but grow or fall by place: +1, +2, +3, +4 or −1, −2, −3.

codei=letteri+di\text{code}_i = \text{letter}_i + d_i
Method
  1. Write the full shift list from the sample.

  2. Apply the same list to the new word, place by place.

  3. Expect a repeated letter to get different codes.

Why it works:

The place of a letter decides its shift, not the letter itself.

Try this

In a certain code language, LAMP is written as MCPT. How will DESK be written in that language?

Show solution
  1. L→M +1, A→C +2, M→P +3, P→T +4.

  2. DESK: D+1 = E, E+2 = G, S+3 = V, K+4 = O.

Answer

EGVO

Type 3common3 practice Q

Decoding (code given, word asked)

How to spot it:

The question gives a code and asks: which word is written as …?

letteri=codei−di\text{letter}_i = \text{code}_i - d_i
Method
  1. Find the rule from the sample pair.

  2. Undo it: subtract where the rule adds, add where it subtracts.

  3. Code your answer forward once to confirm.

Why it works:

Decoding is the same rule played backwards.

Try this

In a certain code language, BIRD is written as DKTF. Which word is written as HTQI in that language?

Show solution
  1. BIRD → DKTF is +2 on every letter.

  2. Decode with −2: H→F, T→R, Q→O, I→G.

  3. Check: FROG +2 = HTQI.

Answer

FROG

Type 4common2 practice Q

Alternating shift (odd and even places)

How to spot it:

The shifts swing: +1, −1, +1, −1, … Letters in odd places move one way, even places the other.

Method
  1. Write the shift list and find the 2-step cycle.

  2. Apply the cycle to the new word from the first letter.

  3. For a longer word, keep repeating the cycle.

Why it works:

The rule depends only on whether the place is odd or even.

Try this

In a certain code language, FLOWER is written as GKPVFQ. How will GARDEN be written in that language?

Show solution
  1. F→G +1, L→K −1, O→P +1, W→V −1, E→F +1, R→Q −1.

  2. GARDEN with +1, −1 repeating: G→H, A→Z, R→S, D→C, E→F, N→M.

Answer

HZSCFM

Type 5occasional2 practice Q

Shift equal to the number of letters

How to spot it:

Two samples of different lengths have different flat shifts. Each shift equals the word's letter count.

Method
  1. Find the flat shift of each sample.

  2. Compare it with the number of letters.

  3. Count the letters of the new word and shift by that number.

Why it works:

The shift is not fixed. It is tied to the length of the word.

Try this

In a certain code language, CAT is written as FDW and DEER is written as HIIV. How will PLANT be written in that language?

Show solution
  1. CAT is +3 (3 letters). DEER is +4 (4 letters).

  2. PLANT has 5 letters, so shift +5.

  3. P→U, L→Q, A→F, N→S, T→Y.

Answer

UQFSY

09

Formula sheet

Shift list
codei=letteri+di(mod26)\text{code}_i = \text{letter}_i + d_i \pmod{26}

d is the shift for place i, found from the sample. Above 26, subtract 26.

Decoding
letteri=codei−di(mod26)\text{letter}_i = \text{code}_i - d_i \pmod{26}

To decode, subtract the same shifts. At 0 or below, add 26.

10

Shortcuts that save time

⚡ Hop from an anchor, do not count

To shift a letter, jump from the nearest EJOTY anchor. W is Y − 2, so W + 4 = Y + 2 = A. Two small hops are faster than counting W, X, Y, Z, A.

Example

If MANGO is written as OCPIQ, how is JUICE written?

Show solution
  1. MANGO → OCPIQ is +2 on every letter.

  2. J+2 = L, U+2 = W, I+2 = K, C+2 = E, E+2 = G.

Answer

LWKEG

⚡ Decoding: run the shifts backwards

When the code is given and the word is asked, subtract the shift instead of adding it.

Example

If MANGO is written as OCPIQ, which word is written as LWKEG?

Show solution
  1. The rule is +2, so decode with −2.

  2. L→J, W→U, K→I, E→C, G→E.

Answer

JUICE

11

Mistakes to avoid

Where most students lose marks on this subtopic.

Mistake 01

Adding the shift in a decoding question.

Decoding runs backwards. Subtract where the rule adds.

Mistake 02

Treating a rising list (+1, +2, +3) as flat after checking one letter.

Check three letters. Write the full shift list.

Mistake 03

Losing count when a shift crosses Z.

Above 26, subtract 26. At 0 or below, add 26.

Mistake 04

In a length-based rule, using the sample's shift for the new word.

Count the letters of the new word. That count is its shift.

Mistake 05

Giving a repeated letter the same code in a rising-shift rule.

In rising or alternating rules the place decides the shift, not the letter.

12

Quick revision

Read this the night before the exam.

  • Positions: A = 1 … Z = 26; anchors E5, J10, O15, T20, Y25.

  • Shift = code position − word position, slot by slot.

  • Flat, rising/falling, alternating and length-based are the main kinds.

  • Wrap-around: above 26 subtract 26; at 0 or below add 26.

  • Decode = subtract the shifts; check by coding your answer forward.

  • Code the first letter of each option first to cut options fast.

13

Practice: 15 questions

Sets of 10, mixed across the question types above. Every answer has a step-by-step explanation.

Topic test · 10 questions

Suggested time 6 min · wrong answers go to your mistake notebook automatically.