Coding and Decoding — RRB NTPC Study Notes
Overview
Coding and Decoding is a staple reasoning topic in RRB NTPC, testing your ability to identify patterns and apply logical rules consistently. In these questions, a word, number, or phrase is transformed according to a hidden rule, and you must either decode a given code or encode a new word using the same rule. This topic directly evaluates pattern recognition, attention to detail, and logical consistency — skills critical for administrative and technical roles in Indian Railways.
Expect 2–4 questions from this topic in the exam. They appear straightforward but can be tricky if you miss subtle patterns or apply rules inconsistently. The good news: once you recognize the pattern type, these questions become scoring opportunities. Master letter coding (positional and shift-based), number coding (direct substitution and arithmetic), conditional coding (if-then rules), and substitution coding (symbol or word replacement). Speed comes from practice and familiarity with common pattern types.
Your goal is twofold: decode quickly by spotting the pattern in 15–20 seconds, and verify your answer by applying the rule consistently across all given examples.
Key Concepts
- **Letter Position Values**: Every letter has a position in the English alphabet: A=1, B=2, C=3...Z=26. Many coding schemes rely on these position values, either directly or after arithmetic operations.
- **Forward and Reverse Alphabets**: In reverse alphabet coding, A↔Z, B↔Y, C↔X and so on. Position of a letter + position of its reverse counterpart always equals 27. This is a common transformation rule.
- **Fixed Shift (Caesar Cipher)**: Each letter is replaced by a letter a fixed number of positions ahead or behind in the alphabet. For example, shift +3 means A→D, B→E, C→F.
- **Conditional Rules**: The coding rule changes based on a condition — e.g., "if the word starts with a vowel, reverse the entire code; if consonant, shift each letter by +2." Identifying the condition is the key challenge.
- **Number-Letter Correspondence**: Words may be coded as sequences of numbers corresponding to letter positions, or through arithmetic (sum, product, difference of positions).
- **Substitution with Symbols or Words**: Each letter, digit, or word is replaced by a specific symbol, different word, or number. Build a substitution table from the given examples to decode new words.
- **Pattern Consistency**: The same rule must apply to every example given in the question. Use this to eliminate wrong answer choices — if a rule doesn't fit all examples, discard it.
- **Mixed Operations**: Some questions combine two operations, such as reverse alphabet + shift, or position sum followed by digit reversal. Look for two-step logic if single rules don't fit.
Formulas / Key Facts
1. **Alphabet Position**: A=1, B=2, C=3, D=4, E=5, F=6, G=7, H=8, I=9, J=10, K=11, L=12, M=13, N=14, O=15, P=16, Q=17, R=18, S=19, T=20, U=21, V=22, W=23, X=24, Y=25, Z=26.
2. **Opposite Letter Formula**: Opposite of letter at position n is at position (27 - n). For example, opposite of E (5) is V (22), because 27 - 5 = 22.
3. **Caesar Shift**: New position = (Old position + Shift) mod 26. If result is 0, take 26. For reverse shift, subtract shift value instead.
4. **Position Sum Coding**: For a word, code = sum of position values of all letters. Example: CAT = 3 + 1 + 20 = 24.
5. **Place Value Pattern**: First letter → tens place, second letter → units place. Example: if A=1, B=2, then AB = 12 (not 1+2=3).
6. **Vowel and Consonant Count**: Vowels are A, E, I, O, U (5 letters). All others are consonants (21 letters). Conditional coding often uses this distinction.
7. **Cyclic Alphabet**: After Z comes A again in forward direction; before A comes Z in reverse direction. Handle wraparounds carefully in shift coding.
8. **Digit Sum Reduction**: When coding yields multi-digit numbers, sometimes only the digit sum (sum of digits until single digit) is used. Example: 24 → 2+4 = 6.
Worked Examples
**Example 1 (Letter Shift):** If BROTHER is coded as CSPUIFS, how is SISTER coded?
*Solution:* Compare BROTHER and CSPUIFS letter by letter: B(2) → C(3): +1 R(18) → S(19): +1 O(15) → P(16): +1 T(20) → U(21): +1 H(8) → I(9): +1 E(5) → F(6): +1 R(18) → S(19): +1
Rule: Each letter is shifted forward by +1 position.
Apply to SISTER: S(19) → T(20) I(9) → J(10) S(19) → T(20) T(20) → U(21) E(5) → F(6) R(18) → S(19)
**Answer: TJTUS**
---
**Example 2 (Opposite Letters):** If MANGO is coded as NZMTL, what is the code for APPLE?
*Solution:* Check each letter: M(13) → N(14): Could be +1, but check others. A(1) → Z(26): Opposite letter (27-1=26). N(14) → M(13): Opposite (27-14=13). G(7) → T(20): Opposite (27-7=20). O(15) → L(12): Opposite (27-15=12).
Rule: Each letter is replaced by its opposite in the alphabet.
Apply to APPLE: A(1) → Z(26) P(16) → K(11): 27-16=11 P(16) → K(11) L(12) → O(15): 27-12=15 E(5) → V(22): 27-5=22
**Answer: ZKKLOV**
---
**Example 3 (Number Coding):** If CAT = 24, DOG = 26, what is BAT?
*Solution:* CAT: C(3) + A(1) + T(20) = 24 ✓ DOG: D(4) + O(15) + G(7) = 26 ✓
Rule: Code = Sum of position values of letters.
BAT: B(2) + A(1) + T(20) = 23
**Answer: 23**
---
**Example 4 (Conditional Coding):** If DESK is coded as FTUM and SOFA is coded as QMDY, code TABLE.
*Solution:* DESK → FTUM: D(4) → F(6): +2 E(5) → T(20): +15 or something else? Check vowel. S(19) → U(21): +2 K(11) → M(13): +2
Notice E is a vowel; T is consonant. Looks like consonants get +2, but vowel pattern differs.
SOFA → QMDY: S(19) → Q(17): -2 O(15) → M(13): -2 (vowel) F(6) → D(4): -2 A(1) → Y(25): -2 (wraps around: 1-2 = -1 ≡ 25 mod 26)
Rule: Shift all letters by -2 (or equivalently +24).
Apply to TABLE: T(20) → R(18): -2 A(1) → Y(25): -2 B(2) → Z(26): -2 L(12) → J(10): -2 E(5) → C(3): -2
**Answer: RYZJC**
Common Mistakes
- **Ignoring Opposite-Letter Symmetry**: Students often try +1 or -1 shifts when the actual rule is opposite letters. Always check if position_old + position_new = 27 for any pair. If yes, opposite-letter coding is in play.
- **Inconsistent Rule Application**: Applying a rule to only part of the word or changing the rule mid-word. The same transformation must apply to every letter (or follow a consistent positional/conditional pattern). Verify your rule with all given examples before finalizing.
- **Wraparound Errors in Shifts**: Forgetting that after Z comes A (forward) or before A comes Z (backward). For example, Y + 3 = B (not 28). Use modular arithmetic: (25 + 3 - 1) mod 26 + 1 = 2 = B.
- **Mixing Up Vowels and Consonants**: In conditional coding, applying the vowel rule to consonants or vice versa. Always classify each letter correctly: A, E, I, O, U are vowels; all others are consonants.
- **Position Sum vs. Place Value Confusion**: When coding words as numbers, mistaking digit concatenation (AB = 12) for summation (A+B = 3). Read the question carefully and test with the given example to confirm the operation.
Quick Reference
- Alphabet positions: A=1, B=2...Z=26; opposite of n is 27-n.
- Common patterns: fixed shift (+n or -n), opposite letters, position sums, conditional rules.
- Always verify your identified rule against all given examples before applying to the question.
- Watch for wraparounds when shifting near A or Z.
- In conditional coding, distinguish vowels (A,E,I,O,U) from consonants carefully.
- Speed tip: Eliminate answer options that violate the rule on even one letter.