🔲 Matrix Coding
Master matrix coding where grids undergo multi-step transformations through letter swaps, number modifications, and pattern-based rearrangements — the hardest coding-decoding pattern in Mains exams
Matrix Coding
Matrix Coding is the hardest type of Coding-Decoding and appears only in Mains exams. A grid (usually 3x3 or 2x4) is given as input, where each cell contains a code made of letters + a number (e.g., ED6, TV3, KL8). The grid undergoes multiple steps of transformation according to given rules, and you must determine what appears in a specific cell after a particular step.
This pattern has appeared in SBI PO Mains, IBPS PO Mains, and NABARD Grade A Mains. It is time-consuming but highly scoring once you understand the transformation logic.
Structure of a Matrix Coding Problem
Input: A grid with letter-number codes in each cell.
| A5 | TV3 | IK3 |
| ED6 | | KL8 |
| J8 | U5 | OM4 |
Transformation Rules: 2-3 rules that describe how to convert the grid from one step to the next.
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
Matrix Coding
Matrix Coding is the hardest type of Coding-Decoding and appears only in Mains exams. A grid (usually 3x3 or 2x4) is given as input, where each cell contains a code made of letters + a number (e.g., ED6, TV3, KL8). The grid undergoes multiple steps of transformation according to given rules, and you must determine what appears in a specific cell after a particular step.
This pattern has appeared in SBI PO Mains, IBPS PO Mains, and NABARD Grade A Mains. It is time-consuming but highly scoring once you understand the transformation logic.
Structure of a Matrix Coding Problem
Input: A grid with letter-number codes in each cell.
| A5 | TV3 | IK3 |
| ED6 | | KL8 |
| J8 | U5 | OM4 |
Transformation Rules: 2-3 rules that describe how to convert the grid from one step to the next.
Steps: The grid passes through Step 1, Step 2, and sometimes Step 3. Each step applies specific rules.
Question format: "What is the value in Row 2, Column 3 of Step 2?"
Common Transformation Types
Type 1 — Letter Interchange/Swap
Letters within each cell swap positions:
- ED6 becomes DE6 (letters reversed)
- TV3 becomes VT3
- Single-letter cells stay as-is: A5 stays A5
Type 2 — Alphabetical Opposite
Each letter is replaced by its opposite in the alphabet (A↔Z, B↔Y, C↔X, ...):
| Original | A | B | C | D | E | F | G | H | I | J | K | L | M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Opposite | Z | Y | X | W | V | U | T | S | R | Q | P | O | N |
| Original | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Opposite | M | L | K | J | I | H | G | F | E | D | C | B | A |
Quick formula: Letter + Opposite = 27 (A=1, B=2, ..., Z=26). So opposite of any letter at position P is the letter at position (27 - P).
Type 3 — Number Modification Based on Letter Properties
Rules that modify the number based on whether the cell's letters are vowels or consonants:
- One consonant + one vowel, number > 3 → subtract 3 from number
- Two consonants, number > 5 → subtract number by a given value or change letters
- Even number → subtract 2, exchange letter positions, replace with preceding letters
- Odd number → add 4, replace with following letters
Type 4 — Preceding/Following Letters
- Preceding letter: The letter that comes before in the alphabet (B→A, C→B, D→C)
- Following letter: The letter that comes after (A→B, B→C, C→D)
- Applied to both letters in the cell
Type 5 — Cell Rearrangement (Positional Shift)
The entire grid's cells are rearranged:
- Rows shift up/down
- Columns shift left/right
- Diagonal swap
- Rotational pattern (clockwise or anti-clockwise)
- Reverse order within rows
Solved Example 1 — Three-Step Transformation
Input Grid:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | B6H | K9I | P3R |
| Row 2 | D5K | — | V5S |
| Row 3 | F4T | G1X | M6Y |
Step 1 Rule: Replace each letter with its immediate following letter in the alphabet and increase the number by 1.
Step 1 Calculation:
| Cell | Original | Letters +1 | Number +1 | Result |
|---|---|---|---|---|
| R1C1 | B6H | C, I | 7 | C7I |
| R1C2 | K9I | L, J | 10 | L10J |
| R1C3 | P3R | Q, S | 4 | Q4S |
| R2C1 | D5K | E, L | 6 | E6L |
| R2C3 | V5S | W, T | 6 | W6T |
| R3C1 | F4T | G, U | 5 | G5U |
| R3C2 | G1X | H, Y | 2 | H2Y |
| R3C3 | M6Y | N, Z | 7 | N7Z |
Step 1 Grid:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | C7I | L10J | Q4S |
| Row 2 | E6L | — | W6T |
| Row 3 | G5U | H2Y | N7Z |
Step 2 Rules:
- (i) If number is even → subtract 2 from number, exchange the two letter positions, replace both letters with their preceding letters
- (ii) If number is odd → add 4 to number, replace both letters with their following letters
Step 2 Calculation:
| Cell | Step 1 | Even/Odd | Rule | Number Change | Letter Change | Result |
|---|---|---|---|---|---|---|
| R1C1 | C7I | Odd | (ii) | 7+4=11 | C→D, I→J | D11J |
| R1C2 | L10J | Even | (i) | 10-2=8 | Swap+Precede: J→I, L→K → I8K | I8K |
| R1C3 | Q4S | Even | (i) | 4-2=2 | Swap+Precede: S→R, Q→P → R2P | R2P |
| R2C1 | E6L | Even | (i) | 6-2=4 | Swap+Precede: L→K, E→D → K4D | K4D |
| R2C3 | W6T | Even | (i) | 6-2=4 | Swap+Precede: T→S, W→V → S4V | S4V |
| R3C1 | G5U | Odd | (ii) | 5+4=9 | G→H, U→V | H9V |
| R3C2 | H2Y | Even | (i) | 2-2=0 | Swap+Precede: Y→X, H→G → X0G | X0G |
| R3C3 | N7Z | Odd | (ii) | 7+4=11 | N→O, Z→A | O11A |
Note for Z→A: When Z is followed by the next letter, it wraps around to A.
Step 2 Grid:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | D11J | I8K | R2P |
| Row 2 | K4D | — | S4V |
| Row 3 | H9V | X0G | O11A |
Q: What appears in Row 3, Column 1 of Step 2?
Answer: H9V
Solved Example 2 — Vowel/Consonant Based Rules
Input Grid:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | AE3 | BK7 | IO2 |
| Row 2 | CD9 | — | UR5 |
| Row 3 | GH4 | EF1 | MN8 |
Step 1 Rules:
- If a cell contains two vowels → replace both with their opposite letters (A↔Z) and multiply the number by 2
- If a cell contains two consonants → swap their positions and add 3 to the number
- If a cell contains one vowel + one consonant → replace the vowel with the next letter and keep the consonant; subtract 1 from the number
Step 1 Calculation:
| Cell | Original | Vowel/Con | Rule Applied | Result |
|---|---|---|---|---|
| R1C1 | AE3 | Two vowels | A→Z, E→V, 3x2=6 | ZV6 |
| R1C2 | BK7 | Two consonants | Swap: KB, 7+3=10 | KB10 |
| R1C3 | IO2 | Two vowels | I→R, O→L, 2x2=4 | RL4 |
| R2C1 | CD9 | Two consonants | Swap: DC, 9+3=12 | DC12 |
| R2C3 | UR5 | One vowel + one con | U→V (next), keep R, 5-1=4 | VR4 |
| R3C1 | GH4 | Two consonants | Swap: HG, 4+3=7 | HG7 |
| R3C2 | EF1 | One vowel + one con | E→F (next), keep F, 1-1=0 | FF0 |
| R3C3 | MN8 | Two consonants | Swap: NM, 8+3=11 | NM11 |
Step 1 Grid:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | ZV6 | KB10 | RL4 |
| Row 2 | DC12 | — | VR4 |
| Row 3 | HG7 | FF0 | NM11 |
Q: What appears in Row 1, Column 3 of Step 1?
Answer: RL4
Solved Example 3 — Place Value Sum Rules
Input Grid:
| Col 1 | Col 2 | Col 3 | Col 4 | |
|---|---|---|---|---|
| Row 1 | DG | HM | BE | LK |
| Row 2 | NR | CF | JA | PQ |
Step 1 Rule: For each cell, calculate the sum of alphabetical place values of both letters. Based on the sum:
- If sum is even → swap letter positions
- If sum is odd → replace both letters with their opposite (A↔Z)
Step 1 Calculation:
| Cell | Letters | Place Values | Sum | Even/Odd | Action | Result |
|---|---|---|---|---|---|---|
| R1C1 | DG | D=4, G=7 | 11 | Odd | Opposite: D→W, G→T | WT |
| R1C2 | HM | H=8, M=13 | 21 | Odd | Opposite: H→S, M→N | SN |
| R1C3 | BE | B=2, E=5 | 7 | Odd | Opposite: B→Y, E→V | YV |
| R1C4 | LK | L=12, K=11 | 23 | Odd | Opposite: L→O, K→P | OP |
| R2C1 | NR | N=14, R=18 | 32 | Even | Swap: RN | RN |
| R2C2 | CF | C=3, F=6 | 9 | Odd | Opposite: C→X, F→U | XU |
| R2C3 | JA | J=10, A=1 | 11 | Odd | Opposite: J→Q, A→Z | QZ |
| R2C4 | PQ | P=16, Q=17 | 33 | Odd | Opposite: P→K, Q→J | KJ |
Step 1 Grid:
| Col 1 | Col 2 | Col 3 | Col 4 | |
|---|---|---|---|---|
| Row 1 | WT | SN | YV | OP |
| Row 2 | RN | XU | QZ | KJ |
Step 2 Rule: If a cell contains a vowel → replace the vowel with its preceding letter (A→Z, E→D, I→H, O→N, U→T). If no vowel → replace both consonants with their next letter.
Step 2 Calculation:
| Cell | Step 1 | Contains Vowel? | Action | Result |
|---|---|---|---|---|
| R1C1 | WT | No | Both next: W→X, T→U | XU |
| R1C2 | SN | No | Both next: S→T, N→O | TO |
| R1C3 | YV | No | Both next: Y→Z, V→W | ZW |
| R1C4 | OP | O is vowel | O→N, keep P | NP |
| R2C1 | RN | No | Both next: R→S, N→O | SO |
| R2C2 | XU | U is vowel | Keep X, U→T | XT |
| R2C3 | QZ | No | Both next: Q→R, Z→A | RA |
| R2C4 | KJ | No | Both next: K→L, J→K | LK |
Step 2 Grid:
| Col 1 | Col 2 | Col 3 | Col 4 | |
|---|---|---|---|---|
| Row 1 | XU | TO | ZW | NP |
| Row 2 | SO | XT | RA | LK |
Q: What appears in Row 2, Column 3 of Step 2?
Answer: RA
Deducing the "Special Pattern" in Step 3
Some problems have a Step 3 that follows a "special pattern" you must deduce from the example. Common patterns include:
1. Row Reversal:
Before: | A | B | C | After: | C | B | A |
| D | E | F | | F | E | D |
| G | H | I | | I | H | G |
2. Column Shift (Upward):
Before: | A | B | C | After: | D | E | F |
| D | E | F | | G | H | I |
| G | H | I | | A | B | C |
3. Diagonal Swap:
Before: | A | B | C | After: | I | B | G |
| D | E | F | | D | E | F |
| G | H | I | | C | H | A |
4. Clockwise Rotation:
Before: | A | B | C | After: | G | D | A |
| D | E | F | | H | E | B |
| G | H | I | | I | F | C |
5. Anti-clockwise Rotation:
Before: | A | B | C | After: | C | F | I |
| D | E | F | | B | E | H |
| G | H | I | | A | D | G |
How to deduce: The question will show one complete worked example (Input → Step 1 → Step 2 → Step 3). Compare Step 2 and Step 3 to identify which rearrangement was applied.
Step-by-Step Method Summary
For any matrix coding question:
-
Copy the input grid onto rough paper. Label rows (R1, R2, R3) and columns (C1, C2, C3).
-
Read ALL transformation rules before starting. Understand what each step does.
-
Apply Step 1 to every cell. Write the complete Step 1 grid.
-
Apply Step 2 to every cell of the Step 1 grid. Write the complete Step 2 grid.
-
If Step 3 exists, deduce or apply the rearrangement pattern.
-
Answer the question by locating the specific row-column-step combination asked.
Time investment: Matrix coding takes 5-7 minutes per set. This is normal. Do NOT rush — accuracy matters more than speed here.
Speed Tips for Exam
- Write the alphabetical opposite table on your rough sheet before starting: A↔Z, B↔Y, C↔X, D↔W, E↔V, F↔U, G↔T, H↔S, I↔R, J↔Q, K↔P, L↔O, M↔N.
- Process one row at a time, not one cell at a time. This maintains focus and reduces jumping around.
- Use shorthand: Write just the result in each cell. Do not write intermediate working inside the grid.
- Answer easy questions first. If Question 1 asks about Step 1 and Question 5 asks about Step 3, do Question 1 first — you only need to compute Step 1.
- Check if the empty cell matters. If a cell is blank in the input, it stays blank through all steps. Questions about that cell have the answer "Cannot be determined" or the cell is simply not asked about.
Common Traps
- Applying rules to the wrong step. Step 2 rules apply to the Step 1 grid, NOT the original input. This is the most common error.
- Letter wrap-around. After Z comes A (for "next letter" rules). Before A comes Z (for "preceding letter" rules). Students often forget this boundary case.
- Number edge cases. If a rule says "subtract 3" and the number is 2, does it become -1 or wrap around? Most questions avoid this, but read for any special instructions.
- Even/Odd confusion with multi-digit numbers. After transformations, numbers can become 10, 11, 12, etc. Check even/odd carefully for two-digit numbers.
- Vowel/Consonant check after transformation. If Step 1 changes letters, then Step 2's vowel/consonant check uses the Step 1 letters, not the original input letters.
- Row-Column notation. Some questions use "Row 1, Column 2" while others use "(1,2)" or "R1C2". Make sure you read the correct cell. Row is horizontal, Column is vertical.
- The empty/center cell. In 3x3 grids, the center cell (R2C2) is often left empty. No transformation applies to it. If asked about it, the answer is typically "blank" or the question does not reference it.
- Confusing "exchange positions" with "replace with opposite." Exchange means AB → BA (swap within cell). Opposite means A→Z, B→Y (alphabetical mirror). These are completely different operations.