PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Databricks

Design a Bookstore Pricing API with Batch Fetches

Last updated: Aug 5, 2026

Quick Overview

Design an HTTP pricing service for individual and batched book lookups while making price context and freshness explicit. Key design choices include GET and read-only POST trade-offs, structured batch contracts, deduplication, bounded downstream work, partial failures, personalized caching, overload control, and metrics.

  • hard
  • Databricks
  • System Design
  • Software Engineer

Design a Bookstore Pricing API with Batch Fetches

Company: Databricks

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

## Design a Bookstore Pricing API with Batch Fetches In a high-level system-design discussion, design the HTTP interface and supporting service for fetching book prices. Explain when the API should use `GET` and when a `POST` endpoint is justified, then design an efficient way to fetch prices for a batch of books. The original prompt does not provide traffic, catalog size, price dimensions, or freshness requirements. State those assumptions instead of treating them as known interview facts. ### Part 1 — Define the Pricing Contract Clarify what identifies a book, which context can change its price, and what the caller needs from a single-price and batch-price response. #### What This Part Should Cover - Stable book identifiers and any market, currency, customer, or edition context that belongs in the request. - Whether the response represents a current quote, a cached display price, or a price valid for a stated interval. - Missing books, unavailable prices, and partial success in a batch. - Batch-size, payload-size, latency, and freshness expectations. ```hint Separate identity from price context Two requests for the same book identifier may not be equivalent if region, currency, customer eligibility, or quote time changes the result. ``` ### Part 2 — Choose Between GET and POST Propose concrete HTTP endpoints for one book and for a batch. Justify the method choice using HTTP semantics and operational behavior rather than a rule that reads are always `GET` or batches are always `POST`. #### What This Part Should Cover - Safety, idempotency, cacheability, observability, and retry behavior. - URL-length and structured-body constraints for large batches. - Stable request and response schemas, validation errors, and versioning. - Authentication, authorization, rate limits, and request identifiers. ```hint Start from the request shape The useful comparison is between a cache-friendly resource lookup and a potentially large, structured read request, not between “read” and “write” labels alone. ``` ### Part 3 — Execute Batch Price Fetches Efficiently Describe the service path from an accepted batch request to a complete response. Avoid turning one client batch into an uncontrolled series of downstream calls. #### What This Part Should Cover - Input deduplication while preserving a deterministic mapping back to requested items. - Bounded parallelism, downstream batching, deadlines, and cancellation. - Cache keys and invalidation or freshness behavior. - Per-item status and an explicit policy for partial downstream failure. ```hint Bound the fan-out A batch endpoint improves little if every item creates an independent, unbounded request to the same dependency. ``` ### Part 4 — Scale and Operate the Service Explain how the design handles hot books, large clients, dependency degradation, and price changes while remaining observable. #### What This Part Should Cover - Admission control, maximum batch sizes, backpressure, and fair use across callers. - Caching or read models appropriate to the declared freshness contract. - Timeouts, retries, circuit breaking, and protection against retry storms. - Metrics for latency, batch shape, cache behavior, partial failures, stale responses, and downstream load. ```hint Measure batches as distributions Average request latency alone will hide whether large batches, hot identifiers, or one downstream partition dominate the work. ``` ### What a Strong Answer Covers - Requirements that make price identity and freshness explicit. - A defensible `GET` versus `POST` decision grounded in HTTP behavior. - Bounded and deterministic batch execution rather than accidental N-plus-one fan-out. - Clear partial-failure semantics, overload controls, and operational signals. ### Follow-up Questions 1. Can a read-only `POST` endpoint still be idempotent, and how would clients retry it? 2. How would you preserve input order while deduplicating repeated book IDs internally? 3. What changes if prices are personalized and therefore unsafe for shared caches? 4. When should a batch return a mixed result instead of failing the whole request?

Quick Answer: Design an HTTP pricing service for individual and batched book lookups while making price context and freshness explicit. Key design choices include GET and read-only POST trade-offs, structured batch contracts, deduplication, bounded downstream work, partial failures, personalized caching, overload control, and metrics.

Related Interview Questions

  • Design Chat APIs, Storage, and Core Message Flows - Databricks (hard)
  • Design a Music Playlist Service - Databricks (hard)
  • Design Chat Deletion Semantics Under Concurrent Sends - Databricks (medium)
  • Design a Durable Concurrent Event Writer - Databricks (hard)
  • Design a Collaborative Playlist Editor - Databricks (medium)
|Home/System Design/Databricks

Design a Bookstore Pricing API with Batch Fetches

Databricks logo
Databricks
May 10, 2026, 12:00 AM
hardSoftware EngineerOnsiteSystem Design
0
0

Design a Bookstore Pricing API with Batch Fetches

In a high-level system-design discussion, design the HTTP interface and supporting service for fetching book prices. Explain when the API should use GET and when a POST endpoint is justified, then design an efficient way to fetch prices for a batch of books.

The original prompt does not provide traffic, catalog size, price dimensions, or freshness requirements. State those assumptions instead of treating them as known interview facts.

Part 1 — Define the Pricing Contract

Clarify what identifies a book, which context can change its price, and what the caller needs from a single-price and batch-price response.

What This Part Should Cover Guidance

  • Stable book identifiers and any market, currency, customer, or edition context that belongs in the request.
  • Whether the response represents a current quote, a cached display price, or a price valid for a stated interval.
  • Missing books, unavailable prices, and partial success in a batch.
  • Batch-size, payload-size, latency, and freshness expectations.

Part 2 — Choose Between GET and POST

Propose concrete HTTP endpoints for one book and for a batch. Justify the method choice using HTTP semantics and operational behavior rather than a rule that reads are always GET or batches are always POST.

What This Part Should Cover Guidance

  • Safety, idempotency, cacheability, observability, and retry behavior.
  • URL-length and structured-body constraints for large batches.
  • Stable request and response schemas, validation errors, and versioning.
  • Authentication, authorization, rate limits, and request identifiers.

Part 3 — Execute Batch Price Fetches Efficiently

Describe the service path from an accepted batch request to a complete response. Avoid turning one client batch into an uncontrolled series of downstream calls.

What This Part Should Cover Guidance

  • Input deduplication while preserving a deterministic mapping back to requested items.
  • Bounded parallelism, downstream batching, deadlines, and cancellation.
  • Cache keys and invalidation or freshness behavior.
  • Per-item status and an explicit policy for partial downstream failure.

Part 4 — Scale and Operate the Service

Explain how the design handles hot books, large clients, dependency degradation, and price changes while remaining observable.

What This Part Should Cover Guidance

  • Admission control, maximum batch sizes, backpressure, and fair use across callers.
  • Caching or read models appropriate to the declared freshness contract.
  • Timeouts, retries, circuit breaking, and protection against retry storms.
  • Metrics for latency, batch shape, cache behavior, partial failures, stale responses, and downstream load.

What a Strong Answer Covers Guidance

  • Requirements that make price identity and freshness explicit.
  • A defensible GET versus POST decision grounded in HTTP behavior.
  • Bounded and deterministic batch execution rather than accidental N-plus-one fan-out.
  • Clear partial-failure semantics, overload controls, and operational signals.

Follow-up Questions Guidance

  1. Can a read-only POST endpoint still be idempotent, and how would clients retry it?
  2. How would you preserve input order while deduplicating repeated book IDs internally?
  3. What changes if prices are personalized and therefore unsafe for shared caches?
  4. When should a batch return a mixed result instead of failing the whole request?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Databricks•More Software Engineer•Databricks Software Engineer•Databricks System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.