We use optional cookies for analytics and affiliate attribution. Essential cookies and marketing measurement are always on. Read our privacy policy

We just launched our Black Friday sale. You can use code BF2026 to get 25% off all subscriptions, valid until Nov 30th. There is a limit of 100 redemptions.

Logo

Bad users tracker

What this preview is

Bad users tracker is a easy quant coding problem on language knowledge in Cpp.

Difficulty
Easy
Topic
Language Knowledge
Discipline
Quant development
Language
Cpp

What this C++ data-structure coding problem tests

This is an easy coding problem that asks you to implement a time-windowed request tracker in C++. It probes whether you can manage a sliding window of events, maintain aggregate counts per user, and crucially, evict stale data so memory does not grow without bound.

The core challenge is not algorithmic difficulty but rather careful bookkeeping: you must track requests by timestamp, count them within a 300-second window, identify users exceeding a threshold, and clean up expired entries as time advances. Strong solutions choose a data structure (such as a map of queues or a deque per user) that makes both insertion and expiration efficient and straightforward to reason about.

  • Sliding-window time-series tracking
  • Per-entity counters and aggregation
  • Lazy vs. eager garbage collection of stale state
  • Trade-offs between query time and memory overhead

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.