Why this topic matters · 7 min read
Coding-Decoding appears in CSAT Prelims as 2-4 questions (out of 80). It tests pattern recognition and logical substitution. Questions range from simple letter-shift ciphers to positional number codes. High accuracy is expected because these are typically 'solvable' questions — missing them costs marks unnecessarily. Focus on identifying the rule quickly, not memorizing cipher types.
What is Coding-Decoding?
Coding is a system where letters, numbers, or symbols are replaced by other letters, numbers, or symbols following a fixed rule. Decoding is reversing that rule to find the original message. In UPSC CSAT, you are given a coded word and must find the pattern, then apply it to decode another word or encode a new one. The key skill is pattern spotting under time pressure — not cryptography expertise.
- Coding = applying a rule to transform plain text into cipher text
- Decoding = reverse-engineering the rule and recovering original text
- Rule can be positional (A=1, B=2...), alphabetic shift (A→B, B→C), or positional arithmetic
- UPSC questions rarely use complex multi-step ciphers; rules are usually single-layer
- Time per question: 1.5-2 minutes max; if stuck after 90 seconds, move on
Common Coding Patterns in UPSC CSAT
UPSC favors a small set of repeating patterns. Recognizing these instantly saves time. The most frequent are: (1) Caesar Cipher (fixed shift), (2) Reverse Alphabet (A↔Z, B↔Y), (3) Position-to-Number (A=1, B=2, etc.), (4) Position-based arithmetic (sum of positions, products), and (5) Positional rearrangement (letters rearranged by position rule). Rarely, questions mix two rules (e.g., shift + reverse).
- Caesar Cipher: each letter shifts by fixed amount (e.g., A→D, B→E if shift=3)
- Reverse Alphabet: A↔Z, B↔Y, C↔X (position from start = position from end, mirrored)
- Position-to-Number: A=1, B=2, ..., Z=26; word coded as sum or product of positions
- Positional Rearrangement: letters reordered by a fixed sequence (e.g., 3-1-4-2 means 3rd letter first, then 1st, etc.)
- Mixed: rare but watch for shift + reversal or shift + position swap
Step-by-Step Decoding Method
When you see a coding question, follow this sequence: (1) Identify what you are given (plain word + coded word, or just coded word + rule). (2) Spot the pattern by comparing first letters, checking if it is alphabetic shift, positional, or rearrangement. (3) Verify the pattern with at least 2-3 letters. (4) Apply to the target word. (5) Double-check your answer against the pattern. This systematic approach prevents careless errors.
- Step 1: Read carefully — are you given the code rule explicitly or must you infer it?
- Step 2: Compare plain and coded versions letter-by-letter; check shift amount, position changes, or numeric values
- Step 3: Test your hypothesis on a second or third letter to confirm consistency
- Step 4: Apply rule to the target word methodically, letter by letter
- Step 5: Sanity-check: does the answer make sense? Is it a valid pattern application?
Reverse Alphabet Cipher (High-Frequency in UPSC)
This is the most common UPSC pattern. A maps to Z, B to Y, C to X, and so on. The formula is: coded position = 27 - plain position. For example, A (position 1) becomes Z (position 26), B (position 2) becomes Y (position 25). This is symmetric: applying it twice returns the original. Always check if the answer looks like a real word — reverse alphabet often produces nonsense, which helps you verify.
- Rule: Position of coded letter = 27 - position of plain letter
- 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
- Mnemonic: 'A is 1st, Z is 26th; they swap. B is 2nd, Y is 25th; they swap.'
- Self-inverse: applying twice gives original word
- If decoded word is gibberish, likely wrong rule — try Caesar shift instead
Position-to-Number and Arithmetic Coding
Words are converted to numbers based on letter positions (A=1, B=2, ..., Z=26). The code might be the sum of all positions, product, or a sequence of individual numbers. Example: CAT = 3+1+20 = 24, or CAT = 3,1,20. Reverse: given 24, find word whose letters sum to 24. This requires quick mental arithmetic and sometimes trial-and-error. Watch for multi-letter answers.
- A=1, B=2, C=3, ..., Z=26 (memorize first 5 and last 5 for speed)
- Sum coding: add all letter positions; decode by finding word matching that sum
- Sequence coding: each letter becomes its number; decode by converting numbers back
- Product coding: rare; multiply positions (usually gives large numbers)
- Trap: multiple words can have same sum; context or answer choices disambiguate
Positional Rearrangement (Letter Shuffling)
Letters of a word are rearranged according to a fixed sequence. Example: if the rule is 3-1-4-2, the 3rd letter moves to position 1, 1st letter to position 2, 4th to position 3, 2nd to position 4. This is less common than shift ciphers but appears in 1-2 CSAT papers per year. Identify the rearrangement by comparing positions of known letters.
- Rule given as sequence: 3-1-4-2 means 3rd letter first, 1st second, 4th third, 2nd fourth
- To decode: reverse the sequence (if encoding is 3-1-4-2, decoding is 2-4-1-3)
- Identify by noting which position each letter moved to in the example
- Verify with at least 2 letters before applying to target word
- Rare in CSAT but high-confidence once pattern is spotted
⚠ Common mistakes to avoid
- Confusing encoding direction: if WORD codes to ZRUG, assume shift of +7, but then apply -7 to decode — many reverse this and get wrong answer.
- Assuming rule applies to whole word when it applies letter-by-letter: position rearrangement is per-letter, not per-word.
- Not verifying pattern on second letter: spot-checking only first letter leads to false confidence; always test on 2-3 letters.
- Arithmetic errors in position-to-number: forgetting A=1 (not 0) or miscounting positions; double-check with fingers if needed.
- Overthinking: assuming a complex multi-step cipher when UPSC uses simple single rules; Occam's Razor applies — simplest pattern is usually correct.
🧠 Memory aids
- CARP: Caesar (shift), Alphabet-reverse (A↔Z), Rearrangement (shuffle), Position-to-number (A=1). Check these four in order when stuck.
- Reverse Alphabet = 27 minus position. A=1→Z=26, B=2→Y=25. Think 'mirror alphabet.'
- Position-to-Number: A=1, Z=26. Memorize A-E (1-5) and V-Z (22-26) for quick lookup.
- If decoded word is gibberish, wrong rule — switch to next pattern immediately.
🎯 UPSC CSE exam tips
- CSAT Prelims: 2-4 questions per paper, each worth 2.5 marks (80 total). Coding-Decoding is considered 'solvable' — missing these is costly. Allocate 1.5-2 min per question; if pattern not clear in 90 seconds, flag and return.
- Question format: usually 'If WORD is coded as ZRUG, how is YEAR coded?' or 'Decode: ZYXW.' Rarely, rule is stated explicitly (e.g., 'each letter shifts by 3').
- Reverse Alphabet and Caesar Cipher account for ~70% of CSAT questions; master these two first.
- Position-to-Number questions often appear with multiple-choice answers that are numbers or sums — use answer choices to verify your arithmetic.
- Recent trend (2020-2023): mixing simple patterns (e.g., shift + reverse) in harder papers; if single rule fails, try combination of two rules.
Q1 · hard · AI-verified
If BIRD is encoded as 2-9-18-4, then how is FLIGHT encoded?
- 6-12-9-7-8-20
- 6-12-10-8-8-21
- 6-12-9-7-7-20
- 5-11-8-6-7-19
Q2 · hard · AI-verified
If SCIENCE is coded as 19-3-9-5-14-3-5 and KITCHEN is coded as 11-9-20-3-8-5-14, then how is HISTORY coded?
- 8-9-19-20-15-18-24
- 8-9-19-20-14-18-25
- 8-9-19-20-15-18-25
- 8-10-19-20-15-18-25
Q3 · hard · AI-verified
If APPLE is coded as BQQMF, then how is MANGO coded?
- OCPIQ
- NBOHP
- NBPIP
- MBOGP
Q4 · hard · AI-verified
If BOOK is coded as 2-15-15-11 and TREE is coded as 20-18-5-5, then how is MOON coded?
- 13-15-15-14
- 14-15-15-13
- 13-14-14-15
- 13-15-14-15
Q5 · easy · PYQ 2025
If NO is coded as 210, NOT is coded as 4200 and NOTE is coded as 21000, then how is NOTES coded?
- 399000
- 420000
- 440000
- 630000