PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/eBay

Handle cache-update conflicts in distributed services

Last updated: Apr 18, 2026

Quick Overview

This question evaluates a candidate's competency in distributed systems and data consistency, focusing on cache–database consistency, concurrent write handling, versioning/CAS, distributed locking, cache invalidation strategies, idempotency, and failure recovery in high-throughput services.

  • hard
  • eBay
  • System Design
  • Software Engineer

Handle cache-update conflicts in distributed services

Company: eBay

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Your service uses a cache (e.g., Redis) in front of a relational database, and multiple application servers may update the same key concurrently. Design how to prevent and resolve cache–database update conflicts and race conditions: discuss write ordering and atomicity, versioning/ETags or compare-and-set, distributed locks, TTLs and invalidation vs write-through/write-back, idempotent updates, and recovery after partial failures. Specify APIs, data model, consistency guarantees, and trade-offs.

Quick Answer: This question evaluates a candidate's competency in distributed systems and data consistency, focusing on cache–database consistency, concurrent write handling, versioning/CAS, distributed locking, cache invalidation strategies, idempotency, and failure recovery in high-throughput services.

Related Interview Questions

  • Design an Ad Assignment API - eBay (medium)
  • Design a Relational-to-DynamoDB Migration System - eBay (medium)
  • Design a Top-K trending service - eBay (medium)
  • Design an online marketplace for buying and selling - eBay (hard)
eBay logo
eBay
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
System Design
13
0

Design: Cache–Database Consistency with Concurrent Writers

Context

You operate a high-throughput service using a cache (e.g., Redis) in front of a relational database. Multiple application servers may concurrently update the same logical record (key). You must prevent and resolve cache–database update conflicts and race conditions while keeping performance high.

Requirements

Design how to prevent and resolve conflicts across these areas:

  1. Write ordering and atomicity
  2. Versioning/ETags and compare-and-set (CAS)
  3. Distributed locks (when and how)
  4. TTLs and cache invalidation vs write-through/write-back
  5. Idempotent updates and retries
  6. Recovery after partial failures

Specify:

  • APIs (read/write), including headers or RPC fields
  • Data model (DB and cache)
  • Consistency guarantees
  • Trade-offs and when to choose each option

Provide read and write flows, including conflict resolution and failure handling.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More eBay•More Software Engineer•eBay Software Engineer•eBay System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,500+ 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.