Coding-Decoding for AFCAT: Letter Shifts, Number Codes & Cipher Patterns

intermediate 18 min read

Concept

Coding-decoding questions give you a rule applied to one word and ask you to apply the same rule to another. The "code" is just a systematic transformation — shift every letter by a fixed amount, replace every letter with its alphabetical position, reverse the word, or some combination. Your job is not to memorize codes; it is to reverse-engineer the transformation rule from the given example, then apply it cleanly.

Think of it like a lock-and-key analogy. The examiner shows you one locked-and-opened pair (e.g., PLANE → QMBOF). The lock is the rule. Your task is to identify what kind of lock it is, then open the second word with the same key.

In AFCAT's reasoning section, coding-decoding questions are almost always from one of four families:

  1. Letter-shift codes — each letter shifts by a fixed number of positions (forward or backward) in the alphabet.
  2. Number-substitution codes — letters are replaced by their ordinal position (A=1, B=2, ..., Z=26) or a variant of it.
  3. Positional/reversal codes — letters are rearranged, reversed, or interleaved.
  4. Mixed codes — two transformations combined (e.g., shift + reversal).

The vast majority of AFCAT questions fall into families 1 and 2. If you can decode the rule within 20 seconds of reading the given pair, you will answer the question in under 60 seconds total. That is the target.

One more thing to internalize before going deeper: the alphabet has 26 letters. A=1, Z=26. After Z comes A again (wrap-around). This circular nature is what makes +1 shifts on Z give A, not some fictional letter. Keep that loop in your head at all times.


Deep Dive

Family 1 — Letter-Shift Codes (Caesar Ciphers)

This is the most common AFCAT type. Every letter in the original word is shifted by a constant value k to produce the coded letter.

How to find k: Take the first letter of the original word and the first letter of the coded word. Count the alphabetical distance between them. Verify with the second letter. If the same k holds, you have your rule.

Example: TIGER → UJHFS

Now apply to any word — take each letter's position, add 1, convert back to letter.

Wrap-around rule: If Z (26) shifts by +1, you get 27, which wraps to A (1). So Z+1 = A, Y+2 = A, etc. For backward shifts: A−1 = Z.

Spotting the shift quickly: Don't count letter by letter through the alphabet. Use the table of common positions you should already know:

A=1, E=5, I=9, J=10, M=13, N=14, P=16, R=18, S=19, T=20, Z=26

With these anchors, you can calculate any shift in 2–3 seconds without counting on fingers.

Family 2 — Number-Substitution Codes

Here, letters are replaced by their position number in the alphabet. A=1, B=2, C=3, ... Z=26. No shift involved — it is a direct lookup.

Example: BOOK → 2-15-15-11

To go in reverse: given a number, find the letter at that position.

Variants to watch for:

Family 3 — Reversal and Rearrangement Codes

The word itself is reversed (PLANE → ENALP) or letters are swapped in pairs (1st↔2nd, 3rd↔4th, etc.). These are less common in AFCAT but appear occasionally.

Detection: If the coded word contains all the same letters as the original, just in a different order — suspect reversal or rearrangement, not a shift.

Family 4 — Mixed Codes

Two rules applied together. The most common combo is: reverse the word, then shift each letter. Or: shift letters, then reverse.

Detection strategy: If a single shift or reversal doesn't explain the pattern fully, try combining two operations. Apply one, check if the result is a recognizable transformation of the coded word.

The Universal Detection Flowchart

When you see a new coding pair, run through this sequence:

  1. Are all letters the same set (just rearranged)? → Reversal/rearrangement.
  2. Are the coded letters numerals? → Number-substitution family.
  3. Do coded letters differ from originals by a consistent amount? → Shift code. Find k.
  4. Does each letter shift by a different amount? → Check if shifts follow a pattern (e.g., +1, +2, +3...). Or look for position-based shifts.
  5. Nothing works? → Try reverse first, then check shift.

Critical Alphabet Facts to Memorize

These cut your computation time in half:

| Letter | Position | Letter | Position | |--------|----------|--------|----------| | A | 1 | N | 14 | | E | 5 | P | 16 | | I | 9 | R | 18 | | J | 10 | S | 19 | | M | 13 | T | 20 | | K | 11 | Z | 26 |

The pairs that add up to 27 (A+Z, B+Y, C+X...) are also useful — they tell you the "opposite" letter, which matters in reverse-alphabet coding.


Memory Tricks & Shortcuts

patternThe +1 Anchor Test

