PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Rippling

Implement a minimal local HTTP server

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in network programming, HTTP/1.1 protocol parsing, concurrent server design, request routing and security (including path traversal protection), observability, testing, and graceful shutdown using only the language standard library.

  • hard
  • Rippling
  • System Design
  • Software Engineer

Implement a minimal local HTTP server

Company: Rippling

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Implement a minimal local HTTP server from scratch (no frameworks). Requirements: listen on a configurable port, parse HTTP/1.1 requests, support GET and POST, route two endpoints (/health returning 200 OK; /echo returning the request body), serve static files from a directory with correct Content-Type, handle concurrent connections, request timeouts, graceful shutdown, and structured request logging. Return appropriate errors (400/404/ 405). Include unit tests and clear run instructions for local development.

Quick Answer: This question evaluates proficiency in network programming, HTTP/1.1 protocol parsing, concurrent server design, request routing and security (including path traversal protection), observability, testing, and graceful shutdown using only the language standard library.

Related Interview Questions

  • Prevent Duplicate Payments Under High Load - Rippling
  • Design a personalized news aggregator - Rippling (medium)
  • Design a Scalable News Feed - Rippling (medium)
  • Design Scalable Expense Violation Processing - Rippling (hard)
  • Design several large-scale systems - Rippling (hard)
Rippling logo
Rippling
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
System Design
15
0

Build a Minimal Local HTTP/1.1 Server (No Frameworks)

Context

You are asked to implement a minimal HTTP/1.1 server from scratch using only the standard library (no web frameworks). The server should run locally, be configurable, and handle concurrency and shutdown cleanly. Include unit tests and clear run instructions.

Requirements

  1. Configuration
    • Listen on a configurable host and port.
    • Serve static files from a configurable root directory.
  2. Protocol and Methods
    • Parse HTTP/1.1 requests: request line, headers, and optional body.
    • Support methods: GET and POST.
    • Return appropriate errors: 400 (Bad Request), 404 (Not Found), 405 (Method Not Allowed).
  3. Routing
    • GET /health → returns 200 OK with body "OK".
    • POST /echo → returns the request body verbatim, with Content-Type preserved if present.
    • Static files: for any other GET path, serve files from the configured root directory.
      • Use correct Content-Type for common file extensions.
      • Protect against path traversal attacks (e.g., ".." segments).
  4. Concurrency and Reliability
    • Handle multiple concurrent connections.
    • Per-connection request timeout.
    • Graceful shutdown (e.g., on SIGINT/SIGTERM): stop accepting new connections and allow in-flight requests to finish.
  5. Observability
    • Structured per-request logging (e.g., JSON lines) including: timestamp, remote address, method, path, status, duration, bytes in/out, and user agent.
  6. Testing and Docs
    • Include unit tests that verify the core behaviors.
    • Provide clear run instructions for local development.

Constraints

  • Use only the language standard library. No web frameworks (e.g., Flask, Express, Spring), no third-party libraries.
  • Keep the implementation minimal but robust enough for the above requirements.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Rippling•More Software Engineer•Rippling Software Engineer•Rippling System Design•Software Engineer System Design
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.