为什么概率型数据结构(如 HyperLogLog、count-min sketch、bitmaps)不适合作为分布式计数器的核心实现?
Why are probabilistic data structures (HyperLogLog, count-min sketch, bitmaps) not suitable as the core implementation for a distributed counter in this design?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: medium
分类: system-design, data-structures
标签: probabilistic, hyperloglog, count-min-sketch, bitmap, accuracy
参考答案摘要
TL;DR 概率型数据结构虽然节省空间,但会带来 不准确 或功能限制(例如 HyperLogLog 不支持删除,count-min sketch 只能近似且无法 decrement)。由于题目要求计数器必须 准确 并且用户退出要能递减,因此概率型方案不符合需求。 问题点 Hash set :可精确计数但内存开销大。 Bitmaps :存储比 hash set 低,但基数很高时仍消耗大量内存;且需要...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。