When you see a coded pair, immediately check if the first coded letter is one ahead of the first original letter. If yes, test the second pair. If two consecutive pairs confirm +1, stop — apply +1 to every letter of the new word without checking further.

Worked example: HORSE → IPSTF. H(8)→I(9): +1. O(15)→P(16): +1. Confirmed in 4 seconds. Now encode the target word by adding 1 to each letter position. Standard approach (checking all 5 letters, then encoding): ~40s. This shortcut: ~15s.

patternPosition Table Recall — The AEIOU Anchors

Memorize only the vowel positions: A=1, E=5, I=9, O=15, U=21. Every consonant's position is then calculable by counting from the nearest vowel anchor.

Example: R is 3 after O (15+3=18). S is 4 after O (19). T is 5 after O (20). G is 2 after E (7). This beats counting from A every time.

For number-substitution questions: standard method of counting A-B-C-D... from scratch takes 8–12 seconds per letter. Anchor method: 2–3 seconds per letter. Over a 6-letter word, that saves ~40 seconds.

eliminationThe Difference-Pair Trap Detector

When options differ in only one or two letters, the examiner is testing whether you make an arithmetic slip on one specific letter. After encoding your answer, compare it to each wrong option — note exactly which letter they changed. Then recheck your computation for that specific letter only.

Example: If your answer is GMJHIU and the options include GMJIHU (letters 4 and 5 swapped), the trap is a transposition error. You already got all letters right — don't second-guess the others. This eliminates re-encoding the full word: saves 20–25 seconds.

patternReverse-Alphabet Quick Lookup (27 Minus Rule)

In reverse-alphabet codes (A=26, B=25...), the position of any letter in the reverse system = 27 − (standard position).

So R (standard=18) in reverse = 27−18 = 9. T (standard=20) in reverse = 7.

You never need to count backward from Z. Standard method: count Z=1, Y=2, X=3... for every letter (up to 13 steps). This formula: one subtraction, 2 seconds. Saves 5–10 seconds per letter on reverse-coding questions.

substitutionWrap-Around Check on Z and A

When applying a shift near Z or A, do a quick boundary check before writing your answer: if any letter in the word is in the last k positions of the alphabet (for a +k shift) or the first k positions (for a −k shift), it will wrap around.

For +1: only Z wraps (→A). For +2: Y and Z wrap. For +3: X, Y, Z wrap.

Scan the original word first. If none of its letters are in the danger zone, skip the wrap-around mental check entirely and encode straight. This saves the "did I go past Z?" hesitation, which commonly costs 10–15 seconds of doubt.


Fast-Solving Framework

Step 1 — Classify (10 seconds): Is the code letters-to-letters, or letters-to-numbers? If numbers, go to number-substitution pathway. If letters, proceed.

Step 2 — Find the rule (15 seconds): Check the first two letter-pairs of the given example. Compute the shift for each. If both shifts are equal → Caesar cipher with that shift value. If unequal → check for reversal, alternating shifts, or mixed code.

Step 3 — Verify (5 seconds): Apply your identified rule to one more letter-pair in the given example to confirm. Do not skip this — one wrong rule identification costs you the entire question.

Step 4 — Encode (20 seconds): Apply the rule to each letter of the target word. Write the coded form.

Step 5 — Match and eliminate (5 seconds): Compare your result to options. If exact match found, mark it. If not, check for a computation slip on the letter where options differ.

Total target time: under 60 seconds per question.


Solved PYQs

Why this question: Tests the most fundamental AFCAT pattern — +1 letter shift. If you can't identify this in 10 seconds, all other coding types will also slow you down.

Previous Year Questionपिछले वर्ष का प्रश्न
In a certain code language, PLANE is written as QMBOF. How is FLIGHT written in that code?
एक निश्चित कोड भाषा में, PLANE को QMBOF लिखा जाता है। तो उसी कोड में FLIGHT को कैसे लिखा जाएगा?
  1. GMJHIU
  2. GMJIHU
  3. GMJHTU
  4. GMJIGU
  1. GMJHIU
  2. GMJIHU
  3. GMJHTU
  4. GMJIGU
Solutionसमाधान
Each letter is replaced by the next letter in the alphabet. P→Q, L→M, A→B, N→O, E→F. Similarly, F→G, L→M, I→J, G→H, H→I, T→U.
प्रत्येक अक्षर को वर्णमाला में अगले अक्षर से बदला जाता है। P→Q, L→M, A→B, N→O, E→F। इसी प्रकार, F→G, L→M, I→J, G→H, H→I, T→U।

