PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Amazon

Design in-memory threshold switcher

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to design memory-aware control systems, covering skills such as hysteresis-based thresholding, dynamic runtime reconfiguration, thread-safe concurrency, low-overhead metric sampling, event-driven state notifications, and handling multi-process and failure edge cases.

  • hard
  • Amazon
  • System Design
  • Software Engineer

Design in-memory threshold switcher

Company: Amazon

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design an in-memory "switcher" component that toggles between ENABLED and DISABLED states based on runtime memory usage with user-configurable thresholds. Requirements: ( 1) Support separate upper/lower thresholds (hysteresis) to prevent flapping. ( 2) Allow dynamic reconfiguration at runtime without downtime. ( 3) Provide thread-safe reads/writes and low-overhead sampling of memory metrics. ( 4) Expose callbacks or events when state changes. ( 5) Define behavior under memory spikes, metric polling failures, and multi-process or multi-instance deployments. ( 6) Describe data structures, APIs, concurrency model, and monitoring/metrics. ( 7) Discuss testing strategy, performance considerations, and trade-offs of pull vs push metric collection.

Quick Answer: This question evaluates a candidate's ability to design memory-aware control systems, covering skills such as hysteresis-based thresholding, dynamic runtime reconfiguration, thread-safe concurrency, low-overhead metric sampling, event-driven state notifications, and handling multi-process and failure edge cases.

Related Interview Questions

  • Design a Log Collection System - Amazon (medium)
  • Design Human Avoidance for Warehouse Robots - Amazon (medium)
  • Design a High-Availability Load Balancer - Amazon (hard)
  • Design a Ride-Hailing Matching System - Amazon (medium)
  • Design a replicated cloud storage service - Amazon (hard)
Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
2
0

Design an In-Memory Memory-Pressure Switcher

Context

You are designing an in-memory component ("Switcher") that gates expensive work (e.g., request admission, cache growth, background jobs) based on the process's runtime memory usage. The switcher exposes an ENABLED/DISABLED state with hysteresis to avoid flapping and supports live reconfiguration.

Assume the switcher runs within a single service process by default, but may be used in multi-process or multi-instance deployments.

Requirements

  1. Hysteresis thresholds
    • Support separate upper and lower thresholds so the switch does not flap around a single boundary.
  2. Dynamic reconfiguration
    • Allow changing thresholds and behavior at runtime without downtime.
  3. Concurrency and performance
    • Provide thread-safe reads/writes.
    • Low-overhead sampling of memory metrics.
  4. State-change notifications
    • Expose callbacks or events when the state changes.
  5. Edge-case behavior
    • Define behavior under memory spikes, metric polling failures, and in multi-process or multi-instance deployments.
  6. Design details
    • Describe data structures, public APIs, concurrency model, and monitoring/metrics to expose.
  7. Testing and trade-offs
    • Discuss testing strategy, performance considerations, and trade-offs of pull vs. push metric collection.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

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