Skip to content

Tuesday, 6 October 2026 · New Delhi

CSAT· Prelims

Number Ranking and Sequence for CSAT

Master CSAT rank questions: the total formula, interchanges, middle-person puzzles, and digit sequences, with solved UPSC examples.

By the RaahUPSC editorial desk29 September 2026Updated 30 September 202612 min readbasic

Number ranking and sequence questions ask where a person or item stands in an ordered line, queue, or class, or they ask you to count patterns inside a string of digits. A typical stem says 'Rajiv ranks 17th from the top and 48th from the bottom; how many students are in the class?' Others hide a rank behind an interchange ('A and B swap places') or ask how many times a digit pattern occurs in a sequence. In CSAT Paper II, the qualifying paper that needs 33 percent to clear, these are quick, formula-driven marks: three rank relations cover almost every question.

The three rank relations

Every rank question is built on one idea: a person's rank from the top and from the bottom overlap at that person. If Rajiv is 17th from the top and 48th from the bottom, the 16 people above him plus the 47 below him plus Rajiv himself give 16 + 47 + 1 = 64 students. The compact form is total = rank from top + rank from bottom - 1, and the subtraction of 1 corrects for counting the person twice. Two companion relations follow: rank from bottom = total - rank from top + 1, and rank from the other end = total - given rank + 1, which answers questions like 'Mohan is 7th from the right in a row of 50; what is his position from the left?' (50 - 7 + 1 = 44th).

The interchange trick handles swap questions. If A is 11th from the left and B is 10th from the right, and after they interchange A becomes 18th from the left, then B's old seat is now A's: B was 18th from the left and 10th from the right, so the total is 18 + 10 - 1 = 27, and the number of people other than A and B is 25 (CSAT 2014). Whenever two people swap, the new rank of one equals the old rank of the other from the same end; that single insight unlocks the total.

Given

Find

Formula

Rank from top (T), rank from bottom (B)

Total students

T + B - 1

Total (N), rank from top (T)

Rank from bottom

N - T + 1

Rank from right (R), total (N)

Rank from left

N - R + 1

A and B interchange; A's new rank from left

B's old rank from left

Same as A's new rank

People between X and Y

Gap count

Higher rank - lower rank - 1

Middle-person and overlap puzzles

In middle-person questions, someone sits exactly between two others whose positions you know. If X is 14th from the front, Y is 17th from the end in a queue of 48, and Z is exactly between them, first convert Y's rank: 48 - 17 + 1 = 32nd from the front. Z sits midway between 14 and 32, which is position 23, and the people between X and Z are 23 - 14 - 1 = 8 (CSAT 2011). The method is always: convert both ranks to the same end, find the midpoint, then count the gap.

Overlap puzzles describe gaps between named people plus head and tail counts, and ask for the minimum total. In CSAT 2022, three people stand in a queue: 4 persons between A and B, 7 between B and C, 11 ahead of C, 13 behind A. Try the order B, A, C from the front: B at 4, A at 9 (4 between), C at 12 (2 between A and C, plus A itself makes 7 between B and C). Ahead of C means 11 people before position 12, which fits exactly, and behind A means 13 people after position 9, giving a total of 9 + 13 = 22. Minimum-total questions are solved by trying the orders that let the given counts overlap instead of stacking.

Sequence and digit-pattern questions

The second family in this topic works on strings of digits rather than people. A sequence question gives a fixed digit string and asks how many times a pattern occurs, such as 'how many 5s are immediately followed by 7 but not immediately preceded by 3' in 1, 5, 7, 3, 5, 7, 4, 3, 5, 7 (CSAT 2019). Scan left to right and test each 5: the first 5 is followed by 7 and preceded by 1, so it counts; the second is preceded by 3, so it fails; the third is preceded by 3, so it fails. Answer: 1. The discipline is to check both neighbours of every candidate digit, not just the forward one.

Similarly, 'how many odd numbers are followed by an odd number' in a long digit string (CSAT 2020) is solved by walking the string once and counting each adjacent odd-odd pair. Mark each pair as you go so none is counted twice. These questions look intimidating because the string is long, but the procedure is purely mechanical and error-proof if you scan in order.

Worked examples

Example 1 (basic total). Priya ranks 20th from the top and 35th from the bottom in a class. How many students? Total = 20 + 35 - 1 = 54. The minus 1 removes the double count of Priya herself, the single most forgotten step in this topic.

