PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Software Engineering Fundamentals/Amazon

Choose lock granularity for concurrent storage

Last updated: Apr 26, 2026

Quick Overview

This question evaluates understanding of concurrency control and lock-granularity trade-offs in concurrent storage components, including coarse-grained versus fine-grained locking, lock-free/wait-free alternatives, and their impacts on latency (particularly p99) and throughput under contention, along with pitfalls such as deadlocks, priority inversion, convoying, and starvation. Commonly asked in software engineering fundamentals and systems interviews, it assesses architectural and performance reasoning for storage engines and targets both conceptual understanding of concurrency models and practical application-level trade-offs and implementation complexity.

  • hard
  • Amazon
  • Software Engineering Fundamentals
  • Software Engineer

Choose lock granularity for concurrent storage

Company: Amazon

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Technical Screen

You are implementing a component inside a storage engine that is accessed concurrently (e.g., an in-memory index, metadata cache, or block map). Discuss the trade-offs and propose an approach for concurrency control: 1. When would you use a **coarse-grained lock** (single global mutex)? 2. When do you need **fine-grained locking** (per-bucket/per-shard/per-node locks)? 3. How do lock choices affect **latency (especially p99)** and **throughput** under contention? 4. What pitfalls must be handled (deadlocks, priority inversion, convoying, starvation)? 5. When are **lock-free / wait-free** approaches feasible, and what are the engineering costs? Assume you may have many threads, read-heavy workloads, and occasional writes (updates).

Quick Answer: This question evaluates understanding of concurrency control and lock-granularity trade-offs in concurrent storage components, including coarse-grained versus fine-grained locking, lock-free/wait-free alternatives, and their impacts on latency (particularly p99) and throughput under contention, along with pitfalls such as deadlocks, priority inversion, convoying, and starvation. Commonly asked in software engineering fundamentals and systems interviews, it assesses architectural and performance reasoning for storage engines and targets both conceptual understanding of concurrency models and practical application-level trade-offs and implementation complexity.

Related Interview Questions

  • Validate AI-Generated Code Safely - Amazon (medium)
  • Fix the Password Reset Workflow - Amazon (medium)
  • Design an In-Memory Pub-Sub Model - Amazon (medium)
  • Implement a Single-Node Priority Pub/Sub - Amazon (medium)
  • Build a responsive grid of fixed boxes - Amazon (medium)
Amazon logo
Amazon
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
4
0
Loading...

You are implementing a component inside a storage engine that is accessed concurrently (e.g., an in-memory index, metadata cache, or block map).

Discuss the trade-offs and propose an approach for concurrency control:

  1. When would you use a coarse-grained lock (single global mutex)?
  2. When do you need fine-grained locking (per-bucket/per-shard/per-node locks)?
  3. How do lock choices affect latency (especially p99) and throughput under contention?
  4. What pitfalls must be handled (deadlocks, priority inversion, convoying, starvation)?
  5. When are lock-free / wait-free approaches feasible, and what are the engineering costs?

Assume you may have many threads, read-heavy workloads, and occasional writes (updates).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

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