Interview Q&A / Aptitude

IntermediateQuick answer1 min readUpdated 3 Oct 2026

In how many ways can 6 people sit around a round table? In how many of these do two particular friends sit together?

SHORT ANSWER

120 ways in total, since circular arrangements of n people number (n - 1)! = 5! = 120. With two friends together, treat them as one unit: (5 - 1)! x 2 = 24 x 2 = 48 ways.

Explain it simply

At a round table there is no first seat. Rotating everyone one place to the left gives the same seating, because each person still has the same neighbours. So fix one person's seat to remove the rotations, then arrange the others in a line: (n - 1)! ways.

Example

Question: 6 people at a round table. Total arrangements, and arrangements with friends P and Q together.

  1. Total = (6 - 1)! = 5! = 120.
  2. P and Q together: glue them into one unit. Now 5 units around a table: (5 - 1)! = 24.
  3. P and Q can swap within the unit: x 2.
  4. Together = 48.
  5. Not together = 120 - 48 = 72.

If the items are beads on a necklace that can be flipped over, clockwise and anticlockwise orders are the same, so divide by 2 again: (n - 1)!/2.

js
const f = n => (n <= 1 ? 1 : n * f(n - 1));
console.log(f(5)); // Output: 120
console.log(f(4) * 2); // Output: 48

What to say in the interview

"Fixing one person removes the rotations, so 6 people give 5 factorial, 120. With two friends glued together there are 5 units, 4 factorial times 2, which is 48."

Common mistakes

  • Using n! for a circle.
  • Forgetting the factor of 2 for the friends swapping places.

#aptitude#permutations-combinations#circular

Related questions

Practise more Aptitude questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Aptitude quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.