← Stripe Interview Insights

Stripe·Software Engineer·Take-home Assignment·Intermediate

Intermediate
Apr 2026

Summary

Take-home assignment from Bikemap, filed under Stripe for some reason. Three questions total, this is the second one. Pretty practical stuff, no tricks.

Questions Asked (1)

Q1

You're given a working curl command that makes a POST request to an API endpoint (with URL, headers, JSON body, and auth). Rewrite it in a programming language of your choice, keeping everything identical, and confirm the response matches.

API & IntegrationsTechnical Trade-offs
Author's notes

Pretty much a sanity check on whether you can read an HTTP request and translate it into actual code.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by dissecting the curl command to identify all components: HTTP method, URL, headers, JSON body, and authentication. Then, choose a language you're comfortable with (e.g., Python with requests) and replicate each part exactly, including header casing and body serialization. Finally, execute the code, capture the response, and compare it to the curl output to confirm they match.

Pro tip: Mention that you'd use environment variables or a secrets manager for the API key rather than hardcoding it, and note that you'd verify the response status code and body match exactly, not just assume success.

1. Deconstruct the curl command

Break down the curl command into its components: HTTP method (POST), URL, headers (including Content-Type and Authorization), and JSON body. Note any special flags like -d or -H.

2. Choose language and HTTP library

Select a language and library you know well (e.g., Python with requests, JavaScript with fetch, Go with net/http). Ensure the library supports custom headers and JSON payloads.

3. Replicate the request in code

Write code that sets the method, URL, headers, and body exactly as in the curl command. Pay attention to details like header names, JSON serialization, and authentication format (e.g., Bearer token).

4. Execute and capture response

Run the code and capture the full response, including status code, headers, and body. Use logging or print statements to inspect the output.

5. Compare with curl output

Run the original curl command (if possible) and compare the responses. Check that status codes, headers, and body match exactly, or explain any differences (e.g., timestamps).

Key Points to Mention

  • HTTP method and URL must be identical.
  • Headers: Content-Type, Authorization, and any custom headers must match exactly, including case sensitivity where relevant.
  • JSON body: ensure proper serialization and that the structure and values are identical.
  • Authentication: use the same auth scheme (e.g., Bearer token) and handle secrets securely.
  • Response validation: compare status code, headers, and body; consider using a diff tool or assertions.
  • Error handling: discuss how you'd handle network errors or non-2xx responses in code.

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