In a community-events mobile app, how should an RSVP to a capacity-limited event be shown while the server has not yet confirmed a seat?
answer
- who pays if it is wrong
- the cached seat count is stale
- record the intent, not the outcome
- a distinct requested state
- online, just wait for the answer
basics
~10 sNot as "going". Record the request durably but show a distinct "requested — seat not confirmed" state, hold back anything that assumes a seat, and when online simply wait briefly for the server's answer.
solid answer
~50 sAn optimistic "going" is a promise the device cannot keep: the cached seat count is stale, and other members may take the last places while this phone is offline, so the refusal can arrive hours later after the member has planned around it. So the write is still recorded and queued — the intent is durable — but the screen shows a separate **requested** state that does not claim a seat, and nothing that assumes one (a calendar entry, a "you're going" share card, an entry pass) is offered yet. When the device is online, treat it as an online-only write: show a short in-progress state and the real outcome, since the round trip is quick and the outcome matters. Ordinary RSVPs to open events can stay optimistic — refusals are rare and cheap to undo.
go deeper
Recall that some actions depend on things only the server can decide, such as a free place, so the app must not claim success early.
Explain why a cached seat count is stale and how a distinct requested state differs from an optimistic going state.
Weigh refusal likelihood, cost to the member and reversibility to decide per write, and combine durable intent with online-only confirmation.
Set the product rule for which shared, limited resources ever get optimistic success, and make teams justify exceptions in those terms.
## Optimism is a bet, and someone pays when it loses An optimistic update bets that the server will accept the write. For most actions in a community-events app the bet is safe and cheap: starring an event, editing one's own note, replying to an open meetup. If the server refuses, the rollback is a small inline correction. A **capacity-limited** event changes both sides of the bet. The chance of refusal is real — the event has a fixed number of places and other members are claiming them — and the cost of a wrong "yes" lands on the member: they told friends, booked a babysitter, set out across town. Showing "going" and correcting it hours later is a broken promise, however polite the correction. ## Why the device cannot check capacity itself The event page may show "3 places left", and it is tempting to let the device confirm the RSVP when the number is above zero. That number is only the last value the device received. While this phone sat offline, other members' RSVPs reached the server and took places. The server enforces capacity; the device can only report what it last heard. A local check is useful as a hint ("probably full — you may be added to the waiting list") and never as a confirmation. ## Record the intent, not the outcome Not being optimistic about the **outcome** does not mean refusing the **action**. The device can still: - write the RSVP request durably into the local store with a pending marker, in one transaction with its queued request; - show it in a **distinct state** — "Requested — we'll confirm your place" — styled differently from "Going"; - hold back anything that assumes a seat: adding the event to the calendar as confirmed, a share card saying "I'm going", an entry pass; - move to **Going** or **Event full** when the answer arrives, with the reason in place. The member knows exactly what happened: they asked, and the answer is pending. ## Online: just wait for the answer When the device has a connection, a capacity-limited RSVP is a good fit for an **online-only write**: send it, show a short in-progress state on the button, and show the real answer. One platform's offline-first guide describes this strategy for writes that must happen online in near real time, such as a bank transfer, and suggests telling the user when the write fails or disabling the action while offline. For a seat at a small event, a second of waiting is a better experience than a confident "yes" that might be withdrawn. When offline, the product chooses between: 1. **Accept as a request** — the requested state above, confirmed or refused on reconnect; 2. **Disable with an explanation** — "Places are limited; reply when you're back online". Both are honest. What is not honest is a confident "going" that may be quietly reverted. ## A rule of thumb for which writes get optimism | Question | Optimistic is fine | Wait or show "requested" | |---|---|---| | How likely is a refusal? | rare — the member's own data | real — a shared, limited resource | | Who is hurt by a wrong "yes"? | nobody beyond a small correction | the member, who acts on it outside the app | | Can it be undone cleanly? | yes, nothing depends on it | no, others may see or rely on it | | How long until the answer? | doesn't matter | may be hours when offline | In the events app: RSVP to an open event, star, edit one's own event's description — optimistic. Claim a limited place — requested or online-only. **Cancelling** an RSVP to a capacity-limited event is usually safe to show optimistically, because the server rarely refuses a release; the place is simply not freed for others until the write lands. ## What the interviewer listens for - Recognising that "optimistic everywhere" is not a principle but a per-write bet. - Explaining why a cached count cannot confirm a limited resource. - Separating durable intent from claimed outcome, with a distinct visible state. - Choosing online-only behaviour where the outcome matters and the wait is short.
- If the RSVP request is refused because the event filled, what does the member see?The requested state turns into a clear outcome where it was shown: "The event was full when your reply arrived", with any next step the product offers, such as joining a waiting list. Because the app never claimed a seat, nothing they relied on has to be withdrawn.
- Would you make cancelling such an RSVP optimistic too?Usually yes: the server rarely refuses a release, and showing "not going" at once matches what the member decided. The cost is that the place is not freed for someone else until the cancellation reaches the server, which is acceptable for an event days away.
- Every write in an offline-first app should be shown optimistically.
- Showing "going" is harmless because a later rollback will correct it.
- A write that is not optimistic cannot be recorded while offline.
- Checking the cached seat count on the device makes the optimistic RSVP safe.
- A spinner that waits for the server is fine even when offline for hours.