Coding–Decoding — SSC CGL Reasoning
A coding question gives you one plaintext–ciphertext pair and asks you to encode (or decode) a second word by the same rule. Like analogy and series, the rule comes from a closed menu. Your entire job: identify the cipher family fast, on paper, and apply it without slips.
1. What SSC actually asks
Tier 1: 2–4 questions · Tier 2: 3–4 questions. The six cipher families:
| # | Family | Example | Tell |
|---|---|---|---|
| 1 | Uniform shift | GARDEN → JDUGHQ (+3) | same gap every letter |
| 2 | Variable shift | CLOCK → DNRGP (+1,+2,+3,+4,+5) | growing/alternating gaps |
| 3 | Reversal / rearrangement | BREAD → DAERB | same letters, new order |
| 4 | Mirror (27-sum) | ACE → ZXV | pairs sum to 27 |
| 5 | Positional values | DOG → 4157 or sum 26 | digits appear |
| 6 | Substitution / word codes | "sky is blue" = "pa jo ka" | match words across sentences |
2. The method — always the same four steps
- Write positions under both words. (A=1…Z=26; EJOTY anchors.)
- Compute the per-letter gap (cipher − plain), including sign.
- Name the family from the gap pattern.
- Apply mechanically to the query word, wrapping mod 26.
Example. If MOBILE is coded as NQEMQK, how is TABLET coded? Gaps: M→N +1, O→Q +2, B→E +3, I→M +4, L→Q +5, E→K +6. Variable shift +1…+6. T+1=U, A+2=C, B+3=E, L+4=P, E+5=J, T+6=Z → UCEPJZ.
3. Number and mixed codings
- Letter-sum codes: DOG = 4+15+7 = 26; then CAT = 3+1+20 = 24. Watch for the variant that multiplies the sum ("×2") or adds the word length.
- Digit-position hybrids: A=1…Z=26 written per letter: BAD → 214.
- Reverse positions: A=26…Z=1 (i.e., 27 − position).
- Arithmetic disguise: "If 5 × 4 = 15, 8 × 6 = 42…" — the operator is redefined (here or … test both on all given pairs).
For redefined-operator questions, the rule must fit every given example. One fit is a hypothesis; two fits is an answer.
4. Sentence (substitution) codes
"'red and blue' = ka pa ni; 'blue is deep' = ni to su; 'sky is red' = to ka ro" — find the code for "deep".
Method: intersect. blue appears in sentences 1 & 2 → common code ni. red in 1 & 3 → ka. is in 2 & 3 → to. Sentence 2's leftover: deep = su.
Draw the grid; never intersect mentally. Some questions leave one word ambiguous — SSC then asks for exactly the resolvable one (or offers "cannot be determined", which is occasionally the right answer — check before forcing a mapping).
5. Solved PYQ-style examples
Q1. In a code, PENCIL is written as OFMDHM. How is BRUSH written? Gaps: P→O −1, E→F +1, N→M −1, C→D +1, I→H −1, L→M +1 → alternating −1/+1. B−1=A, R+1=S, U−1=T, S+1=T, H−1=G → ASTTG.
Q2. If STAR = 9612 and RATS = 2169 in some code, then ARTS = ? Per-letter mapping: S=9, T=6, A=1, R=2 → ARTS = 1269. (Substitution — no arithmetic needed; verify with the second word.)
Q3. If WATER is coded as XCWIW, how is MANGO coded? Gaps: W→X +1, A→C +2, T→W +3, E→I +4, R→W +5 — the growing shift +1…+5. M+1=N, A+2=C, N+3=Q, G+4=K, O+5=T → NCQKT. (One misread gap flips the family — recompute every gap on paper, never pattern-guess from the first two.)
Q4. 'pit nac mit' = "eat well food"; 'mit tim nac' = "enjoy well food". Code for "eat"? nac, mit are common → they map to {well, food}. So "eat" = pit (the leftover of sentence 1).
Q5. If LOTUS = 62 in a letter-sum code, then ROSE = ? L+O+T+U+S = 12+15+20+21+19 = 87 ≠ 62 — so the rule isn't a plain sum. Test sum of positions minus word length ×5: 87 − 25 = 62 ✓ (5 letters × 5). ROSE: 18+15+19+5 = 57 − 20 = 37. (Always reverse-engineer with the given total before assuming plain sum.)
6. Exam protocol
- Positions under letters, gaps with signs — 100% on paper.
- Two given examples? The rule must fit both.
- Mirror check first when gaps look chaotic: do plain+cipher positions sum to 27?
- Sentence codes: draw the intersection grid.
- Wrap mod 26 without fear: Y + 4 = C.
- Budget 30–40 seconds; coding questions are mechanical once the family is named.
