Design Address Autocomplete

Medium35 min
1 / 30
understanding8 min read

Problem Statement: Address Autocomplete at Ride-App Scale

Problem Statement: Address Autocomplete at Ride-App Scale — address autocomplete interview depth

Problem Statement: Address Autocomplete at Ride-App Scale

Google, Mapbox, and HERE interviews frame autocomplete as a latency-critical read path: every keystroke triggers a ranked suggestion list biased by GPS viewport, language, and recent rides. The product goal is trustworthy pickup/drop-off selection in under 150ms p95 while controlling third-party geocoding cost via session tokens and aggressive edge caching of hot prefixes.

PhaseunderstandingSectionsec-01
Mechanismprefix index + geo bias + provider session tokens

Operational metrics

  • suggest_p95 120ms
  • 14k QPS avg
  • 8 keystrokes/session

Failure modes to mention aloud

  • Stale viewport bias after user pans map—refresh location_bias each suggest call.
  • Provider session token reuse across users—bill shock and wrong attribution.
  • Returning airport IATA codes without city disambiguation confuses riders.

Deep dive

Google, Mapbox, and HERE interviews frame autocomplete as a latency-critical read path: every keystroke triggers a ranked suggestion list biased by GPS viewport, language, and recent rides. The product goal is trustworthy pickup/drop-off selection in under 150ms p95 while controlling third-party geocoding cost via session tokens and aggressive edge caching of hot prefixes.

javaOne Dark Pro
1public record SuggestQuery(String q, double lat, double lng, String sessionToken) {
2 public String cacheKey() { return q.toLowerCase() + ":" + Math.round(lat * 100) + ":" + Math.round(lng * 100); }
3}
pythonOne Dark Pro
1SuggestQuery = TypedDict("SuggestQuery", {"q": str, "lat": float, "lng": float, "session": str})
2
3def cache_key(q: str, lat: float, lng: float) -> str:
4 return f"{q.lower()}:{round(lat,2)}:{round(lng,2)}"
typescriptOne Dark Pro
1export interface SuggestQuery { q: string; lat: number; lng: number; sessionToken: string }
2export function cacheKey({ q, lat, lng }: SuggestQuery): string {
3 return `${q.toLowerCase()}:${lat.toFixed(2)}:${lng.toFixed(2)}`;
4}

Why interviewers care

Address Autocomplete interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: Address Autocomplete at Ride-App Scale that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • prefix index + geo bias + provider session tokens
  • suggest_p95 120ms
  • 14k QPS avg
  • 8 keystrokes/session
  • understanding phase checkpoint
Interviewer signal
sec-01: Mention prefix index + geo bias + provider session tokens with numbers (suggest_p95 120ms).
Common mistake
sec-01: Treating autocomplete like low-QPS CRUD—keystrokes dominate traffic.
Pro tip
sec-01: State cache key (prefix+geohash+lang) before drawing microservices.

Section Rescue Kit

Buzzwords to use:

prefixsession_token

Safe statements:

  • "Let me estimate keystroke-driven QPS before naming databases for Problem Statement: Address Autocomplete at Ride-App Scale."
  • "I'll hash autocomplete queries in logs—addresses are PII."
Design Address Autocomplete - System Design | WinJob | WinJob