PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Stripe

Generate a ride map image via POST API

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competency in geospatial data processing and HTTP API integration, including JSON parsing, coordinate batching for polylines, overlay construction, and handling API responses.

  • medium
  • Stripe
  • Software Engineering Fundamentals
  • Software Engineer

Generate a ride map image via POST API

Company: Stripe

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

You are given a local JSON file `ride-simple.json` containing a recorded bike ride as an ordered list of GPS points. Assume the file format is: ```json { "points": [ {"lat": 47.58, "lon": -122.31}, {"lat": 47.581, "lon": -122.309}, ... ] } ``` You are also given a map-rendering HTTP API. The **only** allowed endpoint is: - `POST /render` - Request: JSON describing the map to render. - Response: raw PNG bytes (content-type `image/png`). ### Overlay schema (assumed) Your `POST /render` JSON may include: - `center`: `{ "lat": number, "lon": number }` - `width`: integer pixels - `height`: integer pixels - `zoom`: integer - `markers`: array of `{ "lat": number, "lon": number, "type": "start"|"stripe" }` - `paths`: array of `{ "points": [{"lat":..., "lon":...}, ...], "color": "blue"|"brown" }` ## Tasks 1. Load `ride-simple.json` and extract the ordered coordinate list. 2. Using only `POST /render`, render and save a map image for the following view settings: ```json { "center": {"lat": 47.579, "lon": -122.31}, "width": 400, "height": 600, "zoom": 13 } ``` 3. Render and save a second map image that includes overlays derived from the ride coordinates: - Add a `start` marker at the **first** coordinate. - Add a `stripe` marker at the **last** coordinate. - Draw the ride polyline by splitting the coordinate list into consecutive chunks of 10 points: - Chunk 1 (points 1–10): blue - Chunk 2 (points 11–20): brown - Chunk 3 (points 21–30): blue - ... alternating until all points are used. - Use the same view settings as in task (2). ## Output - Two PNG files saved to disk (e.g., `map_view.png` and `map_ride.png`). ## Edge cases to handle - Fewer than 2 points in the ride file. - Total points not divisible by 10 (final chunk shorter). - Network errors or non-200 responses from the render API.

Quick Answer: This question evaluates a candidate's competency in geospatial data processing and HTTP API integration, including JSON parsing, coordinate batching for polylines, overlay construction, and handling API responses.

Related Interview Questions

  • Debug Validation Error Aggregation - Stripe (hard)
Stripe logo
Stripe
Jan 22, 2026, 12:00 AM
Software Engineer
Onsite
Software Engineering Fundamentals
19
0
Loading...

You are given a local JSON file ride-simple.json containing a recorded bike ride as an ordered list of GPS points.

Assume the file format is:

{
  "points": [
    {"lat": 47.58, "lon": -122.31},
    {"lat": 47.581, "lon": -122.309},
    ...
  ]
}

You are also given a map-rendering HTTP API. The only allowed endpoint is:

  • POST /render
    • Request: JSON describing the map to render.
    • Response: raw PNG bytes (content-type image/png ).

Overlay schema (assumed)

Your POST /render JSON may include:

  • center : { "lat": number, "lon": number }
  • width : integer pixels
  • height : integer pixels
  • zoom : integer
  • markers : array of { "lat": number, "lon": number, "type": "start"|"stripe" }
  • paths : array of { "points": [{"lat":..., "lon":...}, ...], "color": "blue"|"brown" }

Tasks

  1. Load ride-simple.json and extract the ordered coordinate list.
  2. Using only POST /render , render and save a map image for the following view settings:
    {
      "center": {"lat": 47.579, "lon": -122.31},
      "width": 400,
      "height": 600,
      "zoom": 13
    }
    
  3. Render and save a second map image that includes overlays derived from the ride coordinates:
    • Add a start marker at the first coordinate.
    • Add a stripe marker at the last coordinate.
    • Draw the ride polyline by splitting the coordinate list into consecutive chunks of 10 points:
      • Chunk 1 (points 1–10): blue
      • Chunk 2 (points 11–20): brown
      • Chunk 3 (points 21–30): blue
      • ... alternating until all points are used.
    • Use the same view settings as in task (2).

Output

  • Two PNG files saved to disk (e.g., map_view.png and map_ride.png ).

Edge cases to handle

  • Fewer than 2 points in the ride file.
  • Total points not divisible by 10 (final chunk shorter).
  • Network errors or non-200 responses from the render API.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Stripe•More Software Engineer•Stripe Software Engineer•Stripe Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.