~learn.
0:00 / 1:10
Side quest 26 · Truecaller

The most important cache is on your phone.

transcript

One bar of signal. A scam call ringing. Your phone blocks it anyway. No network needed. Where scam calls hurt most, the network is weakest.

Take your region's worst 500,000 spam numbers. Each one: an 8-byte hash, plus a 1-byte category. 4 point 5 megabytes. And no names at all.

Every night, a signed base list. Every hour, a small delta. Adds and removes. Removals matter too. A wrongly flagged rider is cleared next delta. Offline more than 7 days? Start again from a fresh base.

Spammers change numbers. Assume 5 percent churn a day. About 225 kilobytes. Less than a photo.

Phone ringing? Binary search the sorted hashes. About 19 comparisons for 500,000 numbers. Sorted and memory-mapped. It answers while the phone rings.

But here's the catch. A number that started at 9:12? Not on the list yet. That's what the live lookup is for. The list is the floor. The live lookup is the ceiling.

Full breakdown in the lecture.