intermediate20 min

Seating Arrangements

Solve linear and circular seating puzzles by systematically checking clues, not guessing.

What you'll learn

  • Check whether a proposed seating order satisfies every given clue
  • Systematically search possible orders instead of guessing at a single arrangement
  • Reason about relative position (opposite, adjacent, left-of) in circular arrangements

Prerequisites

Explanation

Seating arrangement puzzles give you a set of people and a list of clues ("Priya sits immediately to the left of Raj", "Sam does not sit next to Ben"), then ask you to determine positions. The reliable method is elimination: instead of guessing one arrangement and hoping, systematically check candidate arrangements against every clue and discard the ones that fail.

In a linear arrangement, position is just an index in a row. "Immediately to the left of" means one position lower; "immediately to the right" means one position higher. If Raj is in seat 3, and Priya sits immediately to his left, Priya is in seat 2 -- not "somewhere before him," a specific, adjacent seat.

Circular arrangements add a wraparound: the last seat is adjacent to the first. "Directly opposite" in a circle of n evenly-spaced seats means exactly n/2 seats away in either direction. In a 6-seat circle, if A sits directly opposite D, there are 3 seats between them going either way around the circle.

The discipline that separates a correct answer from a guess: write every clue as a checkable rule, then test candidate orders against all of them at once, not one clue at a time in isolation. A candidate that satisfies clue 1 but fails clue 2 is not "half right" -- it's eliminated. With a small number of people, checking every possible order (a brute-force search) is fast and completely reliable; it's exactly what a computer does well, and exactly the discipline this lesson's exercises practice.

Linear vs. circular seating

Linear: seat positions 1, 2, 3, 4 in a row, with 'left of' and 'right of' meaning lower or higher index. Circular: seats arranged in a ring where the last seat is adjacent to the first, and 'opposite' means halfway around.

Example

Checking a proposed seating order against a list of clue functions.

function satisfiesClues(order, clues) {
  return clues.every((clue) => clue(order));
}
// satisfiesClues(['A', 'B', 'C'], [(o) => o.indexOf('A') < o.indexOf('B')]) -> true

Guided exercise

Guided exercise

Write satisfiesClues(order, clues) where order is an array of names and clues is an array of functions, each taking order and returning a boolean. Return true only if every clue function returns true for this order.

Checks: Confirms a satisfied clue · Detects a failed clue · plus 1 hidden check

Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.

Loading editor…

Stuck? Get a hint.

Independent exercise

Independent exercise

Write findValidArrangement(people, clues) that tries every possible ordering of people (assume 4 or fewer people) and returns the first order that satisfies every clue, or null if none do.

Checks: Finds the correct order for a simple clue · Finds the correct order for the reversed clue · plus 1 hidden check

Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.

Loading editor…

Stuck? Get a hint.

Common mistakes

  • Checking clues one at a time against different candidate arrangements instead of all clues against the same candidate.
  • Forgetting that circular arrangements wrap around, so the first and last positions are adjacent.
  • Confusing 'opposite' with 'adjacent' in a circular arrangement.

Knowledge check

Knowledge check

1. Five people sit in a row. Priya sits immediately to the left of Raj. If Raj is in seat 3, which seat is Priya in?
2. In a circular arrangement of 6 evenly-spaced people, A sits directly opposite D. How many seats separate A and D going either way around?
3. What makes the elimination method more reliable than guessing a single arrangement?

Takeaway

Test every clue against the same candidate arrangement at once -- a candidate is either fully valid or eliminated, never 'half right'.

Summary

Seating arrangement puzzles are solved by systematically checking candidate orders against every clue simultaneously. Linear arrangements use simple left/right positions; circular arrangements wrap around and require reasoning about opposite and adjacent seats.

Your notes

Notes save automatically.

Finished this lesson?

Mark it complete to track your progress and schedule a future review.

Next: Puzzles and Grouping