In this guide
A coding question shows you a word and its secret form, then asks you to write a new word in the same code. The rule is always simple: move each letter a few places, write the word backwards, swap each letter for its opposite, or turn letters into numbers. The hard part is not the rule. It is finding it quickly and applying it without a slip.
Coding–decoding is one of the quick topics in the RRB Group D reasoning section. Once you know the common rules and letter positions, most questions take well under a minute.
First, know your alphabet by number
Every coding rule works on letter positions: A = 1, B = 2, and so on to Z = 26. If you have to count from A each time, you will be slow and you will slip by one.
- Learn the anchors E = 5, J = 10, O = 15, T = 20, Y = 25 (say "EJOTY"). Apart from A to C, which you know anyway, every letter is at most two steps from an anchor.
- Learn the opposite pairs. Opposite letters always add up to 27 (A + Z = 1 + 26).
The 13 opposite pairs are:
- A–Z, B–Y, C–X, D–W, E–V
- F–U, G–T, H–S, I–R, J–Q
- K–P, L–O, M–N
Our reasoning plan has a simple drill for learning positions in a week.
A four-step method
- Write the word and its code one under the other, letter below letter.
- Write the position number above each letter of both.
- Compare each pair. Is the gap the same every time? Does it grow? Is the code the word backwards? Do the pairs add up to 27?
- Check the rule on every letter before you use it on the new word.
If the word and the code have different lengths, or the letters look scrambled, try reversing the word first. If the code is a number, try positions, then their sum.
The common types
| Type | Rule | Example |
|---|---|---|
| Fixed shift | Every letter moves the same number of places | ROAD → SPBE (+1 each) |
| Growing shift | The shift grows: +1, +2, +3, +4 | COLD → DQOH |
| Alternate shift | The shift switches: −1, +1, −1 | PEN → OFM |
| Reverse | The word is written backwards | TRAIN → NIART |
| Reverse and shift | Reverse first, then shift | MILK → KLIM → LMJN |
| Opposite | Each letter swaps with its opposite | BAD → YZW |
| Position numbers | Letters become their positions | SUN → 19-21-14 |
| Sum of positions | Add the positions | ACE → 1 + 3 + 5 = 9 |
| Word substitution | Words stand for other words | "sky" is called "sea" |
When a shift passes Z, start again at A. When a backward shift passes A, go on from Z. So Z + 2 = B, and A − 2 = Y.
Worked examples
Example 1 (fixed shift): If ROAD is written SPBE, how is LAMP written?
- R → S, O → P, A → B, D → E. Each letter moves +1.
- L → M, A → B, M → N, P → Q. Answer: MBNQ.
Example 2 (backward shift with a wrap): If FIRE is written DGPC, how is WATER written?
- F (6) → D (4), I (9) → G (7), R (18) → P (16), E (5) → C (3). Each letter moves −2.
- W → U, A → Y (going back past A to Z, then Y), T → R, E → C, R → P.
- Answer: UYRCP.
Example 3 (opposite letters): If BAD is written YZW, how is CAB written?
- B + Y = 2 + 25 = 27, A + Z = 27, D + W = 27. Opposite letters.
- C ↔ X, A ↔ Z, B ↔ Y. Answer: XZY.
Example 4 (growing shift): If COLD is written DQOH, how is WARM written?
- C → D is +1, O → Q is +2, L → O is +3, D → H is +4.
- W + 1 = X, A + 2 = C, R + 3 = U, M + 4 = Q. Answer: XCUQ.
Example 5 (reverse and shift): If MILK is written LMJN, how is BOOK written?
- Compare letter by letter: M → L, I → M, L → J, K → N. No single shift fits, so try reversing.
- MILK backwards is KLIM. K → L, L → M, I → J, M → N. Each letter +1.
- BOOK backwards is KOOB. Add 1 to each: LPPC.
Example 6 (number codes): If ACE = 9, what is BED? And if SUN is written 19-21-14, how is MOON written?
- ACE: 1 + 3 + 5 = 9, so the code is the sum of positions. BED = 2 + 5 + 4 = 11.
- SUN: S = 19, U = 21, N = 14, so each letter becomes its position. MOON = 13-15-15-14.
Common mistakes
- Finding the rule from the first two letters and not checking the rest. Growing shifts look like fixed shifts for one letter.
- Going the wrong way round when a shift passes A or Z.
- Miscounting positions. Use EJOTY instead of counting from A.
- Forgetting to try reversal when nothing else fits.
Practice set
- If PLAY is written QMBZ, how is GAME written?
- If TRAIN is written NIART, how is BUS written?
- If CAT = 24, what is RAT?
- If GOOD is written TLLW, how is BAD written?
- If DEAR is written 4-5-1-18, how is LEAD written?
- If BELT is written CGOX, how is FISH written?
- If PEN is written OFM, how is CUP written?
- If "water" is called "milk", "milk" is called "tea" and "tea" is called "juice", what does a cow give?
Answers:
- HBNF. Each letter +1.
- SUB. The word is written backwards.
- 39. CAT = 3 + 1 + 20 = 24, so RAT = 18 + 1 + 20 = 39.
- YZW. Opposite letters: G ↔ T, O ↔ L, D ↔ W. So B ↔ Y, A ↔ Z, D ↔ W.
- 12-5-1-4. Each letter becomes its position.
- GKVL. Growing shift +1, +2, +3, +4: F → G, I → K, S → V, H → L.
- BVO. Alternate shift −1, +1, −1: C → B, U → V, P → O.
- Tea. A cow gives milk, and milk is called "tea".
What to do next
- Write A to Z with positions from memory, then the 13 opposite pairs.
- Solve 15 coding questions a day for a week, writing positions above every letter.
- Time yourself. Aim for 40 seconds or less per question by the end of the week.
- Revise number and letter series, which use the same letter skills, then move on to mathematical operations.
A note on dates and numbers. Exam patterns, vacancies and schedules change from year to year. Always confirm the current details in the latest notification on the Railway Recruitment Boards website .
Get the next Group D guide by email
New guides every week. No spam, unsubscribe any time.