⚖️ Conditional Coding — Basics
Learn conditional coding where a substitution table is modified by special conditions based on vowel/consonant patterns in the word — systematic approach with solved examples
Conditional Coding — Basics
Conditional Coding is one of the most important Mains-level patterns in Coding-Decoding. It combines two elements:
- A substitution table that maps each letter to a code (number or symbol)
- A set of conditions that modify the code based on properties of the word being coded
This topic appears regularly in IBPS PO Mains, SBI PO Mains, NABARD Grade A, and RRB PO Mains. The key to solving these questions is a systematic, step-by-step approach — rushing leads to errors.
Structure of a Conditional Coding Problem
Every conditional coding question has three components:
Component 1 — The Mapping Table:
A table that assigns a code (number, symbol, or letter) to specific letters of the alphabet. Not all 26 letters may be covered. If a letter's code is not given, you write the letter as-is.
Component 2 — The Conditions:
3 to 5 rules that modify the code based on properties of the first letter, last letter, or other positional characteristics of the word. Common condition triggers:
Pro Content Locked
Upgrade to Pro to access this lesson and all other premium content.
₹99 charged monthly · Cancel anytime
- All Agriculture & Banking Courses
- AI Lesson Questions (100/day)
- AI Doubt Solver (50/day)
- Glows & Grows Feedback (30/day)
- AI Section Quiz (20/day)
- 22-Language Translation (100/day)
- Recall Questions (20/day)
- AI Quiz (15/day)
- AI Quiz Paper Analysis (100/day)
- AI Step-by-Step Explanations (100/day)
- Spaced Repetition Recall (FSRS)
- AI Tutor
- Immersive Text Questions
- Audio Lessons — Hindi & English
- Mock Tests & Previous Year Papers
- Summary & Mind Maps
- XP, Levels, Leaderboard & Badges
- Generate New Classrooms
- Voice AI Teacher (AgriDots Live)
- AI Revision Assistant
- Knowledge Gap Analysis
- Interactive Revision (LangGraph)
🔒 Secure via Razorpay · Cancel anytime · No hidden fees
Conditional Coding — Basics
Conditional Coding is one of the most important Mains-level patterns in Coding-Decoding. It combines two elements:
- A substitution table that maps each letter to a code (number or symbol)
- A set of conditions that modify the code based on properties of the word being coded
This topic appears regularly in IBPS PO Mains, SBI PO Mains, NABARD Grade A, and RRB PO Mains. The key to solving these questions is a systematic, step-by-step approach — rushing leads to errors.
Structure of a Conditional Coding Problem
Every conditional coding question has three components:
Component 1 — The Mapping Table:
A table that assigns a code (number, symbol, or letter) to specific letters of the alphabet. Not all 26 letters may be covered. If a letter's code is not given, you write the letter as-is.
Component 2 — The Conditions:
3 to 5 rules that modify the code based on properties of the first letter, last letter, or other positional characteristics of the word. Common condition triggers:
- First letter is a vowel / consonant
- Last letter is a vowel / consonant
- Both first and last are vowels
- Both first and last are consonants
- First and third letters share a property
Component 3 — The Note:
"If the code for a letter is not given in the table, write that letter as it is."
The Systematic Approach
Follow these steps in order for every question:
Step 1 — Write the basic code. Apply the mapping table letter by letter. If a letter is not in the table, write it as-is.
Step 2 — Identify the first and last letters of the ORIGINAL word. Check whether they are vowels (A, E, I, O, U) or consonants.
Step 3 — Determine which condition applies. Go through conditions one by one. Usually only one condition will match. Apply it.
Step 4 — Write the final code. After applying the condition's modification, read out the complete code.
Critical Rule: Conditions are checked on the original word, NOT on the coded version.
Solved Example 1
Mapping Table:
| Letter | I | A | B | G | E | Y | C | P | M |
|---|---|---|---|---|---|---|---|---|---|
| Code | 5 | 9 | & | 8 | @ | # | 7 | $ | 4 |
Conditions:
- (a) If the first AND third letters are both vowels → both are coded as #
- (b) If the first letter is a vowel AND the last letter is a consonant → both are coded as the code of the last letter
- (c) If BOTH the first and last letters are vowels → the codes of the 2nd letter and the 2nd-last letter are interchanged
- (d) If BOTH the first and third-from-last letters are consonants → both are coded as %
Q: What is the code for AMERICA?
Step 1 — Write the basic code:
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| Letter | A | M | E | R | I | C | A |
| Basic Code | 9 | 4 | @ | R | 5 | 7 | 9 |
(R is not in the table, so it stays as R)
Step 2 — Check properties:
- First letter = A → Vowel
- Last letter = A → Vowel
- Third letter = E → Vowel
Step 3 — Check conditions:
- Condition (a): First (A) and Third (E) are both vowels? YES → Both coded as #
- Condition (c): First (A) and Last (A) are both vowels? YES → Interchange 2nd and 2nd-last codes
Both (a) and (c) apply. Apply them in order:
Apply condition (a) first: Positions 1 and 3 become #
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| After (a) | # | 4 | # | R | 5 | 7 | 9 |
Apply condition (c): Swap codes of 2nd position (4) and 2nd-last position (7):
- 2nd position code = 4 (from M)
- 6th position code = 7 (from C)
- After swap: 2nd becomes 7, 6th becomes 4
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| Final Code | # | 7 | # | R | 5 | 4 | 9 |
Final Code: #7#R549
Answer: (d) None of these (if #7#R549 is not among the given options)
Solved Example 2
Mapping Table:
| Letter | K | W | B | U | C | G | O | D | A | V | E | H |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Code | & | 8 | 2 | * | 6 | # | 7 | 9 | @ | 1 | 5 | 3 |
Conditions:
- (i) If both first and last letters are vowels → both coded as the code of the last letter
- (ii) If both first and last letters are consonants → their codes are interchanged
- (iii) If first letter is a vowel and last letter is a consonant → both coded as !
- (iv) If last letter is a vowel and first letter is a consonant → both coded as the code of the first letter
Q: What is the code for UDKHW?
Step 1 — Basic code:
| Letter | U | D | K | H | W |
|---|---|---|---|---|---|
| Code | * | 9 | & | 3 | 8 |
Step 2 — Check properties:
- First letter = U → Vowel
- Last letter = W → Consonant
Step 3 — Which condition?
- First = vowel, Last = consonant → Condition (iii) applies
- Both first and last become !
Step 4 — Apply:
| Letter | U | D | K | H | W |
|---|---|---|---|---|---|
| Final Code | ! | 9 | & | 3 | ! |
Final Code: !9&3!
Answer: (3) !9&3!
Solved Example 3
Using the same mapping table and conditions as Example 2.
Q: What is the code for ABOVE?
Step 1 — Basic code:
| Letter | A | B | O | V | E |
|---|---|---|---|---|---|
| Code | @ | 2 | 7 | 1 | 5 |
Step 2 — Check properties:
- First letter = A → Vowel
- Last letter = E → Vowel
Step 3 — Which condition?
- Both first and last are vowels → Condition (i) applies
- Both coded as the code of the last letter (E = 5)
Step 4 — Apply:
| Letter | A | B | O | V | E |
|---|---|---|---|---|---|
| Final Code | 5 | 2 | 7 | 1 | 5 |
Final Code: 52715
Answer: 52715
Solved Example 4
Using the same mapping table and conditions as Example 2.
Q: What is the code for KICKED?
Step 1 — Basic code:
| Letter | K | I | C | K | E | D |
|---|---|---|---|---|---|---|
| Code | & | I | 6 | & | 5 | 9 |
(I is not in the mapping table, so it stays as I)
Step 2 — Check properties:
- First letter = K → Consonant
- Last letter = D → Consonant
Step 3 — Which condition?
- Both first and last are consonants → Condition (ii) applies
- Their codes are interchanged: K's code (&) goes to D's position, D's code (9) goes to K's position
Step 4 — Apply:
| Letter | K | I | C | K | E | D |
|---|---|---|---|---|---|---|
| Final Code | 9 | I | 6 | & | 5 | & |
Final Code: 9I6&5&
Answer: 9I6&5&
Solved Example 5
Using the same mapping table and conditions as Example 2.
Q: What is the code for WEDGE?
Step 1 — Basic code:
| Letter | W | E | D | G | E |
|---|---|---|---|---|---|
| Code | 8 | 5 | 9 | # | 5 |
Step 2 — Check properties:
- First letter = W → Consonant
- Last letter = E → Vowel
Step 3 — Which condition?
- First = consonant, Last = vowel → Condition (iv) applies
- Both coded as the code of the first letter (W = 8)
Step 4 — Apply:
| Letter | W | E | D | G | E |
|---|---|---|---|---|---|
| Final Code | 8 | 5 | 9 | # | 8 |
Final Code: 859#8
Answer: 859#8
Key Terminology
| Term | Meaning |
|---|---|
| Vowels | A, E, I, O, U |
| Consonants | All other letters (B, C, D, F, G, ...) |
| First letter | Leftmost letter of the word |
| Last letter | Rightmost letter of the word |
| 2nd letter | Second from the left |
| 2nd-last letter | Second from the right |
| 3rd-from-last | Third from the right |
| Interchange | Swap the codes of two positions |
| Coded as X | Replace the code with X |
Speed Tips for Exam
- Draw a clean table for every word. Write the letters in a row, basic codes below, and final codes in a third row. This prevents positional confusion.
- Check conditions on the ORIGINAL word, not the coded version. The vowel/consonant check is always on the actual English letters.
- Only one condition usually applies. If conditions are mutually exclusive (covering all 4 combinations of vowel/consonant for first/last letter), exactly one will match.
- When multiple conditions apply, apply them in the order given (a before b before c).
- Underline the first and last letters of the word immediately. This is the most common check point.
- Write "V" or "C" above each letter to quickly identify vowels and consonants.
Common Traps
- Applying the condition to the coded word instead of the original. The conditions reference properties of the English word (AMERICA), not the coded output (94@R579).
- Confusing "interchange" with "replace." "Interchange" means swap: A gets B's code and B gets A's code. "Replace both with X" means both positions get the same value X.
- Forgetting the "as-is" rule. Letters not in the mapping table retain their original letter form. Do not skip them or leave blanks.
- 2nd-last vs 2nd confusion. "2nd letter" counts from the left (position 2). "2nd-last letter" counts from the right (second from the end). In AMERICA, 2nd letter = M, 2nd-last letter = C.
- Condition overlap. Sometimes a word satisfies multiple conditions. Read the question carefully — it may say "apply the first applicable condition" or "apply all applicable conditions in order."
- Y as vowel or consonant. In banking exam reasoning, Y is always a consonant unless the question explicitly states otherwise.