Coding-Decoding is a reasoning topic where a word or number is transformed using a hidden rule, and you must apply that same rule to find the code for a new word — or decode a given code back to the original word.
Think of it like a lock and key. The "code pattern" is the lock mechanism. Once you identify the mechanism from the given example, you use the same mechanism on the new input to get the output. The exam never changes the mechanism mid-question.
Here is a useful real-world analogy: imagine a spy sending messages where every letter is replaced by the one two places ahead in the alphabet. If the spy writes "CNGKF" for "AKHID," you figure out the shift, then decode any other message the same way. Every coding-decoding question in the exam works on this exact principle — find the rule once, apply it consistently.
In the UP Police Constable exam, coding-decoding questions appear in the Reasoning section and test your ability to spot patterns quickly. The patterns you will encounter fall into five main families:
The key skill is not memorising patterns — it is training yourself to test multiple hypotheses in under 30 seconds and confirm or eliminate each one. By the time you finish this page, you will have a decision tree that tells you exactly which hypothesis to test first.
Write the alphabet A–Z and assign positions 1–26. In forward-shift coding, each letter moves a fixed number of steps ahead. In backward-shift coding, it moves back.
Example: A + 3 = D, B + 3 = E, Z + 3 = C (wrap around from Z to A).
Wrap-around rule: If a letter goes beyond Z, subtract 26. If it goes before A, add 26. Exam questions will often state this explicitly as "continue from A" or "continue from Z."
Varying-shift patterns are more common in UP Police papers. Here the shift changes by position: position 1 shifts by +2, position 2 by +3, position 3 by +1, etc. To crack these, list the shift for each position separately from the given example, then replicate.
How to find the shift quickly: write the original letter and the coded letter side by side, then compute coded_position − original_position for each letter. If all differences are equal — fixed shift. If they differ — note the pattern of differences.
The rule here: position of letter + position of its code = 27. So A(1) ↔ Z(26), B(2) ↔ Y(25), M(13) ↔ N(14).
Recognition test: take any letter and its code. Add their alphabetical positions. If the sum is consistently 27, it is Atbash.
This is the fastest pattern to confirm — just check two or three letter pairs. If they all sum to 27, you are done.
The entire word is spelled backwards. RAIN → NIAR. CLOUD → DUOLC.
Confirmation: check if the last letter of the code is the first letter of the original.
When a question asks about a specific position in the coded word, reverse the word first, then count from the direction specified. Do not rush the direction — "second from right" and "second from left" are common traps.
Each letter is replaced by its alphabetical position (A=1, B=2, ... Z=26), and then those values are summed. So PIZZA = P(16) + I(9) + Z(26) + Z(26) + A(1) = 78.
Recognition: if the code is a single number and the given examples are consistent with position-sum, this is your pattern. Add positions quickly using mental math — group letters near 10 (J=10, I=9, K=11) as anchors.
You are given two or three coded sentences and their English equivalents. You must find which number corresponds to which word by identifying overlaps.
Method: find a word that appears in two different English sentences. The number that appears in both corresponding codes is the code for that word.
Example: "642" = sky is blue, "417" = blue and beautiful. The word "blue" appears in both. The number "4" appears in both codes. Therefore 4 = blue.
When three sentences are given, use the same intersection technique — always look for the word that appears in exactly two sentences and find its matching number.
A variation common in recent papers: vowels follow one rule, consonants follow another. For example, vowels shift +1 (A→B, E→F) while consonants shift −1 (B→A, C→B, T→S). Always identify the vowels (A, E, I, O, U) and consonants separately before applying rules.
When you see a coded word and suspect mirror/Atbash coding, take the first letter of the original and the first letter of the code. Add their alphabetical positions. If the sum is 27, confirm with one more pair — you're done. No need to decode all letters first.
Micro-example: WINDOW → DRMWLD. W=23, D=4. 23+4=27. Confirmed Atbash in 5 seconds. Standard approach (trying shifts for each letter): 40+ seconds. Atbash check: under 10 seconds.
Write the coded word. Number its letters from left. Then immediately rewrite from right to left — that is your original word. For position-based sub-questions ("second letter from right in coded word"), do NOT reverse — just count from the right end directly on the coded word.
Micro-example: Coded word DUOLC (5 letters). Second from right: D(5)-U(4)-O(3)-L(2)-C(1). Second from right = L. This avoids the common error of reversing first and then miscounting. Saves 1-2 re-reads per question.
List all words from sentence A. List all words from sentence B. Circle the common word. Now list all numbers from code A. List all numbers from code B. Circle the common number. Common word = common number. No guessing needed.
Micro-example: "642"=sky is blue, "52"=is calm. Common word: "is". Common number: "2". Therefore 2=is. Standard method (trial and error): 4-5 steps. Intersection method: 2 steps.
Memorise five anchor positions: E=5, J=10, O=15, T=20, Y=25. Any other letter = nearest anchor ± small offset.
Micro-example: R = T(20) − 2 = 18. N = O(15) − 1 = 14. For number-sum questions, use anchors to compute letter values in under 3 seconds each instead of counting A-B-C-D from scratch (saves 5-8 seconds per word on 5-letter words).
Before reading the transformation rule, underline all vowels (A,E,I,O,U) in the original word and circle the consonants. Apply the two rules to the two groups separately. This prevents the most common error of applying one rule to the entire word.
Micro-example: ABACTERIAL — underline A,A,E,I,A; circle B,C,T,R,L. Apply vowel rule (+1) and consonant rule (−1) to separate groups. Time saving: eliminates 1 re-do when you catch a mid-word error.
When you open a coding-decoding question in the exam hall, run this decision tree in sequence:
Step 1 — What type is the input? If it is a single number as the code, go to number coding (sum of positions). If it is a group of numbers with multiple sentences, go to intersection method. If the code is a word or letter string, continue.
Step 2 — Check Atbash first (fastest to confirm): add positions of first letter of original + first letter of code. If sum = 27, confirm with one more pair. Done in under 10 seconds.
Step 3 — Check reversal: is the last letter of the code the same as the first letter of the original? If yes, it is reversal. Done in 5 seconds.
Step 4 — Compute position differences for each letter pair. Write them as a sequence. Are they all equal (fixed shift)? Or do they follow a pattern (+2,+3,+1,+3,+2)?
Step 5 — Check for vowel/consonant split: if no uniform pattern emerges in Step 4, separate vowels from consonants and check if each group follows its own shift rule.
Apply the confirmed rule to the new word. Double-check your wrap-around arithmetic (Z→A, A→Z). Mark. Move on.
Why this question — Tests your ability to identify the Atbash cipher, the most frequently appearing mirror-code pattern in UP Police papers.
Solving path: Take W and D — alphabetical positions 23 and 4. Sum = 27. That is Atbash. Confirm with I(9) and R(18): 9+18=27. Confirmed. Now apply to SATURN: S(19)→H(8), A(1)→Z(26), T(20)→G(7), U(21)→F(6), R(18)→I(9), N(14)→M(13). Code = HZGFIM. Match option D.
Why this question — Tests number-group coding and the intersection method, which appears in UP Police papers with 2–3 sentence setups.
Solving path: "642" contains sky, is, blue. "417" contains blue, and, beautiful. The only common word is "blue." The only common number between 642 and 417 is "4." Therefore 4 = blue. Answer: option A.
Why this question — Tests number-to-letter decoding using two given examples to establish the key.
Solving path: From JACKET=146542: J=1, A=4, C=6, K=5, E=4, T=2. From COAT=6942: C=6, O=9, A=4, T=2 — consistent with JACKET values. Now decode 6965: 6=C, 9=O, 6=C, 5=K → COCK. Answer: option C.
Why this question — Tests word-reversal coding with a position-based sub-question, a classic trap for rushed readers.
Solving path: RAIN→NIAR (reversed). SNOW→WONS (reversed). Pattern confirmed: reversal. CLOUD reversed = DUOLC. Now: "second letter from the right in the coded word" — coded word is DUOLC. From the right: C(1st), L(2nd), O(3rd), U(4th), D(5th). Second from right = L. "Third letter from the left in the original word" — original is CLOUD: C(1st), L(2nd), O(3rd). Third from left = O. Answer = L and O. Match option D. Note: the answer key in different paper sets has varied — always recheck the position counting carefully.
Why this question — Tests sequential assignment coding, a less common but exam-relevant pattern where letters within a word get re-coded by their order of appearance.
Solving path: Observe BADAM→ABCBD and SEED→EFFC. In BADAM, the letters in order of first appearance are B,A,D,M — assign them A,B,C,D. So B=A, A=B, D=C, M=D. Re-encode BADAM: B→A, A→B, D→C, A→B, M→D = ABCBD. Confirmed. For SEED: S,E,D are the distinct letters in order of appearance — assign S=E, E=F, D=C (continuing the master alphabet assignment). SEED: S→E, E→F, E→F, D→C = EFFC. Confirmed. Now BASED: B→A, A→B, S→E, E→F, D→C = ABEFC. Answer: option D.
Miscounting wrap-around shifts: when a letter like Y gets +3, many candidates stop at Z instead of wrapping to B. Always subtract 26 when you exceed Z, add 26 when you go below A.
Reversing the word before counting position-based sub-questions: when asked "second letter from the right of the coded word," count directly on the coded word from the right end. Do not reverse it first — that changes which end is "right."
Applying one rule to vowels and consonants both: when a question specifies separate rules for vowels and consonants, test-takers often apply the consonant rule to a vowel they misidentified. Mark A, E, I, O, U before you start encoding.
Treating E=4 instead of E=5: the most common alphabet-position error. A=1, B=2, C=3, D=4, E=5. Candidates who memorise J=10 sometimes backcount incorrectly. Use your anchor-letter trick to verify.
In number-group coding, guessing instead of using intersection: when you see three coded sentences, the temptation is to find the word by elimination-guessing. This leads to errors. Always find the number that literally appears in both relevant codes — no guessing.
Assuming a fixed shift when the shift is varying: if you check one letter pair and find +2, do not assume all letters shift +2. Check at least three pairs. Varying-shift questions are designed to punish this assumption.