PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Grammarly

Implement a rate limiter and a pub/sub API

Last updated: May 4, 2026

Quick Overview

This question evaluates competency in concurrency control, synchronization, API and low-level system design, and messaging system concepts by combining a rate limiter implementation with a pub/sub API.

  • medium
  • Grammarly
  • Software Engineering Fundamentals
  • Software Engineer

Implement a rate limiter and a pub/sub API

Company: Grammarly

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

You have two coding/design (low-level design) tasks. ## 1) Rate limiter Design and implement a rate limiter with an API like: - `boolean allow(String clientId)` or `boolean allow(String key)` It should enforce a policy such as: - **N requests per time window** (e.g., 100 requests per minute) Discuss (and ideally implement) thread-safety and how you would adapt it for multiple application instances. ## 2) Pub/Sub Design and implement a simple Pub/Sub component (Java-like interfaces are fine), supporting: - `publish(topic, message)` - `subscribe(topic, subscriber)` - `unsubscribe(topic, subscriber)` Clarify delivery semantics (best-effort vs at-least-once), ordering per topic, and how you handle slow consumers.

Quick Answer: This question evaluates competency in concurrency control, synchronization, API and low-level system design, and messaging system concepts by combining a rate limiter implementation with a pub/sub API.

Grammarly logo
Grammarly
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
6
0
Loading...

You have two coding/design (low-level design) tasks.

1) Rate limiter

Design and implement a rate limiter with an API like:

  • boolean allow(String clientId) or boolean allow(String key)

It should enforce a policy such as:

  • N requests per time window (e.g., 100 requests per minute)

Discuss (and ideally implement) thread-safety and how you would adapt it for multiple application instances.

2) Pub/Sub

Design and implement a simple Pub/Sub component (Java-like interfaces are fine), supporting:

  • publish(topic, message)
  • subscribe(topic, subscriber)
  • unsubscribe(topic, subscriber)

Clarify delivery semantics (best-effort vs at-least-once), ordering per topic, and how you handle slow consumers.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Grammarly•More Software Engineer•Grammarly Software Engineer•Grammarly Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

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