← rippling Interview Insights

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

Senior
Apr 2026

Summary

Rippling system design round, one question the whole time. The problem sounds deceptively simple but the O(1) constraint on the flip history is where it gets real.

Questions Asked (1)

Q1

Design a system that tracks per-article thumbs-up and thumbs-down votes, where users can change their vote at any time. When querying an article's state, you must also return the last three vote-flip actions for that article in order, with O(1) time per query.

System DesignAlgorithms & Data StructuresData Modeling
Author's notes

The vote tracking part I got pretty quickly, just a map from user to current vote state.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a data model that stores per-article vote counts and a bounded history of recent vote flips. Use a hash map for O(1) access to article state and a fixed-size circular buffer or deque for the last three flips, ensuring constant-time updates and queries.

Pro tip: Emphasize that the O(1) query requirement applies to retrieving the article's state and recent flips, not to updating votes; this distinction shows you understand the problem's constraints. Also, mention that the history can be stored per article without affecting scalability if you shard by article ID.

1. Clarify Requirements and Constraints

Ask about expected scale (number of articles, votes per second), consistency needs, and whether the last three flips must be strictly ordered by time. Confirm that O(1) is required for queries, not updates.

2. Design the Data Model

Propose a per-article record containing thumbs-up count, thumbs-down count, and a fixed-size history buffer (e.g., circular array of size 3) for recent flips. Use a hash map keyed by article ID for O(1) access.

3. Handle Vote Changes and History Updates

When a user changes their vote, update the counts and append the flip action to the history buffer, evicting the oldest if full. Ensure the buffer maintains chronological order.

4. Ensure O(1) Query Performance

For a query, retrieve the article record from the hash map, return the counts and the contents of the history buffer in order. Since the buffer size is constant, this is O(1).

5. Address Scalability and Edge Cases

Discuss sharding by article ID, handling concurrent votes, and persistence. Mention edge cases like no votes yet or fewer than three flips.

Key Points to Mention

  • Use of hash map for O(1) article lookup
  • Fixed-size circular buffer or deque for last three flips
  • Constant-time operations for both updates and queries
  • Sharding or partitioning by article ID for scalability
  • Handling concurrent vote changes with atomic operations or locks
  • Persistence strategy (e.g., write-ahead log or periodic snapshots)

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