Example 2 (rank after joining). In a class of 45, a boy is ranked 20th. Two boys join and his rank drops by one. What is his new rank from the end? (CSAT 2013). After two join, the class has 47 and his rank from the top is 21st. From the end: 47 - 21 + 1 = 27th. Update both the total and the rank before converting ends.

Example 3 (girls and boys). In a class of 60 where girls are twice the boys, Kamal, a boy, ranks 17th from the top, with 9 girls ahead of him. How many boys rank after him? (CSAT 2016). Girls = 40, boys = 20. Of the 16 students ahead of Kamal, 9 are girls, so 7 are boys. Boys after Kamal = 20 - 7 - 1 = 12. Split the 'ahead' group by category before subtracting.

Example 4 (relative positions). A is 16th from the left in a row, V is 18th from the right, and G is 11th to the right of A and 3rd to the right of V. How many boys in the row? (CSAT 2020). G is at 16 + 11 = 27th from the left. G is 3rd to the right of V, so V is at 27 - 3 = 24th from the left. V is 18th from the right, so total = 24 + 18 - 1 = 41. Chain the relative offsets first, then apply the total formula once.

Common traps

  • Forgetting the minus 1 in total = top rank + bottom rank - 1, which overcounts by exactly one.

  • Mixing ends: converting a 'from the right' rank with the 'from the top' formula without converting first.

  • In interchange questions, using A's new rank as A's old rank; after a swap, A's new rank equals B's old rank.

  • In digit sequences, checking only the forward neighbour and ignoring the 'not preceded by' condition.

  • In minimum-total puzzles, stacking all counts end to end instead of letting head, gap, and tail counts overlap.

Speed tips for the exam hall

  • Write the three rank relations at the top of your rough sheet and reuse them for the whole set.

  • Convert every rank to the same end (usually the left or top) before doing any arithmetic.

  • For interchange questions, circle the swapped ranks: new of one equals old of the other.

  • Scan digit strings strictly left to right, testing both neighbours of each candidate digit.

  • In overlap puzzles, sketch two or three orders quickly and pick the one with the smallest total.

Key Terms

  • Rank: a person's position in an ordered line, queue, or class, counted from a stated end such as the top, bottom, left, or right.

  • Total formula: total persons = rank from one end + rank from the other end - 1, correcting for the person counted twice.

  • End conversion: the rule rank from the other end = total - given rank + 1, used to express every rank from the same end.

  • Interchange: a swap of positions between two people, after which each person's new rank from an end equals the other's old rank from that end.

  • Middle person: someone placed exactly midway between two others, found by averaging their same-end ranks.

  • Overlap puzzle: a minimum-total question in which gaps between named people and head or tail counts share persons and must be overlapped, not added.

  • Sequence question: a digit-string question asking how many times a pattern, such as a digit with stated neighbours, occurs in the string.

Practice questions

Q1Prelims practice

In a queue, Mr. X is fourteenth from the front and Mr. Y is seventeenth from the end, while Mr. Z is exactly in between Mr. X and Mr. Y. If Mr. X is ahead of Mr. Y and there are 48 persons in the queue, how many persons are there between Mr. X and Mr. Z? [UPSC CSE 2011]

Show answer

Answer: (C) Y is 48 - 17 + 1 = 32nd from the front. Z is midway between 14 and 32, at position 23. The gap between X (14) and Z (23) is 23 - 14 - 1 = 8.

Q2Prelims practice

In a class of 45 students, a boy is ranked 20th. When two boys joined, his rank was dropped by one. What is his new rank from the end? [UPSC CSE 2013]

Show answer

Answer: (C) The class becomes 47 and his rank from the top becomes 21st. From the end that is 47 - 21 + 1 = 27th.

Q3Prelims practice

In a row 'A' is the 11th position from the left and 'B' is in the 10th position from the right. If 'A' and 'B' interchange, then 'A' becomes 18th from the left. How many persons are there in the row other than 'A' and 'B'? [UPSC CSE 2014]

Show answer

Answer: (C) After the swap, A sits in B's old seat, so B was 18th from the left and 10th from the right. Total = 18 + 10 - 1 = 27, and excluding A and B gives 25.

Q4Prelims practice

In a class of 60 students, where the number of girls is twice that of boys, Kamal, a boy, ranked seventeenth from the top. If there are 9 girls ahead of Kamal, the number of boys in rank after him is [UPSC CSE 2016]

