How to Detect a 30‑Day Continuous Sign‑In for 1 B Users with 1 GB Memory
The article breaks down a large‑scale interview question, showing why storing each sign‑in as a database row is infeasible, how a bitmap compresses a year of data to 46 bytes per user, the pitfalls of BITCOUNT, the importance of key dimension design, and the exact Redis commands and local‑scan algorithms—including a five‑step bit‑wise trick—to reliably determine a 30‑day continuous sign‑in.
