Skip to content

Tuesday, 6 October 2026 · New Delhi

CSAT· Prelims

Coding-Decoding for CSAT: Concepts, Patterns and Practice

Master the hidden rules behind CSAT coding questions: letter shifts, reversals, number codes, and sentence coding, with solved UPSC examples.

By the RaahUPSC editorial desk29 September 2026Updated 30 September 202612 min readintermediate

Coding-decoding is the skill of uncovering the hidden rule that converts a word, a sentence, or a set of numbers into a code, and then applying that same rule to a new input. Every question hands you at least one worked pair, such as SYSTEM written as SYSMET, and asks you to encode or decode something fresh with the identical rule. In CSAT Paper II, the qualifying paper of the UPSC prelims that demands 33 percent to clear, coding questions are among the most scoring items: they test pure pattern recognition, need no memorised facts, and usually fall in under a minute once the method is internalised.

What a code really is

A code is a fixed, repeatable transformation. The plaintext is the original word or number, and the coded form is what the rule produces. Because the rule never changes inside one question, your whole job is rule detection: compare the plaintext with its code letter by letter, spot the operation, and replay it. UPSC's coding questions fall into five families: letter coding (letters become other letters), number coding (letters become numbers), direct substitution (each letter stands for a fixed symbol or digit), sentence coding (whole phrases map to code words), and mixed coding (digits stand for whole words).

Start every question by writing the alphabet with positions 1 to 26 under it. Half the battle in letter coding is simply knowing that M is the 13th letter or that the letter three steps before F is C. The classic memory aid EJOTY marks the 5th, 10th, 15th, 20th, and 25th letters (E, J, O, T, Y), giving you anchor points from which any position is at most two steps away. Also memorise reverse positions: A is 26th from the end, B is 25th, and so on, because many codes are built on the reversed alphabet where A becomes Z, B becomes Y, and each pair sums to 27.

The standard coding patterns

Nearly every UPSC coding question uses one of the patterns below, sometimes in combination. Learn to recognise each by its fingerprint, the tell-tale sign in the first pair you are given.

Pattern

Fingerprint

Example

Forward or backward shift

Each letter moves by the same number of steps

DELHI becomes CCIDD (each letter steps back 1, 2, 3, 4, 5)

Alternating shift

Odd and even positions move differently

MATHEMATICS becomes LBSIDNZUHDR (minus 1, plus 1, minus 1, plus 1, and so on)

Full reversal

Code is the word written backwards

POT becomes TOP, then prefixed, giving ATOP

Half reversal

Each half of the word is reversed separately

SYSTEM becomes SYSMET; FRACTION becomes CARFNOIT

Position arithmetic

Letter positions are added, multiplied, or concatenated

ABCD becomes 24 (1 x 2 x 3 x 4); GHI becomes 1578

Direct substitution

Each letter always stands for the same digit or symbol

FRANCE is 654321 and GERMANY is 9158437, so YEMEN is 71813

Sentence coding

Common words across phrases share code words

'tar sar par' is 'drink fruit juice' and 'sar kee lar' is 'juice is sweet', so 'sar' is 'juice'

Worked examples

Example 1 (half reversal). A military code writes SYSTEM as SYSMET and NEARER as AENRER. How is FRACTION written? Split SYSTEM into two halves of three letters: SYS and TEM. The first half stays SYS, the second reverses to MET, giving SYSMET. Check with NEARER: NEA stays, RER reverses to RER, giving AENRER, which matches. Apply to FRACTION: halves FRAC and TION reverse to CARF and NOIT, giving CARFNOIT. This is a CSAT 2016 question, and the halves need not be equal only when the word length is odd; here all words are even.

Example 2 (alternating shift). In a code language MATHEMATICS is written as LBSIDNZUHDR. Write CHEMISTRY in the same code. Compare letter by letter: M to L is minus 1, A to B is plus 1, T to S is minus 1, H to I is plus 1. The pattern alternates minus 1, plus 1 down the whole word. Apply to CHEMISTRY: C minus 1 is B, H plus 1 is I, E minus 1 is D, M plus 1 is N, I minus 1 is H, S plus 1 is T, T minus 1 is S, R plus 1 is S, Y minus 1 is X. The answer is BIDNHTSSX, asked in CSAT 2021. Always verify the alternation on at least four letters before applying it.

Example 3 (position arithmetic). The letters A to Z are numbered 1 to 26. If GHI is 1578 and DEF is 912, what is ABC? Write the positions: GHI is 7, 8, 9. Concatenated, that is 789, and 789 times 2 is 1578. Check: DEF is 4, 5, 6, concatenated 456, times 2 is 912, which matches. So ABC is 123 times 2, giving 246 (CSAT 2020). When a code number looks too large for the word, suspect multiplication or concatenation of positions.

