Search
⌘K
Get Premium
Common Problems

Strava

Scaling Writes
Real-time Updates
ByEvan King·Published ·
medium

Try This Problem Yourself

Practice with guided hints and real-time feedback

Understanding the Problem

🏃‍♂️🚴‍♀️ What is Strava? Strava is a fitness tracking application that allows users to record and share their physical activities, primarily focusing on running and cycling, with their network. It provides detailed analytics on performance, routes, and allows social interactions among users.
While Strava supports a wide variety of activities, we'll focus on running and cycling for this question.

Functional Requirements

Core Requirements
  1. Users should be able to start, pause, stop, and save their runs and rides.
  2. While running or cycling, users should be able to view activity data, including route, distance, and time.
  3. Users should be able to view details about their own completed activities as well as the activities of their friends.
Below the Line (Out of Scope)
  • Adding or deleting friends (friend management).
  • Authentication and authorization.
  • Commenting or liking runs.

Non-Functional Requirements

Core Requirements
  1. The system should be highly available (availability >> consistency).
  2. The app should function in remote areas without network connectivity.
  3. The app should provide the athlete with accurate and up-to-date local statistics during the run/ride.
  4. The system should scale to support 10 million concurrent activities.

The Set Up

Defining the Core Entities

The API

High-Level Design

1) Users should be able to start, pause, stop, and save their runs and rides.

2) While running or cycling, users should be able to view activity data, including route, distance, and time.

3) Users should be able to view details about their own completed activities as well as the activities of their friends.

Potential Deep Dives

1) How can we support tracking activities while offline?

2) How can we scale to support 10 million concurrent activities?

3) How can we support realtime sharing of activities with friends?

4) How can we expose a leaderboard of top athletes?

Purchase Premium to Keep Reading

Unlock this article and so much more with Hello Interview Premium

Schedule a mock interview

Meet with a FAANG senior+ engineer or manager and learn exactly what it takes to get the job.

Schedule a Mock Interview