Coding–Decoding — All Patterns with Worked Examples

Letter-shift, number, substitution and mixed coding, plus the letter-position table that makes every shift question a subtraction.

ShortcutFreeReasoning Ability › Coding and Decoding⏱ 4 min readUpdated 15 Nov 2026

Every coding question is one of five patterns. Recognise the pattern in the first ten seconds and the rest is arithmetic.

Where it appears

  • SSC CGL / CHSL: 3–4 questions — one of the highest-yield reasoning topics.
  • IBPS and SBI: 2–5, often as a coded-language set.
  • RRB NTPC: 3–4 questions.

The letter-position table

You cannot do this topic without it. Learn the anchors and count from the nearest one.

ABCDEFGHIJKLM
12345678910111213
NOPQRSTUVWXYZ
14151617181920212223242526

EJOTY is the memory hook: E = 5, J = 10, O = 15, T = 20, Y = 25. Count forwards or backwards from the nearest of these.

Opposite letter rule: the opposite of any letter is 27 minus its position. A↔Z, B↔Y, C↔X, and so on.

The five patterns

  1. Letter shift — each letter moves a fixed number of places.
  2. Letter to number — letters replaced by positions, sometimes with arithmetic applied.
  3. Substitution — whole words stand for other words.
  4. Coded language — sentences coded word by word; find the word common to two sentences.
  5. Mixed or conditional — rules applied in order, common in SSC.

Worked examples

Example 1 — forward shift

Q. If CAT is coded as DBU, how is DOG coded?

Solution. Each letter moves forward by one: C→D, A→B, T→U.

So DOG becomes EPH.

Example 2 — variable shift

Q. If MANGO is coded as NCQKT, how is APPLE coded?

Solution. Compare positions: M(13)→N(14) is +1, A(1)→C(3) is +2, N(14)→Q(17) is +3, G(7)→K(11) is +4, O(15)→T(20) is +5.

Applying +1, +2, +3, +4, +5 to APPLE: A→B, P→R, P→S, L→P, E→J, giving BRSPJ.

Example 3 — letters to numbers

Q. If BOOK is coded as 2-15-15-11, how is PEN coded?

Solution. Each letter becomes its position. P = 16, E = 5, N = 14.

So PEN is 16-5-14.

Example 4 — coded language

Q. In a code, "pit na ro" means "she is good", "ro ka da" means "good and bad" and "na si ka" means "he is bad". What is the code for "good"?

Solution. "ro" appears in the first two sentences, whose only common English word is "good".

So "good" is ro. Similarly "na" is common to sentences one and three, both containing "is", so "na" is "is", and "ka" is "bad".

Example 5 — sum of positions

Q. If RED is coded as 27 and BLUE as 40, how is PINK coded?

Solution. R + E + D = 18 + 5 + 4 = 27, and B + L + U + E = 2 + 12 + 21 + 5 = 40. The code is the sum of letter positions.

P + I + N + K = 16 + 9 + 14 + 11 = 50.

Example 6 — backward coding

Q. If LIGHT is coded as OROSG, what is the rule?

Solution. Check the opposite-letter rule, 27 minus the position: L(12)→O(15) ✓, I(9)→R(18) ✓, G(7)→T(20) ✓, H(8)→S(19) ✓, T(20)→G(7) ✓.

Each letter is replaced by its opposite letter.

Short tricks

  • Write the position numbers under both words first. The pattern is usually visible immediately.
  • Check for a constant difference, then for 1-2-3 style increments, then for the opposite-letter rule — in that order.
  • In coded language, intersect the sentences. Never try to decode word by word from scratch.
  • Watch for reversed words — many "codes" are just the word spelled backwards with a shift.

Common mistakes

  • Miscounting letter positions. Use EJOTY anchors rather than counting from A.
  • Forgetting that the alphabet wraps — Z + 1 is A.
  • In coded-language questions, assuming word order carries over. It usually does not.
  • Applying the first rule you spot without testing it against every letter.

Practice questions

  1. If FLOWER is coded as GMPXFS, how is GARDEN coded?
  2. If TEACHER is coded as VGCEJGT, what is the shift?
  3. If 'tap sip mip' means 'cats are small', 'mip nip bip' means 'dogs are big', what is the code for 'are'?
  4. If CAB is coded as 6, and FED is coded as 15, how is IHG coded?
  5. If MOUSE is coded as NMVQF, which rule is being applied?

Answers

  1. HBSEFO. Each letter moves forward by one.
  2. +2 on every letter. T→V, E→G, A→C, and so on.
  3. mip. It is the only code common to both sentences, as "are" is the only common word.
  4. 24. The code is the sum of positions: C+A+B = 6, F+E+D = 15, I+H+G = 9+8+7 = 24.
  5. Alternate +1 and −2. M(13)→N(14) is +1, O(15)→M(13) is −2, U(21)→V(22) is +1, S(19)→Q(17) is −2, E(5)→F(6) is +1.