Example 4 (sentence coding). '256' means 'red colour chalk', '589' means 'green colour flower', and '254' means 'white colour chalk'. Which digit stands for 'white'? Find the word common to all three phrases: 'colour' appears everywhere, and the digit 5 appears in all three codes, so 5 is 'colour'. 'Chalk' appears in the first and third phrases; the digits common to codes 1 and 3 are 2 and 5, and 5 is already 'colour', so 2 is 'chalk'. In the third code, 254, the remaining digit 4 must be 'white'. Answer: 4 (CSAT 2017). In sentence coding, always match the common words first and eliminate.

Example 5 (reversed alphabet). The order of the alphabet is reversed and each letter stands for the letter in its position, so A is written as Z, B as Y, and so on. Which code represents LUCKNOW? The rule is that the nth letter from the start is replaced by the nth letter from the end, and each such pair sums to 27. L is 12th, so it becomes the 12th from the end, which is O (12 + 15 = 27). Similarly U (21) becomes F, C (3) becomes X, K (11) becomes P, N (14) becomes M, O (15) becomes L, W (23) becomes D. The code is OFXPMLD (CSAT 2022).

Common traps

The costliest mistake is assuming the shift is constant after checking only the first letter. UPSC loves the alternating shift, where the first letter moves minus 1 and the second moves plus 1; checking two letters is not enough, check four. A second trap is the increasing shift, where the steps grow (minus 1, minus 2, minus 3), as in MUMBAI to LSJXVC asked in CSAT 2018. A third trap appears in sentence coding: students match words by position instead of by commonality, but code words need not sit in the same order as the plaintext words. Finally, in number coding, do not assume A is 1 until the pair confirms it; some codes use reversed positions or sums of digits.

Watch the odd-length word in reversal questions. If a word has seven letters and the rule reverses each half, the middle letter usually stays fixed, and options are designed to punish anyone who reverses the whole word. Also, when options are very close (CARFTION versus CARFNOIT in CSAT 2016), write the code out fully instead of choosing by glance.

Speed tips for the exam hall

  • Write A to Z with 1 to 26 once on the rough sheet and reuse it for every coding question in the set.

  • Compare the first and last letters of the pair first: if the last letter moved the same way as the first, suspect a constant shift; if not, suspect alternation or reversal.

  • For reversal patterns, physically split the word into halves with a slash before reversing anything.

  • In sentence coding, list each phrase's words and circle the ones that repeat; the repeated words unlock the repeated code words.

  • When stuck between two options, test the rule on the second given pair (if any) rather than re-deriving from scratch.

Key Terms

  • Code: the transformed form of a word, phrase, or number produced by applying a fixed rule.

  • Plaintext: the original, unencoded word or number before the coding rule is applied.

  • Letter coding: a question type in which each letter of a word is replaced by another letter according to a positional rule such as a shift or reversal.

  • Number coding: a question type in which letters are converted into numbers using their alphabet positions, sums, or products.

  • Direct substitution: a code in which every letter always stands for the same fixed digit or symbol across all given examples.

  • Sentence coding: a question type in which whole phrases are coded, and the code for each word is found by comparing words that repeat across phrases.

  • EJOTY: a memory aid for alphabet positions: E is 5th, J is 10th, O is 15th, T is 20th, and Y is 25th.

  • Reverse alphabet position: the position of a letter counted from Z backwards; each letter and its reverse partner sum to 27, so A pairs with Z and B pairs with Y.

  • Alternating shift: a coding pattern in which letters at odd positions move one way and letters at even positions move another way.

Practice questions

Q1Prelims practice

A military code writes SYSTEM as SYSMET and NEARER as AENRER. Using the same code, FRACTION can be written as [UPSC CSE 2016]

Show answer

Answer: (D) Split each word into halves and reverse each half: FRAC becomes CARF and TION becomes NOIT, giving CARFNOIT.

Q2Prelims practice

In a certain code, '256' means 'red colour chalk', '589' means 'green colour flower' and '254' means 'white colour chalk'. The digit in the code that indicates 'white' is [UPSC CSE 2017]

Show answer

Answer: (B) The digit 5 is common to all three codes, so it is 'colour'. Digits 2 and 5 are common to the first and third codes, so 2 is 'chalk'. The remaining digit 4 in '254' must be 'white'.

Q3Prelims practice

If RAMON is written as 12345 and DINESH as 675849, then HAMAM will be written as [UPSC CSE 2018]

Show answer

Answer: (B) Read the digit for each letter from the two examples: H is 9, A is 2, M is 3. So HAMAM is 9-2-3-2-3, which is 92323.

Q4Prelims practice

If LSJXVC is the code for MUMBAI, the code for DELHI is [UPSC CSE 2018]

Show answer

