TECHNOLOGIESTieInn Technologies

Order and ranking

Order and ranking

5 min read · 8 practice questions · free

Useful for:IT testsBanksSSC / RailwaysTNPSC

What it is

People stand in a row or are ranked in a class. A person's position is given from one end, and you find the position from the other end, the total number, or how many are between two people.

How to solve it

The three formulas, all from one idea (count the person once):

  • total = position from top + position from bottom − 1
  • position from the right = total − position from the left + 1
  • people between two positions p and q (same end) = |p − q| − 1

Swaps. When A and B swap places, A takes B's old spot. So A's new position from one end, together with B's old position from the other end, gives the total.

Tips and shortcuts

  • The "− 1" (or "+ 1") is the whole trick. Without it you count the person twice (or not at all).
  • Draw a short line with the person marked, and write the counts on each side.
  • "Between" excludes the two people themselves.
  • For swaps, follow one person. After the swap, A is where B was, so B's old position from the right is A's new position from the right.

Solved examples

Example 1 (easy): total in a class

Anu is 14th from the top and 22nd from the bottom. How many students?

14 + 22 − 1 = 35.

Example 2 (medium): from the other end

In a row of 40, Bala is 17th from the left. Position from the right?

40 − 17 + 1 = 24th.

Example 3 (hard): a swap

In a row, Charu is 8th from the left and Deepa is 12th from the right. They swap; now Charu is 15th from the left. How many people in the row?

Charu now stands in Deepa's old place: 15th from the left and 12th from the right. Total = 15 + 12 − 1 = 26.

Example 4 (medium): people between

In a queue, Esha is 7th from the front and Farhan is 18th from the front. How many people stand between them?

18 − 7 − 1 = 10.

Try it

Pick an answer and press Check. Generated questions get new numbers every time you ask.

  1. Question 1easy

    In a class, Malar is 5th from the top and 10th from the bottom. How many students are in the class?

  2. Question 2easy

    In a class, Anand is 14th from the top and 25th from the bottom. How many students are in the class?

  3. Question 3easy

    In a class, Sangeetha is 23rd from the top and 16th from the bottom. How many students are in the class?

  4. Question 4medium

    In a row of 40 people, Anitha is 30th from the left. What is Anitha's position from the right?

  5. Question 5medium

    In a row of 22 people, Vimal is 4th from the left. What is Vimal's position from the right?

  6. Question 6medium

    In a row of 32 people, Prakash is 24th from the left. What is Prakash's position from the right?

  7. Question 7hard

    In a row, Kumar is 7th from the left and Vimal is 15th from the right. They swap places, and Kumar becomes 22nd from the left. How many people are in the row?

  8. Question 8hard

    In a row, Gopal is 8th from the left and Ashok is 14th from the right. They swap places, and Gopal becomes 16th from the left. How many people are in the row?

Ready for a timed set?

Fresh questions on just this problem type, with a score and every explanation at the end. Free.

Test me on this →