Sarkari RiseLogin

Coding-Decoding Questions for UPSC CSE

Free, AI-curated practice for the Coding-Decoding section of UPSC CSE. We have 10+ verified questions in this bank. Below: 5 sample questions. Sign up free to unlock unlimited practice + AI explanations + per-topic analytics.

▶ Start free — UPSC CSE mockAll UPSC CSE resourcesAlready a user? Sign in →
📍 Coding-Decoding is also tested in:
SSC CGL (124)SSC GD (94)SSC MTS (82)SSC CHSL (72)
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.

Sample questions

Q1 · hard · AI-verified
If APPLE is coded as BQQMF, then how is MANGO coded?
  1. OCPIQ
  2. NBOHP
  3. NBPIP
  4. MBOGP
Q2 · easy · PYQ 2025
If FRANCE is coded as 654321 and GERMANY is coded as 9158437, then how is YEMEN coded?
  1. 54321
  2. 81913
  3. 71913
  4. 71813
Q3 · easy · PYQ 2026
If ZERO is encoded as ADSN, then how do you encode STOP?
  1. SPOT
  2. TSPO
  3. TSOP
  4. POST
Q4 · hard · AI-verified
If BOOK is coded as 2 8 8 11 and COOK is coded as 3 8 8 11, then how is HOOK coded?
  1. 7 8 8 11
  2. 8 8 8 11
  3. 8 8 9 11
  4. 8 8 8 12
Q5 · 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?
  1. 8-9-19-20-15-18-24
  2. 8-9-19-20-14-18-25
  3. 8-9-19-20-15-18-25
  4. 8-10-19-20-15-18-25
💡 Want answers + explanations + 5+ more Coding-Decoding questions? Sign up free →
⭐ Recommended for UPSC CSE aspirants

UPSC Pro (180 days)

UPSC Prelims + Mains Essay Coach + Cutoff Planner
₹2,499~₹13.8/day
Sign up free, then unlockSee all plans →

More UPSC CSE topics

Ancient India
51+ practice questions
Modern India
43+ practice questions
Medieval India
41+ practice questions
Mineral Resources
40+ practice questions
Indian National Movement
39+ practice questions
Physical Geography of India
33+ practice questions

Free practice, AI explanations, 24 exams — all in one app

Daily 10-Q quiz · AI doubt solver in Hindi + English · adaptive mocks · 49,000+ practice questions (19,000+ verified PYQs).

Sign up freePricingTry Daily 10-Q