Solving path: Check P→Q: that's +1. Verify L→M: +1. Rule confirmed after 2 checks. Now apply to FLIGHT: F(6)→G(7), L(12)→M(13), I(9)→J(10), G(7)→H(8), H(8)→I(9), T(20)→U(21). Result: GMJHIU. Match with option A.


Why this question: Standard number-substitution. AFCAT uses this type to test whether you've memorized the A=1 through Z=26 table. The question rewards preparation over in-the-moment reasoning.

Previous Year Questionपिछले वर्ष का प्रश्न
If RADAR is coded as 18-1-4-1-18, then what is the code for SONAR?
यदि RADAR को 18-1-4-1-18 के रूप में कोड किया गया है, तो SONAR का कोड क्या होगा?
  1. 19-15-14-1-18
  2. 19-14-15-1-18
  3. 18-15-14-1-19
  4. 19-15-13-1-18
  1. 19-15-14-1-18
  2. 19-14-15-1-18
  3. 18-15-14-1-19
  4. 19-15-13-1-18
Solutionसमाधान
Each letter is replaced by its position in the alphabet. S=19, O=15, N=14, A=1, R=18. This follows the same pattern as RADAR where R=18, A=1, D=4, A=1, R=18.
प्रत्येक अक्षर को वर्णमाला में उसकी स्थिति से बदला जाता है। S=19, O=15, N=14, A=1, R=18। यह RADAR के समान पैटर्न का पालन करता है।

Solving path: Confirm the rule from RADAR: R=18, A=1, D=4 — matches alphabetical positions exactly. For SONAR: S=19, O=15, N=14, A=1, R=18. Answer: 19-15-14-1-18. Option A.


Why this question: Tests +2 shift, which is the second most common shift value in AFCAT coding questions. The trap here is misidentifying the shift as +1 by looking only at M→O (which could be +2 or a vowel-skip pattern — verify with the second pair to be certain).

Previous Year Questionपिछले वर्ष का प्रश्न
If in a code language, MOTHER is written as OQVJGT, then how will FATHER be written?
यदि एक कोड भाषा में MOTHER को OQVJGT लिखा जाता है, तो FATHER को कैसे लिखा जाएगा?
  1. HCVJGT
  2. HCVJGR
  3. HCVJGU
  4. HCVKGT
  1. HCVJGT
  2. HCVJGR
  3. HCVJGU
  4. HCVKGT
Solutionसमाधान
Each letter shifts by +2 positions: M→O, O→Q, T→V, H→J, E→G, R→T. Applying same rule to FATHER: F→H, A→C, T→V, H→J, E→G, R→T gives HCVJGT.
प्रत्येक अक्षर 2 स्थान आगे बढ़ता है: M→O, O→Q, T→V, H→J, E→G, R→T। FATHER पर यही नियम लागू करने पर: F→H, A→C, T→V, H→J, E→G, R→T अतः HCVJGT।

Solving path: M(13)→O(15): +2. O(15)→Q(17): +2. Confirmed as +2 shift. Apply to FATHER: F(6)→H(8), A(1)→C(3), T(20)→V(22), H(8)→J(10), E(5)→G(7), R(18)→T(20). Result: HCVJGT. Option A.


Why this question: A letter-to-number question that tests both encoding and retrieval speed. The options are designed to catch off-by-one errors on specific letters (R, G, S).

Previous Year Questionपिछले वर्ष का प्रश्न
If PENCIL is coded as 16-5-14-3-9-12, then what is the code for ERASER?
यदि PENCIL को 16-5-14-3-9-12 के रूप में कोड किया गया है, तो ERASER का कोड क्या होगा?
  1. 5-18-1-19-5-18
  2. 5-17-1-19-5-18
  3. 4-18-1-19-5-18
  4. 5-18-1-18-5-18
  1. 5-18-1-19-5-18
  2. 5-17-1-19-5-18
  3. 4-18-1-19-5-18
  4. 5-18-1-18-5-18
Solutionसमाधान
Each letter is replaced by its alphabetical position: P=16, E=5, N=14, C=3, I=9, L=12. For ERASER: E=5, R=18, A=1, S=19, E=5, R=18.
प्रत्येक अक्षर को वर्णमाला में उसकी स्थिति से बदला गया है: P=16, E=5, N=14, C=3, I=9, L=12। ERASER के लिए: E=5, R=18, A=1, S=19, E=5, R=18।

