← Attentive Interview Insights

Attentive·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026Remote

Summary

System design round at Attentive for a software engineer role. The problem started as a straightforward messaging service and then shifted mid-interview into a polling/scheduling design, which kept things interesting but also a bit chaotic.

Questions Asked (6)

Q1

Design and implement a message broadcasting service given a mapping of companies to subscribers and a log of messages with timestamps. How do you route each company's messages to its subscribers?

System DesignAlgorithms & Data Structures
Author's notes

Felt pretty comfortable at first, it's basically a fanout problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and scale, then propose a data structure that maps each company to its subscribers for efficient lookup. For routing, iterate through the message log, and for each message, retrieve the subscribers of the company and deliver the message, considering batching or asynchronous delivery for performance.

Pro tip: Discuss trade-offs between different data structures (e.g., hash map vs. trie) and delivery mechanisms (push vs. pull), and mention how you would handle failures and retries to show production-level thinking.

1. Clarify Requirements

Ask about scale (number of companies, subscribers, message volume), delivery guarantees (at-least-once, exactly-once), latency requirements, and whether messages are processed in real-time or batch.

2. Design Data Structures

Propose a mapping from company to subscribers (e.g., hash map: company -> set of subscriber IDs) and a message log structure (e.g., list of messages with company ID, timestamp, content).

3. Routing Algorithm

For each message in the log, look up the company's subscribers and enqueue the message for each subscriber. Consider batching messages per subscriber to reduce overhead.

4. Delivery Mechanism

Decide between push (server sends to subscribers) or pull (subscribers fetch). Discuss using a message queue (e.g., Kafka) for scalability and decoupling.

5. Handle Failures and Scale

Address retries, dead-letter queues, idempotency, and horizontal scaling (e.g., partitioning by company ID).

Key Points to Mention

  • Time and space complexity of the routing algorithm
  • Use of hash maps for O(1) average lookup of subscribers per company
  • Batching messages to reduce network calls and improve throughput
  • Asynchronous processing with message queues for scalability
  • Idempotency and deduplication to handle retries
  • Partitioning strategies (e.g., by company ID) for distributed systems

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

The interviewer introduced a current_time parameter mid-problem. Rework the approach into a polling-based system that, on each tick, broadcasts only the logs whose timestamp falls within the current window.

System DesignAdaptability & Ambiguity
Author's notes

This pivot threw me a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Acknowledge the new current_time parameter and reframe the problem as a polling-based system where each tick processes logs within a sliding window. Outline a design that maintains a buffer of logs, filters by timestamp on each tick, and broadcasts only those in the current window, while discussing trade-offs and edge cases.

Pro tip: Demonstrate adaptability by explicitly stating how you would refactor your previous solution to incorporate the new parameter, and mention the importance of defining the window size and tick interval upfront to avoid ambiguity.

1. Clarify Requirements

Ask questions to confirm the window size, tick interval, and whether logs are pre-loaded or streamed. Ensure you understand what 'current window' means relative to current_time.

2. Design Data Structures

Propose a buffer (e.g., queue or list) to hold logs, and a mechanism to efficiently retrieve logs within the window, such as a sorted structure or index by timestamp.

3. Define Polling Logic

Describe the per-tick process: advance current_time, filter logs where timestamp is within [current_time - window, current_time], and broadcast them. Discuss how to handle late or out-of-order logs.

4. Analyze Trade-offs

Compare polling with event-driven approaches, discussing latency, throughput, and resource usage. Mention potential optimizations like incremental filtering or batching.

5. Address Edge Cases

Cover scenarios like empty windows, logs exactly at boundaries, clock skew, and system restarts. Explain how your design handles them.

Key Points to Mention

  • Sliding window semantics and how to define the window boundaries
  • Efficiency of filtering: avoid scanning all logs each tick if possible
  • Handling out-of-order or late-arriving logs
  • Trade-offs between polling and event-driven architectures
  • Scalability considerations for high log volume
  • Testing strategy for time-based logic, including mocking current_time

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How would you extend the polling approach to support a time range [t1, t2] instead of a single current_time value?

