![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
系统设计
文章平均质量分 81
jmspan
这个作者很懒,什么都没留下…
展开
-
LeetCode 146. LRU Cache(LRU缓存)
原题网址:https://leetcode.com/problems/lru-cache/ Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get原创 2016-05-26 01:24:27 · 818 阅读 · 0 评论 -
LintCode Consistent Hashing(一致性哈希算法)
原题网址:http://www.lintcode.com/en/problem/consistent-hashing/ 一般的数据库进行horizontal shard的方法是指,把 id 对 数据库服务器总数 n 取模,然后来得到他在哪台机器上。这种方法的缺点是,当数据继续增加,我们需要增加数据库服务器,将 n 变为 n+1 时,几乎所有的数据都要移动,这就造成了不 consist原创 2016-06-23 05:16:18 · 2451 阅读 · 0 评论 -
LeetCode 362. Design Hit Counter(计数器)
原题网址:https://leetcode.com/problems/design-hit-counter/ Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seco原创 2016-06-23 00:45:16 · 2310 阅读 · 0 评论 -
LeetCode 359. Logger Rate Limiter(日志漏桶)
原题网址:https://leetcode.com/problems/logger-rate-limiter/ Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not p原创 2016-06-17 01:24:29 · 4067 阅读 · 0 评论 -
LeetCode 355. Design Twitter(设计Twitter)
原题网址:https://leetcode.com/problems/design-twitter/ Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in原创 2016-06-15 04:49:48 · 960 阅读 · 0 评论 -
LintCode Url Parser
原题网址:http://www.lintcode.com/en/problem/url-parser/ Parse a html page, extract the Urls in it. Hint: use regex to parse html. Have you met this question in a real interview? Yes原创 2016-06-26 09:25:49 · 1193 阅读 · 0 评论 -
LintCode Inverted Index
原题网址:http://www.lintcode.com/en/problem/inverted-index/ Create an inverted index with given documents. Notice Ensure that data does not include punctuation. Have you met thi原创 2016-06-25 05:55:23 · 955 阅读 · 0 评论 -
LintCode Mini Cassandra
原题网址:http://www.lintcode.com/en/problem/mini-cassandra/ Cassandra is a NoSQL storage. The structure has two-level keys. Level 1: raw_key. The same as hash_key or shard_key.Level 2: column_原创 2016-06-24 06:35:38 · 1859 阅读 · 0 评论 -
LintCode Consistent Hashing II(一致性哈希算法II)
原题网址:http://www.lintcode.com/en/problem/consistent-hashing-ii/ 在 Consistent Hashing I 中我们介绍了一个比较简单的一致性哈希算法,这个简单的版本有两个缺陷: 增加一台机器之后,数据全部从其中一台机器过来,这一台机器的读负载过大,对正常的服务会造成影响。当增加到3台机器的时候,每台服务器的负载量不原创 2016-06-24 06:19:02 · 2447 阅读 · 0 评论 -
LintCode Memcache
原题网址:http://www.lintcode.com/en/problem/memcache/ Implement a memcache which support the following features: get(curtTime, key). Get the key's value, return 2147483647 if key does not exis原创 2016-06-23 07:20:16 · 875 阅读 · 0 评论