Show answer

Answer: (B) There are 40 girls and 20 boys. Of the 16 students ahead of Kamal, 9 are girls, so 7 are boys. Boys after Kamal = 20 - 7 - 1 = 12.

Q5Prelims practice

15 students failed in a class of 52. After removing the names of failed students, a merit order list has been prepared in which the position of Ramesh is 22nd from the top. What is his position from the bottom? [UPSC CSE 2017]

Show answer

Answer: (C) The merit list has 52 - 15 = 37 students. From the bottom, Ramesh is 37 - 22 + 1 = 16th.

Q6Prelims practice

In the sequence 1, 5, 7, 3, 5, 7, 4, 3, 5, 7, how many such 5s are there which are not immediately preceded by 3 but are immediately followed by 7? [UPSC CSE 2019]

Show answer

Answer: (A) Check each 5 with both neighbours: the first 5 is followed by 7 and preceded by 1 (counts); the second and third 5s are preceded by 3 (fail). Only 1 qualifies.

Q7Prelims practice

A is 16th from the left end in a row of boys and V is 18th from the right end. G is 11th from A, towards the right and 3rd from V, towards the right ends. How many boys are there in the row? [UPSC CSE 2020]

Show answer

Answer: (B) G is at 16 + 11 = 27th from the left. G is 3rd to the right of V, so V is 24th from the left. Total = 24 + 18 - 1 = 41.

Q8Prelims practice

Three persons A, B and C are standing in a queue not necessarily in the same order. There are 4 persons between A and B, and 7 persons between B and C. If there are 11 persons ahead of C and 13 behind A, what could be the minimum number of persons in the queue? [UPSC CSE 2022]

Show answer

Answer: (A) With the order B, A, C from the front, B is at 4, A at 9 (4 between), and C at 12 (7 between B and C). Then 11 are ahead of C and 13 behind A exactly, giving 9 + 13 = 22, the minimum.

Answer key

  • Q1 - (c). Y is 48 - 17 + 1 = 32nd from the front. Z is midway between 14 and 32, at position 23. The gap between X (14) and Z (23) is 23 - 14 - 1 = 8.

  • Q2 - (c). The class becomes 47 and his rank from the top becomes 21st. From the end that is 47 - 21 + 1 = 27th.

  • Q3 - (c). After the swap, A sits in B's old seat, so B was 18th from the left and 10th from the right. Total = 18 + 10 - 1 = 27, and excluding A and B gives 25.

  • Q4 - (b). There are 40 girls and 20 boys. Of the 16 students ahead of Kamal, 9 are girls, so 7 are boys. Boys after Kamal = 20 - 7 - 1 = 12.

  • Q5 - (c). The merit list has 52 - 15 = 37 students. From the bottom, Ramesh is 37 - 22 + 1 = 16th.

  • Q6 - (a). Check each 5 with both neighbours: the first 5 is followed by 7 and preceded by 1 (counts); the second and third 5s are preceded by 3 (fail). Only 1 qualifies.

  • Q7 - (b). G is at 16 + 11 = 27th from the left. G is 3rd to the right of V, so V is 24th from the left. Total = 24 + 18 - 1 = 41.

  • Q8 - (a). With the order B, A, C from the front, B is at 4, A at 9 (4 between), and C at 12 (7 between B and C). Then 11 are ahead of C and 13 behind A exactly, giving 9 + 13 = 22, the minimum.

Frequently asked questions

Why do we subtract 1 in the total formula?

Because adding the rank from the top and the rank from the bottom counts the person twice, once in each rank. Subtracting 1 corrects this double count. Forgetting it is the most common one-mark error in this topic.

How do I solve interchange questions?

Remember that after A and B swap, A's new rank from an end equals B's old rank from that end. Use the new rank together with the unchanged rank from the other end in the total formula, then subtract the two named people if asked.

What is the method for digit-sequence counting questions?

Scan the string strictly left to right and test every candidate digit against both neighbour conditions. Mark each counted occurrence so you never double count, and re-read the 'not preceded by' type conditions carefully.

How do minimum-total queue puzzles work?

Try the possible orders of the named people and let the head count, the gaps, and the tail count overlap as much as the clues allow. The valid order with the smallest total is the answer; sketching two orders is usually enough.

CsatNumber Rankingupsc-prelimsCsat Paper 2explained
Ask Raah