Algorithms & Data StructuresSystem Design
Author's notes

Easier than the pivot, honestly just a range query instead of a point lookup.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the polling approach and the data structures involved, then propose extending it by either iterating over the time range or using precomputed aggregates. Discuss trade-offs between time and space complexity, and suggest optimizations like prefix sums or segment trees for efficient range queries.

Pro tip: Mention that the optimal solution depends on query frequency and data mutability; for static data, precomputation is key, while for dynamic data, a balanced BST or Fenwick tree may be better. Also, consider edge cases like empty ranges or out-of-bounds times.

1. Clarify the polling approach and data model

Restate how the current polling works for a single time, including the data structures used and the operations performed. Confirm assumptions about data volume, update frequency, and query patterns.

2. Identify the range query requirements

Determine what the range [t1, t2] represents (e.g., inclusive/exclusive, time granularity) and what aggregate or result is needed (e.g., sum, count, max).

3. Propose naive and optimized solutions

Start with a simple loop over the range, then suggest optimizations like prefix sums, segment trees, or Fenwick trees, explaining their time and space complexities.

4. Discuss trade-offs and choose based on context

Compare approaches based on query frequency, data mutability, and memory constraints. Recommend the most suitable solution for the given scenario.

5. Handle edge cases and scalability

Address edge cases such as empty ranges, large ranges, and concurrent updates. Mention how the solution scales with data size and query load.

Key Points to Mention

  • Time complexity of naive iteration vs. precomputed prefix sums vs. segment trees
  • Space-time trade-off: precomputation uses extra space but speeds up queries
  • Applicability of Fenwick trees (BIT) for dynamic data with point updates and range queries
  • Handling inclusive/exclusive bounds and time granularity
  • Edge cases: empty range, t1 > t2, out-of-bounds times
  • Scalability considerations for high-frequency polling and large time ranges

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Design the API surface for this broadcasting service, covering operations like broadcast, subscribe, unsubscribe, and schedule.

API & IntegrationsSystem Design
Author's notes

I liked this part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the core requirements and constraints of the broadcasting service, such as scale, delivery guarantees, and client types. Then design a clean, versioned API surface using RESTful principles, covering the key operations with well-defined request/response schemas and error handling. Finally, discuss trade-offs and potential extensions like WebSockets for real-time updates.

Pro tip: Demonstrate maturity by explicitly calling out idempotency for operations like subscribe/unsubscribe and discussing how to handle partial failures in broadcast and schedule. This shows you think about production reliability, not just happy paths.

1. Clarify Requirements and Constraints

Ask questions to understand scale, latency, delivery guarantees, client types, and authentication needs. This ensures your API design addresses the actual problem.

2. Define Core Resources and Operations

Identify the main resources (e.g., broadcasts, subscriptions, schedules) and map CRUD operations to them. Use RESTful conventions with clear HTTP methods and status codes.

3. Design Request/Response Schemas

Specify the payloads for each operation, including required and optional fields, data types, and validation rules. Consider pagination for list endpoints.

4. Address Error Handling and Idempotency

Define consistent error responses with codes and messages. Ensure idempotency for operations like subscribe/unsubscribe to handle retries safely.

5. Discuss Trade-offs and Extensions

Talk about trade-offs (e.g., REST vs. WebSockets for real-time) and potential future extensions like webhooks or batch operations.

Key Points to Mention

  • Use RESTful principles with clear resource naming and HTTP methods (POST /broadcasts, POST /subscriptions, DELETE /subscriptions/{id}, POST /schedules).
  • Include idempotency keys for subscribe/unsubscribe to prevent duplicate actions on retries.
  • Define a consistent error response format with appropriate HTTP status codes (400, 401, 404, 409, 429, 500).
  • Consider pagination, filtering, and sorting for list endpoints (e.g., GET /broadcasts).
  • Discuss authentication and authorization (e.g., API keys, OAuth scopes) for securing the API.
  • Mention real-time delivery options like WebSockets or Server-Sent Events for subscribers, and how they integrate with the REST API.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

