# Design a geofencing service: system design interview question

> High location volume, overlapping fences, uncertain GPS fixes, and reliable enter and exit events.

Source: https://sysround.com/questions/design-geofencing-service
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design a service that detects when devices enter or leave geographic boundaries. The service must handle many location updates and limit false transitions from GPS noise."

## What to clarify first

- Scale
- Fence catalog
- Read and write mix
- GPS quality and false transitions
- Transition meaning
- Latency
- Update order
- Consistency and availability
- Durability and delivery
- Scope limits

## Scope of a strong answer

Core requirements:

- Register circles and polygons as geographic fences
- Accept device location updates
- Detect stable enter and exit transitions
- Deliver transition events to consumers

Usually out of scope:

- Collect GPS fixes on devices
- Reconstruct routes between location samples
- Support worldwide deployment
- Build a map display

## What interviewers probe

### Which fences apply

Most fences are irrelevant to each fix. A search must avoid missed matches and still find exits beyond the previous fence.

### Locations near a boundary

GPS error can place a stationary device on either side of a boundary. Less false activity requires more evidence and adds delay.

### Device history and event delivery

Late fixes can reverse state incorrectly. Worker failures can separate a state change from its event or create conflicting device histories.

## Common mistakes

- A candidate treats each GPS fix as an exact position.
- A candidate ignores prior memberships when the device leaves the spatial search area.
- A candidate changes confirmed state when an older fix arrives.
- A candidate lets duplicate fixes count as independent evidence.
- A candidate changes state without a durable event recovery path.
- A candidate promises continuous movement detection from sparse location samples.

## The bar by level

- **Senior:** Meets peak load with bounded candidate work. Handles stale fixes, worker recovery, and atomic state and event commits. Explains noise and delay trade-offs.
- **Staff+:** Quantifies overlap costs and recovery capacity. Defines ownership guarantees during failures. Sets evidence policies from test traces and adapts guarantees for catalog changes.

Practice this question with an AI interviewer: https://sysround.com/practice/new?problem=geofencing-service


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews. It has a voice or typed AI interviewer and a shared whiteboard. At the end, you get feedback on each skill and a model answer. The AI feedback can be wrong.
