UPSC Prelims 2026 CSAT Paper II · Q18 of 70 Mental Ability medium

A pattern formed by two characters a and b is repeated more than once in the following string : x b x a x a x x a x a x bab What is x x in the 7th and 8th positions from the left in the above string?

  1. (a) aa
  2. (b) ab
  3. (c) ba
  4. (d) bb ✓ UPSC's answer

Why the answer is (d)

• The string is given as: x b x a x a x x a x a x b a b.

• We need to identify the characters at the 7th and 8th positions from the left.

• Counting the positions: 1st is x, 2nd is b, 3rd is x, 4th is a, 5th is x, 6th is a.

• The 7th character is x and the 8th character is x.

• Therefore, the pattern at the 7th and 8th positions is 'xx'.

• However, the question asks what 'x' represents in the context of the pattern formed by 'a' and 'b'. The string contains 'x' as a placeholder for the unknown character.

• Looking at the options, they are pairs of 'a' and 'b'. This implies 'x' is a variable that takes the value of either 'a' or 'b' to form a repeating pattern.

• Let's re-read carefully: 'A pattern formed by two characters a and b is repeated more than once'. The string is `x b x a x a x x a x a x b a b`.

• Let's assume the pattern is of length 2, e.g., `ab`, `ba`, `aa`, or `bb`.

• If the pattern is `ab`, the string would be `ab ab ab ab ab ab ab ab ab`. This does not match `x b x a ...`.

• If the pattern is `ba`, the string would be `ba ba ba ba ba ba ba ba ba`. This does not match.

• Let's look at the fixed characters in the string: `x b x a x a x x a x a x b a b`.

• Positions: 1:x, 2:b, 3:x, 4:a, 5:x, 6:a, 7:x, 8:x, 9:a, 10:x, 11:a, 12:x, 13:b, 14:a, 15:b.

• The question asks 'What is x x in the 7th and 8th positions'. This phrasing is slightly ambiguous. It likely means 'What are the values of the characters at the 7th and 8th positions, which are denoted by x?'.

• Let's test the options for the value of 'x'.

• If x = 'a', the string becomes: `a b a a a a a a a a a a b a b`. Does this contain a repeating pattern of two characters? No obvious simple 2-char repeat.

• If x = 'b', the string becomes: `b b b a b a b b a b a b b a b`. Let's check for a repeating pattern. The substring `ba` appears at 3-4, 5-6, 9-10, 11-12. The substring `bb` appears at 1-2, 7-8, 13-14? No, 13 is b, 14 is a. Wait, 13 is b, 14 is a, 15 is b. So `ba` at 13-14? No, 13:b, 14:a. Yes. So `ba` repeats.

• Let's look at the structure again. `x b x a x a x x a x a x b a b`.

• If x = 'b', the string is `b b b a b a b b a b a b b a b`.

• Let's check if there is a repeating pattern of length 2. `bb`, `ba`, `ab`, `bb`, `ba`, `ab`, `bb`, `ba`, `ab`, `bb`, `ba`, `ab`? No.

• Let's look at the options again. (a) aa, (b) ab, (c) ba, (d) bb. The question asks 'What is x x'. This implies the answer is the pair of characters at pos 7 and 8. Since both are 'x', the answer must be a pair of identical characters, i.e., 'aa' or 'bb'. This eliminates (b) and (c).

• So x is either 'a' or 'b'.

• If x = 'a', pos 7 and 8 are 'a', 'a'. Option (a).

• If x = 'b', pos 7 and 8 are 'b', 'b'. Option (d).

• We must determine if x is 'a' or 'b' based on the condition 'A pattern formed by two characters a and b is repeated more than once'.

• Let's check x = 'b': String is `b b b a b a b b a b a b b a b`.

• Let's check x = 'a': String is `a b a a a a a a a a a a b a b`.

• In the x='b' case, look at the sequence: `b b`, `b a`, `b a`, `b b`, `a b`, `a b`, `b a`, `b`? No.

• Let's look at the string `x b x a x a x x a x a x b a b`.

• Notice the segment `x a x a` at positions 3-6 and 9-12? No, 9 is a, 10 is x, 11 is a, 12 is x. So `a x a x`.

• If x = 'b', positions 3-6 are `b a b a`. Positions 9-12 are `a b a b`. These are different.

• If x = 'a', positions 3-6 are `a a a a`. Positions 9-12 are `a a a a`. This is a repeating pattern of `aa`.

• However, the pattern is formed by 'a' and 'b'. A pattern of just 'a' doesn't use 'b'.

• Let's re-examine the string with x='b': `b b b a b a b b a b a b b a b`.

• Is there a repeating pattern? `ba` appears at 3-4, 5-6, 9-10, 11-12, 13-14. That's 5 times. The pattern `ba` is formed by a and b. It is repeated more than once.

• Let's re-examine the string with x='a': `a b a a a a a a a a a a b a b`.

• Pattern `aa` appears many times. But does it use 'b'? The pattern itself is `aa`. The condition says 'A pattern formed by two characters a and b'. This usually implies the pattern consists of both, or the set of characters used in the pattern is {a, b}. If the pattern is `aa`, it is formed by 'a'. It doesn't use 'b'.

• If the pattern is `ba` (in the x='b' case), it uses both 'a' and 'b'.

• Therefore, x must be 'b'.

• Consequently, the characters at the 7th and 8th positions are 'b' and 'b'.

• Thus, the answer is 'bb'.

Why the other options are wrong

(a) aa
If x were 'a', the repeating pattern would be 'aa', which does not utilize the character 'b' as required by the problem statement.
(b) ab
The 7th and 8th positions are both denoted by 'x', so they must be identical characters, making a mixed pair like 'ab' impossible.
(c) ba
The 7th and 8th positions are both denoted by 'x', so they must be identical characters, making a mixed pair like 'ba' impossible.

Asked in the CSAT Paper II of the UPSC Civil Services Preliminary Examination 2026, held on 24 May 2026. Question and answer key: Union Public Service Commission. Explanation: UPSC Answer Check.

Reading the answer is not the same as getting it right under a clock. Practise this question with UPSC's negative marking, and anything you miss goes into an error notebook until you get it right twice.

Practise this paper free