← Ramp Interview Insights

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

SeniorPrefer not to say
Jul 2026

Summary

System design round at Ramp for a software engineering role. The question was about building a real-time visit counter with a sliding window, which sounds contained but sprawls fast once you get into the weeds of deduplication and late arrivals.

Questions Asked (1)

Q1

Design a system that tracks website visit counts over a rolling 60-second window, queryable in near real time under high traffic.

System DesignTechnical Trade-offsData Modeling
Author's notes

The question opened up way more surface area than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what 'near real-time' means, expected QPS, and query patterns. Then propose a streaming aggregation architecture using a time-series store or in-memory counters with sliding window semantics, and discuss trade-offs between accuracy, latency, and cost.

Pro tip: Mention that you would use a ring buffer of per-second counters and sum the last 60 buckets for queries, which avoids expensive sliding window computations and naturally handles out-of-order events with a small grace period.

1. Clarify Requirements

Ask about traffic volume (QPS), query rate, acceptable latency, and whether approximate counts are acceptable. Define 'near real-time' (e.g., <1s) and 'rolling 60-second window' (sliding vs. tumbling).

2. High-Level Architecture

Propose a pipeline: ingest events via a message queue (Kafka) or direct writes, aggregate in stream processors (Flink, Spark Streaming) or in-memory stores (Redis), and serve queries from a fast read store.

3. Data Model & Window Implementation

Use per-second counters (e.g., Redis hashes or sorted sets) and sum the last 60 buckets for queries. Alternatively, use a time-series database (Prometheus, InfluxDB) with sliding window functions.

4. Scalability & Fault Tolerance

Shard by website ID or time to distribute load. Use replication for high availability, and handle failures with checkpointing or idempotent writes. Consider approximate algorithms (HyperLogLog) if exact counts are not required.

5. Trade-offs & Optimizations

Discuss trade-offs: exact vs. approximate, latency vs. cost, and complexity. Optimize by pre-aggregating, using local caching, or sampling. Mention monitoring and alerting for system health.

Key Points to Mention

  • Sliding window vs. tumbling window semantics and how to implement each
  • Use of in-memory data stores (Redis) with TTL for per-second buckets
  • Stream processing frameworks (Kafka Streams, Flink) for real-time aggregation
  • Sharding and partitioning strategies to handle high traffic
  • Trade-offs between exact counts and approximate algorithms (e.g., HyperLogLog)
  • Fault tolerance, idempotency, and exactly-once processing guarantees

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