Coding & Decoding – Reasoning Ability
(For Competitive Exams – IIT‑JEE, JEE‑Main, AIIMS, NTA, UPSC, etc.)
1. What is Coding‑Decoding?
- Coding – Translating a given word/phrase into a code (often a number, letter or symbol) using a fixed rule.
- Decoding – Reversing the process: deducing the original word/phrase from the code.
These problems test:
- Pattern recognition – spotting hidden regularities.
- Logical reasoning – applying a rule consistently.
- Speed & accuracy – especially in exams.
2. Common Coding‑Decoding Schemes
| Scheme | Example | How it works |
|---|---|---|
| Alphabetical Position | ABC → 1 2 3 |
Convert each letter to its position in the alphabet (A=1, B=2, …). |
| Reverse Alphabet | ABC → 26 25 24 |
Map A→26, B→25, C→24. |
| Skip or Skip‑by‑k | ABC → 1 4 7 |
Add a fixed number (k) to previous code. |
| Alternate Scheme | ABC → 1, 4, 5 |
Mix different operations (e.g., 1st letter + 0, 2nd letter + 3). |
| Sum of Positions | ABC → 6 |
Sum positions of all letters. |
| Product of Positions | ABC → 6 |
Multiply positions. |
| Difference between Extremes | ABC → 25 |
|
| Pattern on Vowels/Consonants | APPLE → 1 16 16 12 5 – Vowels → 1, Consonants → 2, etc. |
|
| Use of Digits as Symbols | ABC → 1#2#3 |
Insert a symbol between numbers. |
| Modular Arithmetic | ABC → (1+2+3) mod 10 = 6 |
Often used for single‑digit codes. |
| Multiple‑Stage Coding | ABC → 1 4 3 → 10 11 12 |
Two or more layers of transformation. |
Tip:
*Always check the first letter(s) or word(s). They often give the rule.
Look for patterns in the increments/decrements of codes.
3. Step‑by‑Step Strategy
-
Identify the Units
- Are we coding words, phrases, or numbers?
- Are letters represented individually or as a whole?
-
Find the Basic Transformation
- Convert letters to numbers (A=1).
- If numbers given, see whether they are consecutive, increasing, or follow a known sequence.
-
Check for “Special” Letters
- Vowels vs. consonants.
- First letter vs. others.
-
Look for a Consistent Rule
- Add, subtract, multiply, divide, sum, product, or modulo.
- Check each letter/word.
-
Validate with All Given Examples
- If multiple coding pairs are supplied, verify the rule holds for all.
-
Decode or Encode
- For decoding, reverse the rule.
- For encoding, apply the rule directly.
4. Important Formulae & Tricks
| Formula / Trick | When to Use |
|---|---|
| Alphabetic Position (P = \text{ord}(L) - \text{ord}('A') + 1) | Simple conversion |
| Reverse Alphabet Position (R = 27 - P) | When codes are large (e.g., 26, 25) |
| Modulo 10 Sum ((\sum P_i) \bmod 10) | Single‑digit codes |
| Sequential Increment (C_i = C_{i-1} + k) | When codes increase by a constant |
| Vowel/Consonant Distinction | If codes differ drastically between vowels and consonants |
| Multiplicative Chain (C_i = C_{i-1} \times k) | Exponential growth pattern |
| Digit‑wise Replacement | When each digit of a number is replaced by a letter or symbol |
| Word‑length as Code | Code = number of letters in the word |
Tricky Point:
Some codes use two different operations within the same word (e.g., odd positions added, even positions subtracted).
Always test both possibilities before finalizing.
5. Example Problem (With Full Solution)
Problem
The following word‑code pairs are given:CODE → 3 15 4 5 CODE → 28 20 6 5 CODE → 3 15 4 5Find the code for the word “TAPE”.
Solution
- Convert each letter to its alphabetic position:
- C=3, O=15, D=4, E=5 →
3 15 4 5- T=20, A=1, P=16, E=5 →
20 1 16 5- Observe the first pair:
3 15 4 5→ same as positions.- Second pair:
28 20 6 5– note the third number is6instead of4.
So, something is added to the third letter only.- Difference: 6–4 = 2.
- Check if the third letter of the second word is
D→ 4+2=6.- Apply the same rule to TAPE:
- T=20, A=1, P=16, E=5
- Add 2 to the third letter (P): 16+2 = 18.
- Resulting code:
20 1 18 5.- Answer:
20 1 18 5.
Key Insight: Only the third letter got modified; all others stay as alphabetic positions.
6. Hard Practice Question (Answer below)
Question
The following coding pattern is used:1. HINDI → 8 9 14 4 9 2.