Coding - Decoding
🔒 Log in to trackLetter shift coding
🔒 Log in to trackThe bread and butter of CGL coding. The code moves every letter by the same number of positions (or by a fixed per-index pattern). Compute the shift from the sample pair once; the same shift (or tuple) applies to the probe.
Worked skeleton: If MANGO is coded OCPIQ, the tuple is (+2, +2, +2, +2, +2); so JUICE (+2 on each) = LWKEG. If the tuple comes out mixed — (+1, +2, +3, +1, +2) — it is still applied slot-wise exactly.
Shifts behave mod 26: X + 5 = C. Fluency with EJOTY anchors (E=5, J=10, O=15, T=20, Y=25) makes every jump a small hop from a known letter.
Detailed notes
What is letter-shift coding?
Think of the alphabet as a circular road with 26 houses, A to Z. In letter-shift coding every letter of a word walks forward (or backward) a fixed number of houses. If every letter walks 2 houses forward, CAT becomes ECV. This is the most common coding question in SSC, Railway and Banking papers.
Step 1: know the positions
Each letter has a position number: A=1, B=2 ... Z=26. Do not count on your fingers every time. Learn the EJOTY anchors:
| E | J | O | T | Y |
|---|---|---|---|---|
| 5 | 10 | 15 | 20 | 25 |
Any letter is at most 2 steps from an anchor. For example, R = T − 2 = 18 and H = J − 2 = 8.
Step 2: find the shift
Write the sample word and its code one above the other. For each slot, subtract: code position − word position. The list of answers is the shift tuple.
Example: KITE → MKVG. K(11)→M(13) is +2, I→K +2, T→V +2, E→G +2. The tuple is (+2, +2, +2, +2), a flat shift.
Wrap-around
After Z the road starts again at A. So Y + 3 = B (Y→Z→A→B). In numbers: if the new position is more than 26, subtract 26. If it is 0 or less, add 26. Example: C − 5 → 3 − 5 = −2 → −2 + 26 = 24 = X.
Types of shift you will meet
- Flat shift: every letter moves by the same number, e.g. +2 or −3.
- Per-slot (rising or falling) shift: 1st letter +1, 2nd +2, 3rd +3 ... or −1, −2, −3 ... The tuple changes but follows a pattern.
- Alternating shift: +1, −1, +1, −1 ... or odd places +2 and even places −2.
- Length-based shift: each letter moves by the number of letters in the word. CAT (3 letters) → FDW; FISH (4 letters) → JMWL. When two samples of different length show different flat shifts, check the letter count.
- Decoding: the code is given and the word is asked. Run the tuple backwards: where the rule adds 2, you subtract 2.
A full worked example
Q. If WORD is written as XQUH, how is BOOK written?
W→X +1, O→Q +2, R→U +3, D→H +4. The tuple rises: (+1, +2, +3, +4). Apply it to BOOK: B+1 = C, O+2 = Q, O+3 = R, K+4 = O. Answer CQRO.
Notice that the two O's in BOOK get different codes (Q and R). In per-slot rules the slot decides the shift, not the letter.
Speed habits
- Find the shift from the first two letters and confirm it with one more letter before coding.
- Look at the options: usually only one option has the right first letter. Check the last letter to be sure.
- For decoding, code your chosen option forward once. If it gives the code, you are right.
Quick revision
- Positions: A=1 ... Z=26; anchors E5, J10, O15, T20, Y25.
- Shift tuple = code position − word position, slot by slot.
- Flat, rising/falling, alternating and length-based shifts are the four families.
- Wrap-around: above 26 subtract 26; 0 or below add 26.
- Decode = subtract the tuple. Check the answer by coding it forward.
Types of questions asked
Every way this subtopic shows up in exams — how to recognise it, the formula or logic to use, and a solved example.
Type 1: Flat shift (+k or −k on every letter)very common2 practice Q
Every letter of the code is the same number of places ahead of (or behind) the matching letter of the word.
- Subtract positions for two or three letters of the sample.
- If all differences are equal, that is k.
- Add k to each letter of the new word (wrap after Z).
Why it works: a flat rule treats every letter the same.
Example: If KITE is written as MKVG, how is LAMP written?
K→M (+2), I→K (+2), T→V (+2), E→G (+2) → flat +2. LAMP +2 → NCOR.
Type 2: Per-slot shift (rising, falling or fixed tuple)common2 practice Q
The differences are not equal but follow a pattern by position: +1, +2, +3, +4 or −1, −2, −3 or (+3, +1, +4...).
- Write the full shift tuple from the sample.
- Apply the same tuple to the new word, slot by slot.
- Repeated letters may get different codes — that is expected.
Why it works: the slot number decides the shift.
Example: If WORD is written as XQUH, how is BOOK written?
W→X (+1), O→Q (+2), R→U (+3), D→H (+4) → (+1, +2, +3, +4). BOOK → CQRO.
Type 3: Decoding (code given, word asked)common3 practice Q
The question gives a code and asks 'which word is written as ...?' — the direction is reversed.
- Find the rule from the sample pair.
- Undo it: subtract where the rule adds, add where it subtracts.
- Code your answer forward once to confirm.
Why it works: decoding is the same rule played backwards.
Example: If DOG is written as FQI, which word is written as DKTF?
Rule +2, so decode −2: DKTF → BIRD.
Type 4: Alternating or odd/even-place shiftcommon2 practice Q
The shifts swing: +1, −1, +1, −1 ... or letters in odd places move one way and letters in even places the other way.
- Write the tuple and look for a repeating 2-step cycle.
- Apply the cycle to the new word from the first letter.
- For a longer new word, just keep repeating the cycle.
Why it works: the rule depends only on odd/even place.
Example: If FLOWER is written as GKPVFQ, how is GARDEN written?
F→G (+1), L→K (−1), O→P (+1), W→V (−1), E→F (+1), R→Q (−1) → +1, −1 repeating. GARDEN → HZSCFM.
Type 5: Shift equal to the number of lettersoccasional2 practice Q
Two or more samples of different lengths each have a flat shift, and the shift equals the word's letter count (3-letter word +3, 4-letter word +4), or its negative.
- Find the flat shift of each sample.
- Compare it with the word length.
- For the new word, count its letters and shift by that number.
Why it works: the shift is not fixed; it is tied to the length.
Example: If CAT is written as FDW and FISH as JMWL, how is TIGER written?
CAT: +3 (3 letters); FISH: +4 (4 letters). TIGER has 5 letters → +5 → YNLJW.
Formulas
Compute d_i from the sample; apply the identical tuple to the probe.
For decoding questions subtract the tuple instead of adding.
Shortcut tricks
⚡ Anchor hops, not counting
For shift +k, jump from the nearest EJOTY anchor: to shift W by 4, note W = Y − 2, so W + 4 = Y + 2 = A. Two small hops beat counting W→X→Y→Z→A.
Example: Q. If MANGO = OCPIQ (+2), code JUICE.
Sol. J+2 = L, U+2 = W, I+2 = K, C+2 = E, E+2 = G → LWKEG.
EJOTY + small hops keeps shift arithmetic error-free at speed.
⚡ Decode questions: run the tuple backwards
When a coded word is given and the original is asked, subtract the tuple instead of adding. Reverse every hop.
Example: Q. If MANGO is coded as OCPIQ, which word is coded as LWKEG?
Sol. MANGO → OCPIQ is +2 on every letter, so decoding means −2 on every letter: L→J, W→U, K→I, E→C, G→E → JUICE.
Decoding is the same question played backwards — subtract the shift, don't invent a new rule.
Where students lose marks
Applying a +2 found on a 5-letter sample to only 4 letters of the probe (misalignment).
Sign errors on decode questions — the shift runs the opposite way.
Missing a per-index rising tuple and treating it as flat.
Practice sets — 15 questions
Sets of 10, mixed across the question types above. Each answer comes with a step-by-step explanation.
Topic test · 10 questions
Suggested time 6 min · wrong answers go to your mistake notebook automatically.