← Remitly Interview Insights

Remitly·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026

Summary

System design round at Remitly focused entirely on geospatial search. Pretty niche compared to the usual distributed systems stuff I'd prepped for, but it was a solid problem with a lot of moving parts once you dig in.

Questions Asked (1)

Q1

Given a set of geographic coordinates and a query point, design a system to return the k nearest locations. Walk through how you'd compute distances, what data structures or indexes you'd use, and how you'd handle scale.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

I started with Haversine for great-circle distance which was fine, but I fumbled a bit when they pushed on edge cases like antimeridian crossings.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale (number of locations, query rate), latency, accuracy, and whether updates are needed. Then propose a two-phase approach: first use a spatial index like a geohash or R-tree to narrow down candidates, then compute exact distances (e.g., Haversine) and select top k using a max-heap. Discuss trade-offs between precomputation, indexing, and distributed processing for scale.

Pro tip: Mention that for very large scale, you can precompute geohash prefixes and use a distributed key-value store or search engine like Elasticsearch with geo-point indexing, but always validate with real-world constraints like Earth's curvature and edge cases near poles or the antimeridian.

1. Clarify Requirements and Constraints

Ask about the number of locations, query throughput, latency requirements, and whether the dataset is static or dynamic. This determines the choice of index and architecture.

2. Choose Distance Metric and Computation

Explain that Haversine or Vincenty formula is needed for accurate geographic distances, but for small areas, Euclidean distance on projected coordinates may suffice. Mention trade-offs between accuracy and speed.

3. Select Spatial Indexing Strategy

Propose using a spatial index such as R-tree, Quadtree, or Geohash to efficiently filter nearby candidates. For distributed systems, consider geohash-based sharding or using a search engine with geo capabilities.

4. Design Query Algorithm

Describe a two-step process: first, use the index to retrieve a set of candidate points within a bounding region (expanding if needed), then compute exact distances and use a max-heap of size k to find the k nearest.

5. Address Scalability and Trade-offs

Discuss horizontal scaling via sharding by geohash, caching frequent queries, and using approximate methods like k-d trees for lower latency. Mention trade-offs between precomputation, memory, and accuracy.

Key Points to Mention

  • Haversine formula for great-circle distance and its computational cost
  • Spatial indexes: R-tree, Quadtree, Geohash, and their use cases
  • Two-phase approach: index-based filtering followed by exact distance computation
  • Use of a max-heap (priority queue) to efficiently maintain top k results
  • Distributed strategies: sharding by geohash, using Elasticsearch or PostGIS
  • Trade-offs: accuracy vs. speed, precomputation vs. dynamic updates, memory vs. latency

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.