What storage model would you choose for the message logs and subscriber lists, and why?

Data ModelingTechnical Trade-offs
Author's notes

Went with a relational store for subscribers (clear foreign key relationships, easy deduplication) and something like a time-series or append-only log store for messages.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the access patterns and scale requirements for message logs and subscriber lists, then propose a polyglot persistence approach that matches each workload. For message logs, emphasize write-heavy, append-only, time-series characteristics; for subscriber lists, focus on read-heavy, relational, and consistency needs. Justify your choices with trade-offs around scalability, consistency, and query flexibility.

Pro tip: Mention that you would start with a simple, well-understood solution (e.g., PostgreSQL) and only introduce specialized stores when metrics prove they are needed, avoiding premature optimization. Also, highlight the importance of idempotency and exactly-once processing in message logs to prevent duplicate notifications.

1. Clarify requirements and access patterns

Ask about write/read volume, latency requirements, query patterns, retention policies, and consistency needs for both message logs and subscriber lists.

2. Propose storage for message logs

Recommend a write-optimized, append-only store like Apache Kafka, Amazon Kinesis, or a time-series database (e.g., Cassandra) for durability, high throughput, and time-based queries.

3. Propose storage for subscriber lists

Suggest a relational database (e.g., PostgreSQL) or a document store (e.g., MongoDB) for flexible queries, strong consistency, and efficient lookups by subscriber attributes.

4. Discuss trade-offs and alternatives

Compare options: e.g., Kafka vs. S3 for logs, SQL vs. NoSQL for subscribers, and explain how choices affect scalability, cost, and complexity.

5. Address integration and operational concerns

Explain how the two stores interact (e.g., change data capture, event sourcing) and mention monitoring, backup, and schema evolution strategies.

Key Points to Mention

  • Write-heavy vs. read-heavy workloads and their impact on storage choice
  • CAP theorem trade-offs: consistency vs. availability vs. partition tolerance
  • Use of append-only logs for auditability and replayability
  • Indexing strategies for fast subscriber lookups (e.g., by email, segment)
  • Scalability and partitioning (e.g., sharding by subscriber ID or time)
  • Cost and operational complexity of managing multiple storage systems

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

Design a scheduling API that fires broadcasts at specified future times. How does the scheduler know when to execute, and how do you handle failures or missed windows?

System DesignTechnical Trade-offs
Author's notes

This was the hardest follow-up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, precision, delivery guarantees) and then propose a high-level architecture with a persistent job store and a scheduler that polls or uses a timing wheel. Discuss how the scheduler triggers execution, handles failures with retries and dead-letter queues, and manages missed windows via catch-up or skip policies.

Pro tip: Emphasize idempotency and exactly-once semantics for broadcasts, as duplicate sends can be costly; also mention monitoring and alerting on scheduler lag to detect missed windows early.

1. Clarify Requirements

Ask about scale (number of scheduled broadcasts, frequency), precision (exact time vs. approximate), delivery guarantees (at-least-once, exactly-once), and failure handling expectations.

2. High-Level Architecture

Propose a persistent job store (e.g., database) for scheduled broadcasts, a scheduler service that polls or uses a timing wheel, and a worker pool to execute broadcasts.

3. Scheduling Mechanism

Explain how the scheduler knows when to execute: e.g., polling the store for due jobs, using a priority queue, or a distributed timing wheel; discuss trade-offs (latency, scalability).

4. Failure Handling

Describe retry policies with exponential backoff, dead-letter queues for persistent failures, and idempotent execution to avoid duplicates.

5. Missed Windows

Discuss strategies for missed windows: catch-up (execute as soon as possible) vs. skip, and how to detect and alert on missed schedules.

Key Points to Mention

  • Persistent storage of scheduled jobs to survive restarts
  • Polling vs. event-driven scheduling and trade-offs
  • Idempotency and deduplication to handle retries safely
  • Retry policies with exponential backoff and dead-letter queues
  • Handling missed windows: catch-up vs. skip policies
  • Monitoring and alerting for scheduler lag and failures

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.