Solving path: PENCIL: P=16, E=5, N=14, C=3, I=9, L=12 — all match option values. So rule = standard alphabetical position. For ERASER: E=5, R=18, A=1, S=19, E=5, R=18. Answer: 5-18-1-19-5-18. Option A. Watch: option B has R=17 (wrong), option C has E=4 (wrong), option D has S=18 (wrong — that would be R).


Why this question: Confirms you can apply Caesar cipher with +3 shift. The PEACE→SHDFC explanation in the spec resolves to a +3 Caesar pattern for WORLD, making it a direct application question.

Previous Year Questionपिछले वर्ष का प्रश्न
In a code language, PEACE is written as SHDFC. How is WORLD written in the same code?
एक कोड भाषा में PEACE को SHDFC लिखा जाता है। उसी कोड में WORLD को कैसे लिखा जाएगा?
  1. ZRUOG
  2. ZRPOG
  3. ZQROG
  4. ZRUOH
  1. ZRUOG
  2. ZRPOG
  3. ZQROG
  4. ZRUOH
Solutionसमाधान
The coding follows reverse alphabet substitution with +3 shift. P→S, E→H, A→D, C→F, E→C doesn't follow a clear +3 pattern. Let me recalculate: This appears to be Caesar cipher with +3: W→Z, O→R, R→U, L→O, D→G gives ZRUOG.
यह +3 की शिफ्ट के साथ कोडिंग है। W→Z, O→R, R→U, L→O, D→G देता है ZRUOG। प्रत्येक अक्षर को 3 स्थान आगे बढ़ाया गया है।

Solving path: The +3 Caesar cipher: W(23)→Z(26), O(15)→R(18), R(18)→U(21), L(12)→O(15), D(4)→G(7). Result: ZRUOG. Option A. Note: no wrap-around needed here since no letter in WORLD falls in the last 3 positions of the alphabet.


Why this question: Another +1 shift question — but AFCAT repeats this type because it's a baseline filter. Do not spend more than 30 seconds here. It should be automatic.

Previous Year Questionपिछले वर्ष का प्रश्न
In a certain code, if TIGER is written as UJHFS, then how is HORSE written?
एक खास कोड में यदि TIGER को UJHFS लिखा जाता है, तो HORSE को कैसे लिखा जाएगा?
  1. IPSTF
  2. IPSTO
  3. IQSTF
  4. IPRTF
  1. IPSTF
  2. IPSTO
  3. IQSTF
  4. IPRTF
Solutionसमाधान
Each letter moves one position forward in the alphabet: T→U, I→J, G→H, E→F, R→S. For HORSE: H→I, O→P, R→S, S→T, E→F, giving IPSTF.
प्रत्येक अक्षर वर्णमाला में एक स्थान आगे बढ़ता है: T→U, I→J, G→H, E→F, R→S। HORSE के लिए: H→I, O→P, R→S, S→T, E→F, अतः IPSTF।

Solving path: T→U: +1. Verified. HORSE: H(8)→I(9), O(15)→P(16), R(18)→S(19), S(19)→T(20), E(5)→F(6). Result: IPSTF. Option A. Options B, C, D each alter one letter — classic trap design.


Why this question: Tests number-substitution and whether you can distinguish P=16 from P=15, and G=7 from G=6. Wrong options are built around off-by-one errors on exactly these letters.

Previous Year Questionपिछले वर्ष का प्रश्न
In a certain code, if BOOK is 2-15-15-11, then what is the code for PAGE?
एक निश्चित कोड में, यदि BOOK को 2-15-15-11 लिखा जाता है, तो PAGE का कोड क्या होगा?
  1. 16-1-7-5
  2. 15-1-6-5
  3. 16-2-7-5
  4. 16-1-6-5
  1. 16-1-7-5
  2. 15-1-6-5
  3. 16-2-7-5
  4. 16-1-6-5
Solutionसमाधान
Letters are coded by their alphabetical positions: B=2, O=15, O=15, K=11. For PAGE: P=16, A=1, G=7, E=5, giving 16-1-7-5.
अक्षरों को वर्णमाला में उनकी स्थिति के अनुसार कोड किया गया है: B=2, O=15, O=15, K=11। PAGE के लिए: P=16, A=1, G=7, E=5, अतः 16-1-7-5।

Solving path: BOOK: B=2, O=15, O=15, K=11 — confirmed as standard positions. PAGE: P=16, A=1, G=7, E=5. Answer: 16-1-7-5. Option A. Option D has G=6 (wrong). Option B has O=15 shown as first digit, treating P=15 — wrong. Option C has A=2 — wrong.


Common Mistakes


Related Topics


Practice on SarkariRise

Sign up + get 3 free mocks →