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.
Need more? Ask Shishya
Shishya is your personal tutor for this topic. Pick a starter or open a free chat.
In a certain code language, 'PENCIL' is written as 'QFODJM'. How will 'ERASER' be written in that code?
Q2 · Coding and Decoding · MEDIUM
If in a certain code, 'MASTER' is coded as '411205189', what will be the code for 'SISTER'?
Q3 · Coding and Decoding · MEDIUM
In a certain code language, if 'sky is blue' is coded as '816', 'blue and white' is coded as 'promotion' wait, let me rewrite: If 'sky is blue' is coded as '8 3 6', 'sea is deep' is coded as '5 3 9', and 'blue ocean deep' is coded as '6 7 9', what is the code for 'sky'?
Q4 · Coding and Decoding · HARD
If 'FRIEND' is coded as 'HUMJTK' in a certain code language, then how will 'MOTHER' be coded in the same language?
Q5 · Coding and Decoding · MEDIUM
In a certain code, if 'CAT' is written as '24', 'DOG' is written as '26', then 'BIRD' will be written as:
**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.
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?
**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.