In short
Coding-decoding tests whether you can spot a hidden rule that turns a word, number or sentence into a "code", and then apply the same rule in reverse or to a new item. Nothing is memorised about the code itself - the rule is always derivable from the example given in the question. It is a guaranteed scoring area in campus aptitude tests (TCS NQT, Infosys, Wipro NLTH, Capgemini, Cognizant, Accenture, HCL, L&T, AMCAT, eLitmus, CoCubes) and in SSC CGL/CHSL, IBPS and SBI PO/Clerk, RRB NTPC, CAT/CMAT and most state PSC papers. University syllabi carry it under "Logical Reasoning" / "Soft Skills and Aptitude" papers of the AICTE model curriculum and UGC-CBCS; GATE's General Aptitude section rarely asks it directly, but the same alphabet-position skill appears in its analytical aptitude questions. Expected solving time is 25-40 seconds per question, so speed comes from one thing: knowing letter positions cold.
Explained
The one table everything rests on
- Forward positions: A=1, B=2, C=3 ... Z=26. Memorise the anchors EJOTY (E=5, J=10, O=15, T=20, Y=25) and AFKPUZ (1, 6, 11, 16, 21, 26); every other letter is one or two steps from an anchor.
- Reverse (opposite) position: the opposite of a letter at position n is at 27 − n. So the pairs are AZ, BY, CX, DW, EV, FU, GT, HS, IR, JQ, KP, LO, MN - every pair sums to 27.
- Letters between two letters = |n₂ − n₁| − 1. Between H(8) and P(16) there are 16 − 8 − 1 = 7 letters.
- Wrap-around (cyclic alphabet): after Z you return to A. For a shift of +k, position = n + k, and subtract 26 if the result exceeds 26. X(24) + 4 = 28 → 28 − 26 = 2 = B.
- General method for ANY question: (1) write the letter positions of the given word and its code one below the other, (2) take the difference, (3) check whether the difference is constant, alternating, increasing, or whether the letters have been reordered, (4) apply the same rule to the asked word, (5) match with the options.
Letter-coding types
- Constant forward shift (Caesar type): every letter moves the same number of steps right. TEACHER → VGCEJGT is a uniform +2.
- Constant backward shift: every letter moves left by the same number. BRAIN → AQZHM is −1.
- Variable / increasing shift: the shift grows letter by letter - +1, +2, +3, +4... WATER → XCWIW.
- Alternating shift: odd-placed letters move one way, even-placed the other, e.g. +1, −1, +1, −1.
- Opposite-letter (complementary) coding: each letter is replaced by its 27 − n partner. HOTEL → SLGVO.
- Reversal coding: the word is written backwards, then shifted. MONKEY → reverse YEKNOM → each letter −1 → XDJMNL.
- Interchange (pairwise swap) coding: adjacent letters trade places. FRIEND → RF | EI | DN → RFEIDN.
- Letter-by-letter substitution: a fixed one-to-one mapping with no arithmetic pattern; decode by building the mapping table from the example, for example if MANGO → PQRST then M↔P, A↔Q and so on.
- Mixed coding: a shift plus a reversal, or a shift plus insertion of an extra symbol - treat the transformations one at a time, in order.
Number and symbol coding
- Letter → number: each letter is replaced by its position (direct) or by 27 − n (reverse), sometimes then multiplied, halved or squared.
- Word → single number: the code is a function of the word. Check, in this order, the sum of positions, the product, the average (sum ÷ number of letters), the sum of positions minus/plus the number of letters, or the number of letters itself.
- Number → letter: a digit-to-letter key is given (1=A, 2=P, ...) and you encode or decode a given numeral.
- Symbol coding: vowels, consonants, odd digits or even digits are each replaced by a symbol such as @, #, %, giving a code like "@3#K%".
- Operation coding (symbol substitution in arithmetic): "If + means ×, × means ÷, ÷ means −, − means +, find 16 + 4 ÷ 2 − 8 × 4." Replace the symbols first, then apply BODMAS strictly.
- Mathematical-relation coding: the code of a word is derived from an arithmetic operation on positions, e.g. (sum of first and last letter positions) × number of letters.
Coded language (sentence coding)
- Classic word-substitution type: three or four coded sentences are given with their meanings, but the word order in the code is scrambled. Find the common word between two sentences; the code common to the same two sentences is its code. Repeat until all words are fixed.
- Rule of thumb: a word appearing in two sentences is identified from the code appearing in those same two sentences. If two words are common to the same pair of sentences, you need a third sentence to separate them, and if no third sentence exists the answer is "cannot be determined".
- New-pattern (bank PO) type: each word is coded by a derived token - for example number of letters + last letter ("MARKET" → "6T"), or first letter + position of last letter ("BUDGET" → "B20"), or vowels removed. Identify the rule from two or three given words, then apply it.
- Conditional / matrix coding (SSC and bank clerk type): a digit-to-letter key is given along with two to four conditions (if the first digit is even and the last odd, code both as X; if both are odd, interchange their codes, etc.). Check the conditions in the order printed, apply only the first one that fits unless the paper says otherwise, and code the remaining digits normally.
- Fictitious-language / analogy coding: "If 'pen' is called 'book' and 'book' is called 'table', what do you write with?" - answer with the NEW name of the real object (here, "book").
Decoding: working the rule backwards
- To decode, invert the operation: if encoding was +3, decode with −3; if it was 27 − n, apply 27 − n again (it is self-inverse, like the opposite-letter rule).
- Read the question stem carefully: "how is X written in that code" needs encoding, while "what does PQRS stand for" needs decoding. Reversing the direction by mistake is the single biggest source of lost marks in this topic.
- When two rules both fit the example (common with short words), test both against the options; the correct rule will match exactly one option.
- If a shift crosses Z while encoding or crosses A while decoding, apply the ±26 wrap before matching.
Strategy, strengths and limits
- Options are part of the method. Often you need to code only the first and last letter of the asked word to eliminate three options.
- Strengths of the topic: fully rule-based, no outside knowledge, no ambiguity in a well-set question, and high accuracy is achievable with practice - it is where candidates build the buffer of marks that covers slower topics such as puzzles.
- Limits: a badly set question can admit two rules; very long coded-language sets eat time, so attempt them last; and questions asking for a code that is not derivable from the given data must be answered "cannot be determined" rather than guessed.
- Common exam weightage (indicative, varies by paper and year): 1-3 questions in SSC CGL Tier-1, 3-5 in a typical IBPS/SBI prelims reasoning section, 1-2 in most campus aptitude rounds. Check the latest official notification, as patterns change.
Key points
- Letter position - A=1 to Z=26; EJOTY (5, 10, 15, 20, 25) is the fastest anchor set.
- Opposite letter - position 27 − n; AZ, BY, CX ... MN, each pair summing to 27.
- Caesar/constant shift - all letters move by the same k; detect by a constant difference row.
- Variable shift - differences form a series such as +1, +2, +3; check the pattern of differences, not just the first.
- Cyclic wrap - subtract 26 if a position exceeds 26, add 26 if it falls below 1.
- Reversal coding - write the word backwards first, then shift; very common with 6-letter words.
- Interchange coding - adjacent letters swap in pairs; an odd-length word leaves the last letter unchanged.
- Sum coding - word's number code = Σ letter positions; test average and product before giving up.
- Letters between - |n₂ − n₁| − 1, used in series-flavoured coding questions.
- Coded language method - match the common WORD with the common CODE across two sentences.
- Cannot be determined - a legitimate answer when a word appears in only one sentence with no unique code.
- Conditional coding - apply the conditions in the printed order; only the first matching condition usually applies.
- Operation coding - substitute the symbols first, then solve by BODMAS.
- Fictitious naming - always answer with the substituted (new) name, never the real one.
- Self-inverse rules - opposite-letter coding and pairwise interchange decode by reapplying themselves.
- Direction check - confirm whether the question asks you to encode or to decode before you start.
- Option elimination - coding the first and last letter alone usually settles the answer.
- Relation to cryptography - a constant shift is exactly a Caesar cipher (ROT13 is shift 13), and substitution coding is a monoalphabetic cipher.
Formulas and examples
Reverse (opposite) position: n' = 27 − n ; therefore n + n' = 27 for every letter pair
Shift coding: coded position = n + k (mod 26); subtract 26 if n + k > 26, add 26 if n + k < 1. k = shift (positive = forward, negative = backward)
Number of letters strictly between two letters: |n₂ − n₁| − 1
Sum code of a word: C = Σ nᵢ over all letters ; Average code: C = (Σ nᵢ) / L, where L = number of letters
Product code: C = Π nᵢ ; Length-last-letter code: C = L followed by the last letter
Example 1 - constant and variable shift. (a) TEACHER is coded VGCEJGT. Find the code for STUDENT.
- T(20)→V(22), E(5)→G(7), A(1)→C(3): a constant shift of +2.
- S(19)→U, T(20)→V, U(21)→W, D(4)→F, E(5)→G, N(14)→P, T(20)→V → UVWFGPV.
(b) WATER is coded XCWIW. Find the code for FIRE.
- W(23)→X(24) is +1, A(1)→C(3) is +2, T(20)→W(23) is +3, E(5)→I(9) is +4, R(18)→W(23) is +5: shift increases by 1.
- F(6)+1=G(7), I(9)+2=K(11), R(18)+3=U(21), E(5)+4=I(9) → GKUI.
Example 2 - opposite-letter coding. HOTEL is coded SLGVO. Find the code for MANGO.
- H(8) → 27 − 8 = 19 = S ✓; O(15) → 12 = L ✓; T(20) → 7 = G ✓; E(5) → 22 = V ✓; L(12) → 15 = O ✓. Rule: 27 − n.
- M(13) → 14 = N; A(1) → 26 = Z; N(14) → 13 = M; G(7) → 20 = T; O(15) → 12 = L → NZMTL.
Example 3 - reversal plus shift. PARIS is coded TJSBQ. Find the code for DELHI.
- Reverse PARIS = S I R A P; positions 19, 9, 18, 1, 16; add 1 → 20, 10, 19, 2, 17 = T J S B Q ✓. Rule: reverse the word, then +1.
- DELHI reversed = I H L E D → 9, 8, 12, 5, 4 → +1 → 10, 9, 13, 6, 5 = JIMFE.
Example 4 - number coding by sum and by average. (a) TEA = 26. Find the code for COFFEE.
- T(20) + E(5) + A(1) = 26 ✓, so the code is the sum of positions.
- C(3) + O(15) + F(6) + F(6) + E(5) + E(5) = 40.
(b) SUN = 18. Find the code for RAT.
- S(19) + U(21) + N(14) = 54; 54 ÷ 3 = 18 ✓, so the code is the average of positions.
- R(18) + A(1) + T(20) = 39; 39 ÷ 3 = 13.
Example 5 - coded language. In a code: "risk free zone" = "la pa ni"; "zone of code" = "ni ta ka"; "free code only" = "pa ka sa". Find the codes for "risk", "only" and "of".
| Step | Common word | Common code | Conclusion |
|---|---|---|---|
| Sentences 1 and 2 | zone | ni | zone = ni |
| Sentences 1 and 3 | free | pa | free = pa |
| Sentences 2 and 3 | code | ka | code = ka |
| Sentence 1 leftover | risk | la | risk = la |
| Sentence 2 leftover | of | ta | of = ta |
| Sentence 3 leftover | only | sa | only = sa |
Example 6 - conditional digit coding. Key: 1=A, 2=P, 3=M, 4=K, 5=R, 6=D, 7=E, 8=J, 9=T, 0=B. Conditions, checked in order: (i) if the first digit is even and the last odd, code both as X; (ii) if the first and last are both odd, code both as Y; (iii) if the first is odd and the last even, interchange their codes.
| Number | Condition that applies | Code |
|---|---|---|
| 683574 | first 6 even, last 4 even - none | DJMREK |
| 42957 | (i) first even, last odd | XPTRX |
| 57214 | (iii) first odd, last even - swap R and K | KEPAR |
| 31975 | (ii) both odd | YATEY |
Example 7 - operation coding. If + means ×, × means ÷, ÷ means −, and − means +, evaluate 16 + 4 ÷ 2 − 8 × 4.
- Substitute: 16 × 4 − 2 + 8 ÷ 4 → BODMAS: 64 − 2 + 2 = 64.
| Type | Clue that identifies it | Decoding move |
|---|---|---|
| Constant shift | Same difference for all letters | Shift by −k |
| Variable shift | Differences in a series | Reverse the series of shifts |
| Opposite letter | Differences alternate large/small, pairs sum to 27 | Reapply 27 − n |
| Reversal (+shift) | First letter of code matches last letter of word | Un-shift, then reverse |
| Interchange | Same letters, order swapped in pairs | Swap the pairs back |
| Sum/average number code | A single number for a whole word | Not uniquely decodable |
Where it is used
- Campus placement aptitude rounds: the logical-reasoning block of TCS NQT, Infosys, Wipro NLTH, Capgemini, Cognizant, Accenture, HCL and L&T tests, and third-party platforms AMCAT, eLitmus, CoCubes and HackerRank aptitude sets.
- Government and banking recruitment: SSC CGL/CHSL/MTS, IBPS and SBI PO and Clerk, RBI Assistant, RRB NTPC and Group D, LIC AAO, state PSC prelims, and defence entries such as CDS and AFCAT.
- Management entrances: CAT (logical reasoning sets), XAT, CMAT, MAT, SNAP, and NMAT, plus MBA group-exercise puzzles.
- Information security and software roles: the same idea scaled up - Caesar and ROT13 shifts, monoalphabetic substitution and classical ciphers taught in cryptography and network-security papers at Indian universities; QA and automation engineers write small encode/decode utilities and test them.
- Data and operations work: designing or reading internal codes - PNR and waybill formats, IFSC and PIN structures, SKU and batch codes, employee ID schemes - all require reading a position-based rule and applying it consistently.
- Teaching and test development: faculty and content teams at Indian coaching and ed-tech firms set these items, and school-level olympiad and NTSE mental-ability papers use the same patterns.
Interview questions
- Q: What is the opposite letter of G and how did you get it? A: 27 − 7 = 20, which is T, because every opposite pair of letters sums to 27.
- Q: If HOTEL is SLGVO, how is MANGO coded? A: NZMTL, using the opposite-letter rule 27 − n on each letter.
- Q: TEACHER is VGCEJGT - what is the rule and the code for STUDENT? A: A uniform forward shift of two letters, so STUDENT becomes UVWFGPV.
- Q: How do you tell a reversal code from a substitution code quickly? A: Compare the first letter of the code with the last letter of the word - if they are the same or differ by the same small shift as the rest, the word has been reversed.
- Q: How many letters lie between D and M? A: 13 − 4 − 1 = 8 letters.
- Q: In a coded sentence set, how do you find one word's code? A: Take a word common to two sentences; the code common to those two sentences is its code, and you repeat this to fix the rest.
- Q: When is "cannot be determined" the right answer in coded language? A: When the asked word appears in only one sentence, or when two words and two codes are common to the same pair of sentences with no third sentence to separate them.
- Q: If + means ×, × means ÷, ÷ means −, − means +, what is 16 + 4 ÷ 2 − 8 × 4? A: Substituting gives 16 × 4 − 2 + 8 ÷ 4 = 64 − 2 + 2 = 64.
- Q: Coding-decoding in an aptitude test versus encryption in software - what is the link? A: A constant-shift code is exactly a Caesar cipher and a letter-mapping code is a monoalphabetic substitution cipher; both are trivially breakable by frequency analysis, which is why real systems use AES or RSA.
- Q: If 'SUN' is 18 and the rule is not the sum, what else would you test? A: The average - 19 + 21 + 14 = 54, and 54 ÷ 3 = 18 - then the product, and the sum adjusted by the word length.
- Q: Why do examiners put conditions on digit coding questions? A: To test whether you read instructions in order and apply only the first matching condition, rather than mechanically substituting the key.
- Q: What would you do if a shift takes a letter past Z? A: Wrap cyclically by subtracting 26 from the position, so X plus 4 gives position 2, which is B.
Common mistakes
- Encoding when the question asks you to decode, or the reverse - always re-read the stem before matching options.
- Assuming a constant shift from the first two letters only; the shift may increase, alternate or apply only to vowels.
- Forgetting the ±26 wrap at the ends of the alphabet, which turns a correct rule into a wrong option.
- Mixing up forward and reverse positions, or misremembering the opposite-letter sum as 26 instead of 27.
- In coded sentences, matching codes by position in the sentence - the order of code words is deliberately scrambled.
- Applying every condition in a conditional-coding question instead of only the first one that fits, and ignoring the order in which the conditions are printed.
- Spending two minutes deriving a rule when coding just the first and last letter would have eliminated all wrong options.
Related topics
Number and letter series · Analogies and classification · Input-output · Non-verbal reasoning: figures and patterns · Data sufficiency · Cryptography basics: classical ciphers