Coding-Decoding MCQs for UPSC Prelims

89 practice questions on Coding-Decoding from the Logical Reasoning section of the UPSC Prelims syllabus. 89 come with a written explanation and 28 are actual previous year questions. Try the sample set below - the answer stays hidden until you ask for it.

47 Easy 38 Medium 4 Hard 28 from past papers

Sample questions

Q1
Previous year question medium

Consider the following: A + B means A is the son of B. A - B means A is the wife of B. What does the expression P + R - Q mean?

  1. A Q is the son of P.
  2. B Q is the wife of P.
  3. C Q is the father of P.
  4. D None of the above
Show answer and explanation

Correct answer: C - Q is the father of P.

Read the expression left to right using the defined operators. 'P + R' means P is the son of R, so R is a parent of P. 'R - Q' means R is the wife of Q. So R is the wife of Q and R is P's mother (a parent), which makes Q the husband of R and therefore the father of P. Hence (c) Q is the father of P. The official UPSC answer key marks this (c).

Q2
Previous year question medium

The letters of the word "INCOMPREHENSIBILITIES" are arranged alphabetically in reverse order. How many positions of the letter/letters will remain unchanged?

  1. A None
  2. B One
  3. C Two
  4. D Three
Show answer and explanation

Correct answer: C - Two

INCOMPREHENSIBILITIES has 21 letters with counts: I x 5, E x 3, N x 2, S x 2, and one each of C, O, M, P, R, H, B, L, T. In reverse alphabetical order the word becomes T S S R P O N N M L I I I I I H E E E C B, so the block of five I's occupies positions 11 to 15. In the original word, I's sit at positions 1, 13, 15, 17 and 19; comparing position by position, only positions 13 and 15 hold an I in both arrangements, and no other letter lands on its original position. So exactly two positions are unchanged - option (c). 'None' (a) misses the overlapping I block, 'One' (b) catches only one of the two coincidences, and 'Three' (d) overcounts.

Q3
Previous year question easy

The letters L, M, N, O, P, Q, R, S and T in their order are substituted by nine integers 1 to 9 but not in that order. 4 is assigned to P. The difference between P and T is 5. The difference between N and T is 3. What is the integer assigned to N?

  1. A 7
  2. B 5
  3. C 4
  4. D 6
Show answer and explanation

Correct answer: D - 6

P = 4. The difference between P and T is 5, so T = 4 + 5 = 9 (4 - 5 = -1 is not in the 1 to 9 range). The difference between N and T is 3, so N = 9 - 3 = 6 (9 + 3 = 12 is out of range). Hence N = 6.

Q4
Previous year question easy

In the English alphabet, the first 4 letters are written in opposite order; and the next 4 letters are written in opposite order and so on; and at the end Y and Z are interchanged. Which will be the fourth letter to the right of the 13th letter?

  1. A N
  2. B T
  3. C H
  4. D I
Show answer and explanation

Correct answer: B - T

Reversing each block of 4 letters and swapping Y and Z gives the new order: DCBA HGFE LKJI PONM TSRQ XWVU ZY. Counting along this arrangement, the 13th letter is P (the blocks contribute 4 letters each, so positions 13-16 are P, O, N, M). The fourth letter to the right of position 13 is the letter at position 17, which is T - option (b). Option (a) N is at position 15, option (c) H is at position 5, and option (d) I is at position 12, so none of them fits.

Q5
Previous year question medium

In some code, letters P, Q, R, S, T represent numbers 4, 5, 10, 12, 15. It is not known which letter represents which number. If Q - S = 2S and T = R + S + 3, then what is the value of P + R - T ?

  1. A 1
  2. B 2
  3. C 3
  4. D Cannot be determined due to insufficient data
Show answer and explanation

Correct answer: B - 2

From Q - S = 2S we get Q = 3S. Within {4, 5, 10, 12, 15} the possibilities are S = 4, Q = 12 or S = 5, Q = 15. Case S = 4, Q = 12: T = R + S + 3 = R + 7 with R, T from {5, 10, 15}; no pair works (5 + 7 = 12 is taken, 10 + 7 = 17 and 15 + 7 = 22 are not in the set). Case S = 5, Q = 15: T = R + 8 with R, T from {4, 10, 12}; only R = 4, T = 12 works, leaving P = 10. Then P + R - T = 10 + 4 - 12 = 2. The assignment is unique, so the value is 2.

Q6
Previous year question medium

The letters from A to Z are numbered from 1 to 26 respectively. If GHI = 1578 and DEF = 912, then what is ABC equal to?

  1. A 492
  2. B 468
  3. C 262
  4. D 246
Show answer and explanation

Correct answer: D - 246

Read each three-letter block as the concatenation of its letter numbers, then double it. G=7, H=8, I=9 gives '789', and 789 x 2 = 1578. D=4, E=5, F=6 gives '456', and 456 x 2 = 912. Applying the same rule, A=1, B=2, C=3 gives '123', and 123 x 2 = 246. So ABC = 246.

Q7
Previous year question medium

If LSJXVC is the code for MUMBAI, the code for DELHI is

  1. A CCIDD
  2. B CDKGH
  3. C CCJFG
  4. D CCIFE
Show answer and explanation

Correct answer: A - CCIDD

Apply a backward shift equal to each letter's position in the word. MUMBAI: M(-1)=L, U(-2)=S, M(-3)=J, B(-4)=X, A(-5 wrapping) gives V, I(-6)=C, so M U M B A I -> L S J X V C, which matches. Use the same rule on DELHI: D(-1)=C, E(-2)=C, L(-3)=I, H(-4)=D, I(-5)=D, giving CCIDD. Other options do not follow the position-based backward shift, so they fail.

Q8
Previous year question medium

If P means 'greater than (>)'; Q means 'less than (<)'; R means 'not greater than'; S means 'not less than' and T means 'equal to (=)', then consider the following statements : 1. If 2x (S) 3y and 3x (T) 4z, then 9y (P) 8z. 2. If x (Q) 2y and y (R) z, then x (R) z. Which of the statements given above is/are correct?

  1. A 1 only
  2. B 2 only
  3. C Both 1 and 2
  4. D Neither 1 nor 2
Show answer and explanation

Correct answer: D - Neither 1 nor 2

Decode the symbols: P is >, Q is <, R is <= (not greater than), S is >= (not less than), T is =. Statement 1: 2x >= 3y multiplied by 3 gives 6x >= 9y; 3x = 4z multiplied by 2 gives 6x = 8z. So 9y <= 6x = 8z, i.e. 9y <= 8z, which means 9y > 8z can never be concluded; Statement 1 is incorrect. Statement 2: x < 2y and y <= z give only x < 2z, not x <= z. Counterexample: y = 1, z = 1, x = 1.5 satisfies x < 2y and y <= z, but x <= z fails since 1.5 > 1. Statement 2 is also incorrect. Hence neither statement is correct.

Practice all 89 Coding-Decoding questions free

Timed practice, instant scoring, and explanations for every question. Free forever - no card, no catch.