Coding-Decoding Solved Questions
Coding-Decoding questions give you a rule in disguise — one coded example — and ask you to apply the same rule to a new word or sentence. There’s no single trick that cracks every question. This page covers the common types — including position-based variable shifts and reverse-then-shift rules — and the habit of checking a guessed rule against every letter before trusting it, with a fully worked example each.
Written by Mahesh Srivastava, Founder of Pariksha Saathi. Published: 2026-10-01. Editorial standards & corrections
The common rule-types, quickly
- Shift ciphers: every letter moves forward or backward by the same fixed number of places in the alphabet (e.g., CAT → DBU is a +1 shift on every letter).
- Mirror/reverse-alphabet codes: each letter is replaced by the letter the same distance from the OTHER end of the alphabet (A↔Z, B↔Y, C↔X, and so on).
- Numeric codes: each letter is replaced by its position number in the alphabet (A=1, B=2, … Z=26), or by some fixed arithmetic on that position.
- Word-substitution codes: whole words (not letters) are swapped for code-words — when two coded sentences share a word, matching the repeated word to the repeated code cracks it.
- Some codes use a NON-uniform shift that depends on each letter's position in the word (e.g., 1st letter +1, 2nd letter +2, 3rd letter +3) rather than one constant amount — always check your guessed rule against EVERY letter of the given example before applying it, since a shift that looks constant for the first two letters can break on the third.
- A few questions reverse the order of the word's letters first and then apply a simple shift (the order you do these two steps in doesn't change the final result, since shifting is applied letter-by-letter regardless of position) — if a plain constant shift doesn't fit, check whether reversing the word first reveals one.
- After decoding, verify your answer by reversing your own rule on it — if that doesn't get you back to the original word or letter from the question, the rule you used was wrong.
Worked examples
1. In a certain code language, CAT is written as DBU. How will DOG be written in that language?
Solution
- Compare each letter: C→D, A→B, T→U — every letter has shifted forward by exactly 1 place in the alphabet.
- Apply the same +1 shift to D, O, G: D→E, O→P, G→H.
Answer: EPH
2. In a certain code language, "pen is good" is written as "ab cd ef", and "good is costly" is written as "ef cd gh". What is the code for "costly" in this language?
Solution
- First sentence: words "pen", "is", "good"; codes "ab", "cd", "ef". Second sentence: words "good", "is", "costly"; codes "ef", "cd", "gh". The codes need not be in the same order as the words, so match them only through what the two sentences share.
- "is" and "good" are the words common to both sentences, and "cd" and "ef" are the codes common to both coded sentences — so together, {is, good} = {cd, ef}.
- "costly" is the only word in the second sentence that does not appear in the first, so its code must be the only code in the second sentence that does not appear among the first sentence’s codes.
- That code is "gh".
Answer: gh
3. In a code, each letter of a word is replaced by the letter that is the same distance from the end of the alphabet as the original letter is from the start (A↔Z, B↔Y, C↔X, and so on). How will FLOWER be coded?
Solution
- Position from the start: F=6, L=12, O=15, W=23, E=5, R=18.
- Mirror position from the end: position p maps to (27 − p) — so F(6)→21=U, L(12)→15=O, O(15)→12=L, W(23)→4=D, E(5)→22=V, R(18)→9=I.
- Putting the coded letters together in order: U, O, L, D, V, I.
Answer: UOLDVI
4. In a code, each letter is replaced by its position number in the English alphabet (A=1, B=2, … Z=26), separated by hyphens. If WATER is coded as 23-1-20-5-18, how will EARTH be coded?
Solution
- Position numbers: E=5, A=1, R=18, T=20, H=8.
- Writing these in order, separated by hyphens: 5-1-18-20-8.
Answer: 5-1-18-20-8
5. In a certain code, ANT is written as BPW. Find the pattern (don't assume a constant shift — check every letter), then code DOG using the same pattern.
Solution
- A→B is +1. N→P is +2. T→W is +3. The shift is NOT constant — it increases by 1 for each successive letter in the word (1st letter +1, 2nd +2, 3rd +3).
- Apply the same pattern to DOG: D (1st, +1) = E. O (2nd, +2) = Q. G (3rd, +3) = J.
Answer: EQJ
6. In a certain code, CAT is written as UBD. Find the rule, then code DOG using the same rule.
Solution
- A constant shift doesn't fit directly (C→U, A→B, T→D don't share one amount). Try reversing the letters first: CAT reversed is TAC.
- Now shift each letter of TAC by +1: T→U, A→B, C→D, giving UBD — this matches.
- Apply the same rule to DOG: reversed is GOD. Shift each by +1: G→H, O→P, D→E.
Answer: HPE
7. Using the rule from the first worked example (CAT→DBU, a +1 shift), verify the answer EPH for DOG by decoding it back with a −1 shift.
Solution
- Apply −1 to each letter of EPH: E→D, P→O, H→G.
- This gives back DOG exactly, confirming the +1 shift rule was applied correctly both ways.
Answer: DOG (confirms the rule)
Common mistakes and more worked examples
This section was added on 10 November 2026. It was drafted with AI assistance and checked by a second, independent pass, with every number recomputed. Published by Mahesh Srivastava, who corrects any error you report.
Common mistakes
- Forgetting to wrap round after Z: in a forward shift the alphabet continues from A, so Y + 3 = B and X + 5 = C. If a position number goes above 26, subtract 26 to get the letter.
- Using 26 − p instead of 27 − p for mirror codes. A letter and its mirror always add up to 27 (A=1 ↔ Z=26, D=4 ↔ W=23), so 26 − p is off by one letter every time.
- Fixing the rule after checking only the first one or two letters. A shift that looks like +1, +1 can turn out to be +1, +2, +3 on the third letter, so test the rule on every letter of the given example before using it.
- In word codes, matching words and codes by position. The codes need not appear in the same order as the words; pair them only through the words and codes that two sentences share.
- Decoding with the coding rule instead of its reverse. If each letter moves 2 forward and you are asked which word is coded as FQI, move each letter 2 back to get DOG, not 2 forward (HSK); for reverse-then-shift codes, undo the shift and the reversal.
- Miscounting positions in the middle of the alphabet. Anchor on E=5, J=10, O=15, T=20, Y=25 and count from the nearest anchor instead of from A.
More worked examples
8. In a certain code language, ROAD is written as 3156 and DEAR is written as 6253. How will ORDER be written in that language?
Solution
- Match letters to digits position by position. ROAD → 3156 gives R=3, O=1, A=5, D=6.
- DEAR → 6253 gives D=6, E=2, A=5, R=3. The shared letters D, A and R get the same digits in both words, so each letter stands for one fixed digit.
- ORDER = O, R, D, E, R = 1, 3, 6, 2, 3.
Answer: 13623
9. In a certain code, CAB is coded as 6 and FED is coded as 15. How will HIDE be coded?
Solution
- CAB: C=3, A=1, B=2. Both the sum (3 + 1 + 2) and the product (3 × 1 × 2) give 6, so CAB alone cannot settle the rule.
- FED: F=6, E=5, D=4. Sum = 15, product = 120. The code is 15, so the rule is the sum of the letters' positions.
- HIDE: H=8, I=9, D=4, E=5. Sum = 8 + 9 + 4 + 5 = 26.
Answer: 26
10. In a certain code, PLANET is written as LPNATE. How will GARDEN be written in that code?
Solution
- No letter changes; only the order does. Split PLANET into pairs: PL, AN, ET. Swapping the two letters in each pair gives LP, NA, TE = LPNATE, which matches.
- Split GARDEN into pairs: GA, RD, EN. Swap each pair: AG, DR, NE.
Answer: AGDRNE
Try these yourself
Work through these the same way, then check against the answer.
1. In a certain code, BOOK is written as DQQM. Using the same rule, how will PAGE be coded?
Answer: RCIG (every letter shifts forward by 2)
2. Using the mirror rule from the worked examples (A↔Z, B↔Y, C↔X…), how will the word BRAIN be coded?
Answer: YIZRM
3. Using the A=1, B=2, … Z=26 rule, how will the word MIND be coded?
Answer: 13-9-14-4
4. In a certain code, BIG is written as CKJ. Find the pattern (the shift increases by one for each letter), then code CAT using the same pattern.
Answer: DCW. C(+1)=D, A(+2)=C, T(+3)=W.
5. In a certain code, DOG is written as HPE (reverse the letters, then shift each by +1). Using the same rule, code CAT.
Answer: UBD. Reverse CAT to TAC, then shift each letter +1.
6. If PEN is coded as QFO (a +1 shift), verify this by decoding QFO back with a −1 shift.
Answer: PEN. Q−1=P, F−1=E, O−1=N — confirms the rule.
7. Using the A=1, B=2, … Z=26 rule, how will the word BOAT be coded?
Answer: 2-15-1-20.
All 88 practice questions on Coding-Decoding, with answers →
Where this comes up
Coding-Decoding is a regular topic in the Reasoning/General Intelligence section of exams Pariksha Saathi covers — SSC CGL, SSC MTS, SSC CHSL, IBPS PO, IBPS Clerk, SBI PO and SBI Clerk.
Keep practising
Solve the questions above before opening the answers. Explain each step in your own words, then revisit any mistakes.
Start this topic’s quiz →