PracHub
QuestionsLearningGuidesInterview Prep
|Home/ML System Design/Hive.Ai

Design a Synchronous Text Classification API

Last updated: Jul 14, 2026

Quick Overview

Design a synchronous text-classification API with a small stateless online path and versioned model artifacts. Cover authentication, validation, load balancing, tenant throttling, bounded overload, safe retries, warm deployment and rollback, autoscaling, privacy-conscious observability, and multi-model growth.

  • easy
  • Hive.Ai
  • ML System Design
  • Software Engineer

Design a Synchronous Text Classification API

Company: Hive.Ai

Role: Software Engineer

Category: ML System Design

Difficulty: easy

Interview Round: Technical Screen

# Design a Synchronous Text Classification API A trained machine-learning model classifies text. Design the system that exposes this model through synchronous API endpoints for customers. Cover request flow, load balancing, throttling, failure handling, stateless serving, model deployment, and how the design can expand as traffic and model count grow. A database is not inherently required for the inference path. Introduce persistent storage only when a stated requirement needs it, and explain why. ### Constraints & Assumptions - Callers expect a classification response in the request/response cycle. - Requests can be retried and may arrive in bursts. - Model artifacts are immutable and versioned. - Individual serving instances can fail at any time. - The prompt does not provide latency, throughput, payload-size, or availability numbers; identify them before sizing. ### Clarifying Questions to Ask - What are the latency percentile and availability objectives? - What are expected and peak request rates, text sizes, and number of tenants? - Are CPU, GPU, or other accelerators required, and can requests be batched? - Must callers select a model version, and is explanation or confidence data returned? - What privacy, retention, abuse-prevention, and regional requirements apply? ### Solving Hints - Keep the online path small and make model loading a deployment concern rather than a per-request action. - Distinguish overload from dependency failure and define a bounded response for each. - Explain how a model version can be rolled out and rolled back without mixing untraceable results. ### What a Strong Answer Covers - API contracts, authentication, validation, request limits, and tenant-aware rate limiting. - Stateless gateways and inference workers behind health-aware load balancing. - Model artifact distribution, warm-up, version routing, canaries, and rollback. - Bounded queues, load shedding, timeouts, retries only where safe, and circuit breaking. - Autoscaling and partitioning choices based on measured resource cost. - Observability for service and model behavior without retaining sensitive text unnecessarily. - A credible evolution path for multiple models, regions, and hardware classes. ### Follow-up Questions 1. How would you avoid a cold-start latency spike during a model rollout? 2. What should the API return when every healthy worker is at capacity? 3. When would dynamic batching help, and when would it violate the synchronous latency objective? 4. How would you diagnose a quality regression that affects only one model version?

Quick Answer: Design a synchronous text-classification API with a small stateless online path and versioned model artifacts. Cover authentication, validation, load balancing, tenant throttling, bounded overload, safe retries, warm deployment and rollback, autoscaling, privacy-conscious observability, and multi-model growth.

|Home/ML System Design/Hive.Ai

Design a Synchronous Text Classification API

Hive.Ai logo
Hive.Ai
May 17, 2026, 12:00 AM
easySoftware EngineerTechnical ScreenML System Design
0
0

Design a Synchronous Text Classification API

A trained machine-learning model classifies text. Design the system that exposes this model through synchronous API endpoints for customers. Cover request flow, load balancing, throttling, failure handling, stateless serving, model deployment, and how the design can expand as traffic and model count grow.

A database is not inherently required for the inference path. Introduce persistent storage only when a stated requirement needs it, and explain why.

Constraints & Assumptions

  • Callers expect a classification response in the request/response cycle.
  • Requests can be retried and may arrive in bursts.
  • Model artifacts are immutable and versioned.
  • Individual serving instances can fail at any time.
  • The prompt does not provide latency, throughput, payload-size, or availability numbers; identify them before sizing.

Clarifying Questions to Ask Guidance

  • What are the latency percentile and availability objectives?
  • What are expected and peak request rates, text sizes, and number of tenants?
  • Are CPU, GPU, or other accelerators required, and can requests be batched?
  • Must callers select a model version, and is explanation or confidence data returned?
  • What privacy, retention, abuse-prevention, and regional requirements apply?

Solving Hints

  • Keep the online path small and make model loading a deployment concern rather than a per-request action.
  • Distinguish overload from dependency failure and define a bounded response for each.
  • Explain how a model version can be rolled out and rolled back without mixing untraceable results.

What a Strong Answer Covers Guidance

  • API contracts, authentication, validation, request limits, and tenant-aware rate limiting.
  • Stateless gateways and inference workers behind health-aware load balancing.
  • Model artifact distribution, warm-up, version routing, canaries, and rollback.
  • Bounded queues, load shedding, timeouts, retries only where safe, and circuit breaking.
  • Autoscaling and partitioning choices based on measured resource cost.
  • Observability for service and model behavior without retaining sensitive text unnecessarily.
  • A credible evolution path for multiple models, regions, and hardware classes.

Follow-up Questions Guidance

  1. How would you avoid a cold-start latency spike during a model rollout?
  2. What should the API return when every healthy worker is at capacity?
  3. When would dynamic batching help, and when would it violate the synchronous latency objective?
  4. How would you diagnose a quality regression that affects only one model version?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More Hive.Ai•More Software Engineer•Hive.Ai Software Engineer•Hive.Ai ML System Design•Software Engineer ML System Design

Your design canvas — auto-saved

PracHub

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