Answer: (A) Each letter steps back by an increasing amount: M-1 is L, U-2 is S, M-3 is J, B-4 is X, A-5 is V, I-6 is C. Apply the same to DELHI: D-1 is C, E-2 is C, L-3 is I, H-4 is D, I-5 is D, giving CCIDD.

Q5Prelims practice

The letters from A to Z are numbered from 1 to 26 respectively. If GHI = 1578 and DEF = 912, then what is ABC equal to? [UPSC CSE 2020]

Show answer

Answer: (D) GHI are positions 7, 8, 9, which concatenate to 789, and 789 x 2 = 1578. DEF is 456, and 456 x 2 = 912. So ABC is 123 x 2 = 246.

Q6Prelims practice

If the order of the letters in the English alphabet is reversed and each letter represents the letter whose position it occupies, then which one of the following represents 'LUCKNOW'? [UPSC CSE 2022]

Show answer

Answer: (D) Each letter is replaced by its mirror, with the pair summing to 27: L(12) becomes O(15), U(21) becomes F(6), C(3) becomes X(24), K(11) becomes P(16), N(14) becomes M(13), O(15) becomes L(12), W(23) becomes D(4). The result is OFXPMLD.

Q7Prelims practice

If in a certain code, 'ABCD' is written as 24 and 'EFGH' is written as 1680, then how is 'IJKL' written in that code? [UPSC CSE 2024]

Show answer

Answer: (A) The code is the product of the letter positions: 1 x 2 x 3 x 4 = 24 and 5 x 6 x 7 x 8 = 1680. So IJKL is 9 x 10 x 11 x 12 = 11880.

Q8Prelims practice

If NO is coded as 210, NOT is coded as 4200 and NOTE is coded as 21000, then how is NOTES coded?

Show answer

Answer: (A) The code is the product of the letter positions: 14 x 15 = 210, x 20 = 4200, x 5 = 21000. Multiplying further by S (19) gives 21000 x 19 = 399000.

Answer key

  • Q1 - (d). Split each word into halves and reverse each half: FRAC becomes CARF and TION becomes NOIT, giving CARFNOIT.

  • Q2 - (b). The digit 5 is common to all three codes, so it is 'colour'. Digits 2 and 5 are common to the first and third codes, so 2 is 'chalk'. The remaining digit 4 in '254' must be 'white'.

  • Q3 - (b). Read the digit for each letter from the two examples: H is 9, A is 2, M is 3. So HAMAM is 9-2-3-2-3, which is 92323.

  • Q4 - (a). Each letter steps back by an increasing amount: M-1 is L, U-2 is S, M-3 is J, B-4 is X, A-5 is V, I-6 is C. Apply the same to DELHI: D-1 is C, E-2 is C, L-3 is I, H-4 is D, I-5 is D, giving CCIDD.

  • Q5 - (d). GHI are positions 7, 8, 9, which concatenate to 789, and 789 x 2 = 1578. DEF is 456, and 456 x 2 = 912. So ABC is 123 x 2 = 246.

  • Q6 - (d). Each letter is replaced by its mirror, with the pair summing to 27: L(12) becomes O(15), U(21) becomes F(6), C(3) becomes X(24), K(11) becomes P(16), N(14) becomes M(13), O(15) becomes L(12), W(23) becomes D(4). The result is OFXPMLD.

  • Q7 - (a). The code is the product of the letter positions: 1 x 2 x 3 x 4 = 24 and 5 x 6 x 7 x 8 = 1680. So IJKL is 9 x 10 x 11 x 12 = 11880.

  • Q8 - (a). The code is the product of the letter positions: 14 x 15 = 210, x 20 = 4200, x 5 = 21000. Multiplying further by S (19) gives 21000 x 19 = 399000.

Frequently asked questions

How much time should a coding-decoding question take in CSAT?

A straightforward shift or reversal question should take 45 to 60 seconds once you are fluent with letter positions. Sentence coding sets with three phrases can take up to two minutes, but they usually yield two or three questions from one reading, which makes them excellent value.

Should I memorise the alphabet positions of all 26 letters?

Yes, or at least be able to recall any position within two seconds. The EJOTY anchors (E=5, J=10, O=15, T=20, Y=25) let you reach any letter quickly, and with a week of drilling most aspirants recall positions instantly.

What is the first thing to check when I see a coded pair?

Compare the first letter of the plaintext with the first letter of the code and note the shift, then do the same for the last letter. If both shifted equally, test a constant shift. If they differ, look for alternation, increasing shifts, or reversal before trying anything exotic.

Are sentence coding questions common in recent CSAT papers?

They appear regularly in the logical reasoning section. UPSC also uses digit-for-word codes, like 256 for 'red colour chalk' in CSAT 2017, which are solved with exactly the same common-word elimination method.

CsatCoding Decodingupsc-prelimsCsat Paper 2explained
Ask Raah