Coding-Decoding — Summary
Coding-decoding scrambles words by a rule (letter shifts, substitutions, number codes) and asks you to encode or decode another word. It is a placement staple (TCS, Cognizant) rewarding a quick eye for the transformation.
Common coding types
- Letter shift (Caesar): each letter moves a fixed number. CAT → DBU is +1.
- Letter-to-number: A=1…Z=26, or reverse.
- Substitution: whole words stand for other words ("sky = blue").
- Reverse / mixed: letters reversed, then shifted.
| Code type | Clue |
|---|---|
| +k shift | consistent forward jump per letter |
| Reverse | word spelled backward |
| Position sum | letters replaced by numbers |
| Substitution | words swapped by a key |
Example: if CAT is coded as DBU (+1), then DOG becomes EPH (D→E, O→P, G→H). ✓
Exam Tricks & Tips
- 🎯 Compare the code letter by letter with the original to find the shift.
- 🎯 A shift can be forward or backward — check the sign consistently.
- 🎯 For number codes, test A=1…Z=26 and its reverse (A=26…Z=1).
- 🎯 In substitution coding, build a small word-to-word key and translate.
- 🎯 Watch for a shift that WRAPS around (Z + 1 = A).
- ❌ Don't assume a single global rule if letters shift by different amounts — it may be positional.
Expected exam pattern: encode/decode a new word, "if X is coded as Y, what is Z", and substitution-language questions. 1 to 2 questions, ~45 seconds.
Quick recap: align code with original to find the shift; test forward/backward and A=1…26 or reverse; handle wrap-around and substitutions.
Coding-Decoding — Flashcards
Q1. What does coding-decoding test?
A1. Encoding or decoding words by a hidden rule.
Q2. CAT is coded DBU — what is the rule?
A2. Each letter shifts +1.
Q3. With that rule, code DOG.
A3. EPH.
Q4. Letter-to-number: value of the word "BAD"?
A4. 2, 1, 4.
Q5. How do you find a Caesar shift?
A5. Compare each code letter with the original.
Q6. What is a wrap-around in shifting?
A6. After Z you cycle back to A (Z + 1 = A).
Q7. Reverse coding of "WORD"?
A7. DROW.
Q8. If "sky = blue" in a substitution language, what is sky?
A8. Whatever the key maps it to — here "blue".
Q9. Two number-code conventions to test?
A9. A=1…Z=26 and the reverse A=26…Z=1.
Q10. Decode DBU back to the original (given +1 code).
A10. CAT (shift each letter −1).
Q11. Letters shifting by different amounts suggests?
A11. A positional or pattern-based code, not a single shift.
Q12. Code "SUN" with a +2 shift.
A12. UWP.
Coding-Decoding
Coding-decoding hands you words and their coded forms and asks you to crack the cipher. It looks intimidating but almost always reduces to a letter shift, a reversal, or a positional substitution — and a systematic compare-the-pairs approach finds it fast.
What this topic tests: deducing letter-shift, reversal, symbol-substitution and number-coding rules from examples.
The method
Beginner — the common cipher types
- Letter shift (Caesar): each letter moves a fixed number. CAT → DBU is +1.
- Reversal: the word is written backwards, sometimes then shifted.
- Positional/number coding: letters replaced by their alphabet position (A=1) or 27−position.
Intermediate — the compare method
When given several word–code pairs, line them up and find which code word shares letters with which. Common-letter matching reveals the mapping without brute force. For "if PALE is coded as 2134, then LEAP is?", map each letter to its digit first (P=2, A=1, L=3, E=4), then read LEAP = 3421.
Advanced — substitution and conditional coding
- Word-substitution ("if sky is called sea, sea is called…"): just track the renaming and answer with the substituted word.
- Symbol/number operations: the code may be position ± k, or the product/sum of positions. Test the simplest shift first; if it fails, try reverse-then-shift or position-based arithmetic.
Worked example
In a code, "TEACH" is written as "WHDFK". Find the code for "LEARN".
Compare letters: T→W (+3), E→H (+3), A→D (+3), C→F (+3), H→K (+3) — a uniform +3 shift. Apply to LEARN: L→O, E→H, A→D, R→U, N→Q = OHDUQ.
Where it appears
TCS NQT, Infosys, Wipro, Cognizant, Capgemini reasoning; a near-certain 2–3 question block in placement tests.
Speed tricks and shortcuts
- Check a fixed shift first (compare one letter's move; verify with another).
- If shift fails, test reversal or reverse + shift.
- For letter↔digit codes, build the mapping from a fully-given pair, then apply.
- Mnemonic: "Shift, reverse, or substitute — test them in that order."
Assuming the shift is uniform without verifying on a second letter, or ignoring wrap-around (Z + 1 = A). Always confirm the rule on all given letters before applying it to the target word.
- ✓- Main types: fixed letter shift, reversal, position/number coding, substitution.
- ✓- Verify the rule on every given letter, mind Z→A wrap-around.
- ✓- Letter↔digit: derive the map from a complete pair, then apply.
- ✓- Substitution questions just track the renaming.
- ✓Test the ciphers in order — shift, reversal, then substitution — and confirm the rule on all sample letters before decoding the target. Most placement codes are a simple, uniform transformation.
Coding-Decoding — Worked Example
Worked Example
Problem: In a certain code language, CAT is written as DBU. How is DOG written in the same code?
Solution: Compare each letter of the plaintext with its coded letter to find the shift:
- C → D (shift +1)
- A → B (shift +1)
- T → U (shift +1)
The rule is: replace every letter with the next letter in the alphabet (+1).
Apply +1 to DOG:
- D → E
- O → P
- G → H
So DOG becomes EPH.
Answer: EPH.
- ✓- Line up plaintext and code letter-by-letter to detect the shift.
- ✓- A constant shift (+1 here) is the most common letter-coding rule.
- ✓- Watch for wrap-around: Z + 1 loops back to A.