
系统设计
无名_1989
1、每天坚持读书1小时;2、坚持提升专业,成为单位专业权威;3、战胜两个坏毛病——拖延与抱怨;4、先从形象上改变,提升你的自信;5、时常反省自己,但不诋毁自己;6、向优秀的人学习;7、坚持早睡早起;8、坚持体育锻炼;9、保持微笑;10、帮助他人
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
内存文件系统设计
Design an in-memory file system to simulate the following functions:ls: Given a path in string format. If it is a file path, return a list that only contains this file's name. If it is a directory pat...转载 2018-03-22 08:36:28 · 921 阅读 · 0 评论 -
LFU Cache
Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get andput.get(key) - Get the value (will always be positive) of the key if the...转载 2018-03-21 08:54:17 · 194 阅读 · 0 评论 -
LRU Cache
class LRUCache{ size_t m_capacity; unordered_map<int, list<pair<int, int>>::iterator> m_map; //m_map_iter->first: key, m_map_iter->second: list iterator; list<p...转载 2018-03-05 08:31:12 · 227 阅读 · 0 评论 -
Encode and Decode TinyURL
TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk.Design the encode and decode...转载 2018-02-26 21:55:49 · 237 阅读 · 0 评论 -
380. Insert Delete GetRandom O(1)
Design a data structure that supports all following operations in average O(1) time.insert(val): Inserts an item val to the set if not already present.remove(val): Removes an item val from the set if ...转载 2018-05-18 09:29:42 · 191 阅读 · 0 评论 -
聊聊QPS/TPS/并发量/系统吞吐量的概念
我们在日常工作中经常会听到QPS/TPS这些名词,也会经常被别人问起说你的系统吞吐量有多大。这个问题从业务上来讲,可以理解为应用系统每秒钟最大能接受的用户访问量。或者每秒钟最大能处理的请求数; QPS: 每秒钟处理完请求的次数;注意这里是处理完。具体是指发出请求到服务器处理完成功返回结果。可以理解在server中有个counter,每处理一个请求加1,1秒后counter=QPS。 TPS:每...转载 2018-05-28 12:26:48 · 490 阅读 · 0 评论 -
关于吞吐量和延迟的精彩比喻
关于吞吐量(throughput)和延迟(latency),如果你要搞性能优化,这两个概念是必须要知道的,它们看似简单实则不是。很多人都曾经认为高吞吐量就意味着低延迟,高延迟就意味着吞吐量变小。下面的比喻可以解释这种观点是错误的。我们可以把网络发送数据包比喻成去街边的 ATM 取钱。每一个人从开始使用 ATM 到取钱结束整个过程都需要一分钟,所以这里的延迟是60秒,那吞吐量呢?当然是 1/60 人...转载 2018-05-28 12:37:58 · 983 阅读 · 2 评论