An `Order` class has `isPaid`, `isCancelled`, `isShipped` and `isRefunded` as booleans. What is wrong with that, and what would you do instead?

Answer it out loud before you open anything. The value of the flags below is in comparing them to what you actually said — including whether you named a cost, or only a principle.

The situation behind the question

The flags were added one at a time over two years. There are now nineteen places that read some combination of them, three that write more than one in sequence without a transaction, and a support ticket where a customer received a refund for an order that was never paid.

React to this

Say what you would change, what you would leave alone, and what you would need to know first.

The code, or the design, as it stands
Two of the writing sites look like this:

```ts
// in CancelOrderHandler
order.isCancelled = true
await repo.save(order)
await refunds.issue(order.id)   // sets isRefunded on a second load

// in ShipmentWebhook
if (!order.isCancelled) { order.isShipped = true; await repo.save(order) }
```

Describe a concrete sequence of events that produces the support ticket, and what your redesign does about it.

What it is really testing

Whether the candidate reasons about the state *space* rather than the fields. Four booleans admit sixteen combinations, of which perhaps five are meaningful; the design question is what happens to the other eleven, and the support ticket is the answer.

Where the mechanism is taught