10 2020 档案
摘要:文件共享很重要 有两种方式: 使用FTP协议 使用samba协议 具体能用到的共享工具可以从WinSCP,Xftp, FileZil...
阅读全文
摘要:linux由以下几部分组成: 内核 bootloader 文件系统 shell 应用程序 下面分别来看: 什么是内核? 他是linu...
阅读全文
摘要:常用的命令大约有二三十个 用多了就熟了 不记得了可以去查
阅读全文
摘要:什么是Vim? 他是Linux里面一个很重要的编辑器 但是所有操作必须通过命令行去完成 而且命令又很多很难记 可以寓教于乐一下: h...
阅读全文
摘要:什么是shell脚本? 一个Shell脚本是一个文本文件(就像是.py, .java文件一样),包含一个或多个命令。作为系统管理员,...
阅读全文
摘要:什么是终端工具?既可以利用终端工具远程到虚拟机进行操作。 有哪些可以选择?MobaXterm, Xshell, Putty. 什么是...
阅读全文
摘要:两种方式 如果系统上已经装有Mac或者是windows,就安装虚拟机 如果没有 就直接在实体机上安装。 两个虚拟机: VMWare,...
阅读全文
摘要:从其中可以看出来 我现在水平还是 处在linux初级阶段,只会一些常用的命令,所以一些基本的东西我会在我的专栏linux中系统的讲...
阅读全文
摘要:这个就是理解错误了,多态的表现形式远远不止重写方法。 多态可以分为变量的多态,方法的多态和类的多态 变量的多态的表现形式是泛型(Ge...
阅读全文
摘要:The difference between put and post: post create new resource and ...
阅读全文
摘要:https is http with encryption. Https use SSL to encrypt normal htt...
阅读全文
摘要:虚点线是接口 虚线是抽象类 实线是普通类 从图中可以看出来 Map, List, Set, Queue都是接口 而stack, a...
阅读全文
摘要:Why HashTable doesn’t allow null and HashMap does? To successfully...
阅读全文
摘要:reference: https://www.geeksforgeeks.org/comparable-vs-comparator-...
阅读全文
摘要:为什么要设置这两个看起来没有用的东西? 因为这两个东西是非常有用的 有用在哪呢?有用在给我们的类的属性变量加上锁 使得不是谁想拿就拿...
阅读全文
摘要:It’s a very important principle in OOP. Single responsibility : ev...
阅读全文
摘要:Indexing is a data structure that store all the values of a column...
阅读全文
摘要:Stream is the enhancement of Collection package, it focuses on pro...
阅读全文
摘要:Extend thread class, implement runnable or callable interface ...
阅读全文
摘要:It’s a protocol that can make hyper text from server to web browse...
阅读全文
摘要:https://blog.csdn.net/kingzone_2008/article/details/8535287 Most p...
阅读全文
摘要:Final keyword can be used with class, method and variable. A final...
阅读全文
摘要:Volatile is a field modifier, while synchronized modifies code blo...
阅读全文
摘要:A transaction symbolizes a unit of work performed within a databas...
阅读全文
摘要:Join == inner join, it selects records that have matching value in...
阅读全文
摘要:different implementation arraylist uses dynamic array and linkedli...
阅读全文
摘要:Abstract class have abstract and concrete methods, but interface c...
阅读全文
摘要:Encapsulation: we hide the details of implementation, and we only ...
阅读全文
摘要:Lamda表达式又称为闭包 是JAVA8的新特性,它允许把函数作为参数传递到方法种 而且lamda表达式的写法可谓是相当方便 大大简...
阅读全文
摘要:It is not thread safe. because when we use put/get, or put/put the...
阅读全文
摘要:REST represents for the representational state transfer, it’s the ...
阅读全文
摘要:我们都知道 try catch finally 语句,就是说我们对try里面的语句是存有疑问的 一旦这段代码不能运行 那么我们就会在...
阅读全文
摘要:class WrongInputException extends Exception { // 自定义的类 WrongIn...
阅读全文
摘要:构造函数是绝大多数面向对象编程的语言都有的,其目的就是为用户初始化一个新的对象。 比较正规一些的定义是:类的构造函数是类的一种特殊的...
阅读全文
摘要:String.valueOf(Object obj) Character.toString(char c) ...
阅读全文
摘要:当然不是。 机器数量增加的好处: 每台机器负载就越少 速度 也更快 机器数量增加的坏处: 启动时间增加,而且增加是有上限的 就是说最...
阅读全文
摘要:mapper和reducer使用时工作吗? mapper结束了reducdder才能运行 如果有个mapper或者reducer挂了...
阅读全文
摘要:设计一个即时聊天系统 Scenario: 都是设计什么功能? 登陆注册 通讯录 两个用户互相发消息 多个用户互相发消息 用户的在线状...
阅读全文
摘要:http: hyper text transfer protocol, it is a protocol that let the ...
阅读全文
摘要:Http连接下 只能客户端问服务器端要数据 Socket链接 服务器可以主动推送数据给客户端
阅读全文
摘要:有哪些方面可以做拓展的? 性能上的拓展 支持更多的用户 有更快的响应速度 功能上的拓展 支持群聊 支持在线状态的显示。 对表格的扩充...
阅读全文
摘要:核心算法: Scale:
阅读全文
摘要:所谓datadog,就是:
阅读全文
摘要:主要是解决了两个问题: 第一个 用户如何发送消息 第二个 用户如何接收消息
阅读全文
摘要:Uniform Resource Identifiers, URI: http use this to establish link...
阅读全文
摘要:用多边形表示城市的范围 所以问题的本质意思是求一个点是否在一个多边形内(这个多边形既可以是凸包 或者可能是凹包) 但是同时也要注意c...
阅读全文
摘要:4S scenario: 需要设计哪些功能?设计的怎么样?(DAU, QPS) 有以下功能需要设计: 那么设计的怎么样? 根据最...
阅读全文
摘要:文件系统就是输入路径 然后返回文件内容 如果我们需要查找某个文件里面的某个值 我们就要打开文件进行扫描。 文件系统优点:能提供一些简...
阅读全文
摘要:数据库的核心在于读写 所以这个work solution就是一个完整的系统的读写过程。 写入过程: 针对上面的将在内存中储存的已经...
阅读全文
摘要:布隆过滤器本质上是一种数据结构 设计得十分精巧 特点是高效的插入和查询 可以用来告诉你 某种东西是否一定不存在。 false is ...
阅读全文
摘要:Geohash就是把世界分成很多快 怎么样在数据库中得到最长前缀索引呢? 我们可以用SQL和NoSQL储存 那么SQL和NoSQ...
阅读全文
摘要:比如说 储存和查询某个乘客周围五公里的司机 当然 我们可以用下面的SQL语句 但是这种意味着扫描了一遍所有的数据 有没有更好的办法...
阅读全文
摘要:How to read/write k-v from 1 PB file? 这么大的文件 直接放在一个服务器中肯定要死 那么怎么样嘛...
阅读全文
摘要:Bigtable分布式数据存储系统是Google为其内部海量的结构化数据开发的云存储技术,是Google的第三项云计算关键技术,是所...
阅读全文
摘要:4S: scenario: 就是给定key 或者说是查询语句 返回值 storage: 数据库虽然表面上是以表的形式进行储存,但是底...
阅读全文
摘要:哪些问题没有解决 哪些问题需要优化?出现问题怎么办? what if redis server is down? 如果某一台Redi...
阅读全文
摘要:首先 我们访问的是离我们最近的DNS服务器 然后DNS会解析www.google.com域名对应的IP地址是什么 然后我的浏览器向该...
阅读全文
摘要:User program start master and worker master assign task to the map...
阅读全文
摘要:User program start master and worker master assign task to the map...
阅读全文
摘要:他既不是软件 也不是算法 而是一种编程模型 用于大数据的并行运算。 换句话说,Map reduce是一套实现分布式计算的框架 Map...
阅读全文
摘要:他既不是软件 也不是算法 而是一种编程模型 用于大数据的并行运算。 换句话说,Map reduce是一套实现分布式计算的框架 Map...
阅读全文
摘要:对速度的改进: 如何提高响应速度?首先想一下 有哪些地方可以加速 我们是提高读的速度还是写的速度? 如果是提高读的速度的话 那么很简...
阅读全文
摘要:文件的组成有: metadata:文件相关信息 文件内容,windows对于文件内容的储存是连续储存 而linux是分开储存 1 b...
阅读全文
摘要:文件的组成有: metadata:文件相关信息 文件内容,windows对于文件内容的储存是连续储存 而linux是分开储存 1 b...
阅读全文
摘要:对速度的改进: 如何提高响应速度?首先想一下 有哪些地方可以加速 我们是提高读的速度还是写的速度? 如果是提高读的速度的话 那么很简...
阅读全文
摘要:Interview Question: Design Twitter before you answer this problem,...
阅读全文
摘要:我们是一次写入还是分多次写入? 如果是一次写入的话 对于大文件 如果有哪里写错了 就要重写。 所以我们是将之分块: 那么每一个ch...
阅读全文
摘要:我们是一次写入还是分多次写入? 如果是一次写入的话 对于大文件 如果有哪里写错了 就要重写。 所以我们是将之分块: 那么每一个ch...
阅读全文
摘要:Interview Question: Design Twitter before you answer this problem,...
阅读全文
摘要:这其实是一个相对的概念: 所有发送请求的端都是客户端 接受并处理请求
阅读全文
摘要:这其实是一个相对的概念: 所有发送请求的端都是客户端 接受并处理请求
阅读全文
摘要:现代大型网站都有很多台服务器,万一某一台暂时挂了 网站就不能用了 如果彻底挂了 那么储存在其中稍微数据就全丢了。 解决方法: 数据拆...
阅读全文
摘要:现代大型网站都有很多台服务器,万一某一台暂时挂了 网站就不能用了 如果彻底挂了 那么储存在其中稍微数据就全丢了。 解决方法: 数据拆...
阅读全文
摘要:所谓的scale step就是解决一些奇奇怪怪的corner case的 比如说: how to handle update or ...
阅读全文
摘要:所谓的scale step就是解决一些奇奇怪怪的corner case的 比如说: how to handle update or ...
阅读全文
摘要:analysis this problem based on the 4S Scenario: Given seeds, crawl...
阅读全文
摘要:analysis this problem based on the 4S Scenario: Given seeds, crawl...
阅读全文
摘要:Now we are implement the 4S analysis method: Scenario: login regis...
阅读全文
摘要:Now we are implement the 4S analysis method: Scenario: login regis...
阅读全文
摘要:我们之所以叫SQL 是因为数据是很relational的 那什么叫做relational呢?就是我们有时候需要很多Join关键字就能...
阅读全文
摘要:我们之所以叫SQL 是因为数据是很relational的 那什么叫做relational呢?就是我们有时候需要很多Join关键字就能...
阅读全文
摘要:数据备份 即Replica Replica in SQL: Master-slave 模式,master负责读写 slave只负责读...
阅读全文
摘要:数据备份 即Replica Replica in SQL: Master-slave 模式,master负责读写 slave只负责读...
阅读全文
摘要:we will add like_nums to Tweet table. and create a Like table to s...
阅读全文
摘要:we will add like_nums to Tweet table. and create a Like table to s...
阅读全文
摘要:Pull model: the whole procedure: getNewsFeed+Merge k sort array co...
阅读全文
摘要:Pull model: the whole procedure: getNewsFeed+Merge k sort array co...
阅读全文
摘要:其他用户发送新的推文之后 这个推文被推送到每个关注他的用户的news feed list里面,这里用到fanout. ...
阅读全文
摘要:其他用户发送新的推文之后 这个推文被推送到每个关注他的用户的news feed list里面,这里用到fanout. ...
阅读全文
摘要:Still, 4S Scenario: 我要根据一个长的URL生成一个短的(我们能转过去同时也要能转过来) 而且同时 我还要考虑短网...
阅读全文
摘要:Still, 4S Scenario: 我要根据一个长的URL生成一个短的(我们能转过去同时也要能转过来) 而且同时 我还要考虑短网...
阅读全文
摘要:如何将一个长度不定的长URL转换成一个6位的短网址 算法1 hash function,但是没办法去设计一个没有冲突的哈希算法 算法...
阅读全文
摘要:如何将一个长度不定的长URL转换成一个6位的短网址 算法1 hash function,但是没办法去设计一个没有冲突的哈希算法 算法...
阅读全文
摘要:数据库索引,是数据库管理系统中一个排序的数据结构,以协助快速查询、更新数据库表中数据。
阅读全文
摘要:数据库索引,是数据库管理系统中一个排序的数据结构,以协助快速查询、更新数据库表中数据。
阅读全文
摘要:SQL型数据库,通常自带master slave的replica方法,即master负责写 slave负责读。slave负责从mas...
阅读全文
摘要:SQL型数据库,通常自带master slave的replica方法,即master负责写 slave负责读。slave负责从mas...
阅读全文
摘要:这是一种有效防止数据库单点失效或者挂掉的方法。 Backup一般指周期性的,所以当数据丢失的时候 通常只能恢复到之前的某个时间点。B...
阅读全文
摘要:这是一种有效防止数据库单点失效或者挂掉的方法。 Backup一般指周期性的,所以当数据丢失的时候 通常只能恢复到之前的某个时间点。B...
阅读全文
摘要:横向切分是为了解决单点失效问题 因此我们对表进行按列切分。 而这样切分的话会造成一个问题: 拓展的时候迁移数据会十分困难。假设我们之...
阅读全文
摘要:横向切分是为了解决单点失效问题 因此我们对表进行按列切分。 而这样切分的话会造成一个问题: 拓展的时候迁移数据会十分困难。假设我们之...
阅读全文
摘要:一次读整个文件 号时说拆分成多份读入? 仔细想一下 肯定不是一次读 因为你也没法一起读 毕竟都在不同的服务器上。 但是我们首先要解决...
阅读全文
摘要:一次读整个文件 号时说拆分成多份读入? 仔细想一下 肯定不是一次读 因为你也没法一起读 毕竟都在不同的服务器上。 但是我们首先要解决...
阅读全文
摘要:什么分布式系统?用多台机器解决一台机器上不能解决的问题。 现在常用的分布式文件系统有两种: 按照4S 分析: Scenario: ...
阅读全文
摘要:什么分布式系统?用多台机器解决一台机器上不能解决的问题。 现在常用的分布式文件系统有两种: 按照4S 分析: Scenario: ...
阅读全文
摘要:主要是两方面:读的scale和写的scale 总结一下这篇文章: 关于解决方法的一些细节: 首先 当文件越来越多的时候,serve...
阅读全文
摘要:主要是两方面:读的scale和写的scale 总结一下这篇文章: 关于解决方法的一些细节: 首先 当文件越来越多的时候,serve...
阅读全文
摘要:说checksum你可能不熟悉 但是说一些checksum的方法你就会恍然大悟:MD5, SHA1,SHA256, SHA516。 ...
阅读全文
摘要:说checksum你可能不熟悉 但是说一些checksum的方法你就会恍然大悟:MD5, SHA1,SHA256, SHA516。 ...
阅读全文
摘要:单向好友关系 双向好友关系。 so what kind of db should we choose? SQL or NoSQL?...
阅读全文
摘要:单向好友关系 双向好友关系。 so what kind of db should we choose? SQL or NoSQL?...
阅读全文
摘要:Principle1: For most cases, SQL and NoSQL are both good. Principle...
阅读全文
摘要:Principle1: For most cases, SQL and NoSQL are both good. Principle...
阅读全文
摘要:
阅读全文
摘要:
阅读全文
摘要:Cassandra 是一个三层结构的NoSQL数据库 如果我们想往此数据库中插入数据 应该是:insert(row_key, col...
阅读全文
摘要:Cassandra 是一个三层结构的NoSQL数据库 如果我们想往此数据库中插入数据 应该是:insert(row_key, col...
阅读全文
摘要:把一个object或者hash序列化为一个String. 序列化(Serialization)是将对象的状态信息转化为可以存储或者传...
阅读全文
摘要:把一个object或者hash序列化为一个String. 序列化(Serialization)是将对象的状态信息转化为可以存储或者传...
阅读全文
摘要:there are both contains anth related information. session exist in...
阅读全文
摘要:there are both contains anth related information. session exist in...
阅读全文
摘要:cache aside: cache through:
阅读全文
摘要:cache aside: cache through:
阅读全文
摘要:So what storage of system we can choose? Three: SQL – MySQL, Postg...
阅读全文
摘要:So what storage of system we can choose? Three: SQL – MySQL, Postg...
阅读全文
摘要:we will have a table called session table to manage that. somethin...
阅读全文
摘要:we will have a table called session table to manage that. somethin...
阅读全文
摘要:class UserService: def getUser(self, user_id): key = "user::%s...
阅读全文
摘要:class UserService: def getUser(self, user_id): key = "user::%s...
阅读全文
摘要:Cache is a k-v structured thing. and it store results that can ans...
阅读全文
摘要:Cache is a k-v structured thing. and it store results that can ans...
阅读全文
摘要:缓存存在于内存中 常用的缓存工具和服务器有:Memcached, redis 需要缓存的原因是因为其放在内存里所以存取效率比较高 但...
阅读全文
摘要:缓存存在于内存中 常用的缓存工具和服务器有:Memcached, redis 需要缓存的原因是因为其放在内存里所以存取效率比较高 但...
阅读全文
摘要:structured your answer: Scenario, service, storage, scaleAsk befor...
阅读全文
摘要:structured your answer: Scenario, service, storage, scaleAsk befor...
阅读全文
摘要:一般来说 关注和取关是如何实现的? follow一个在用户之后 会异步的将其time line合并到自己的news feed中,也就...
阅读全文
摘要:一般来说 关注和取关是如何实现的? follow一个在用户之后 会异步的将其time line合并到自己的news feed中,也就...
阅读全文
摘要:we need to know what are the key points of the news feed system? f...
阅读全文
摘要:we need to know what are the key points of the news feed system? f...
阅读全文
摘要:use the service in tweet design. In a word, all of those are som...
阅读全文
摘要:use the service in tweet design. In a word, all of those are som...
阅读全文
摘要:use twitter as example: the user table is suitable to put into SQL...
阅读全文
摘要:use twitter as example: the user table is suitable to put into SQL...
阅读全文
摘要:简而言之 就是服务器用的比较少 就考虑single point failure.服务器用的比较多,就要考虑如果其中某一台挂了怎么办...
阅读全文
摘要:简而言之 就是服务器用的比较少 就考虑single point failure.服务器用的比较多,就要考虑如果其中某一台挂了怎么办...
阅读全文
摘要:case1: Given a senario, design a suitable system: like: design twi...
阅读全文
摘要:case1: Given a senario, design a suitable system: like: design twi...
阅读全文
摘要:Given the following three list, how would you create a new list th...
阅读全文
摘要:Given the following three list, how would you create a new list th...
阅读全文
摘要:首先我们要明白一点,Python和Java C++不一样 python中的函数可以像普通变量一样当作参数传递给另外一个函数 比如说下...
阅读全文
摘要:首先我们要明白一点,Python和Java C++不一样 python中的函数可以像普通变量一样当作参数传递给另外一个函数 比如说下...
阅读全文
摘要:封装是对具体对象的一种抽象 即将某些部分隐藏起来 是的程序外部看不到 使得其他程序无法调用。这是为了保护隐私和隔离复杂度。当然 你必...
阅读全文
摘要:封装是对具体对象的一种抽象 即将某些部分隐藏起来 是的程序外部看不到 使得其他程序无法调用。这是为了保护隐私和隔离复杂度。当然 你必...
阅读全文
摘要:the most regular methods in python is instance method. something l...
阅读全文
摘要:the most regular methods in python is instance method. something l...
阅读全文
摘要:使用react开发网页的话,我们难免会下载两个包,一个是react,一个是react-dom,其中react是react的核心代码。...
阅读全文
摘要:使用react开发网页的话,我们难免会下载两个包,一个是react,一个是react-dom,其中react是react的核心代码。...
阅读全文
摘要:是由React团队开发的 是React的核心组成部分,它使用XML标记的方式去直接声明界面,界面组件之间可以互相嵌套。可以理解为在J...
阅读全文
摘要:是由React团队开发的 是React的核心组成部分,它使用XML标记的方式去直接声明界面,界面组件之间可以互相嵌套。可以理解为在J...
阅读全文
摘要:It’s a javascript library for building user interfaces 注意:他只是规定了在什...
阅读全文
摘要:It’s a javascript library for building user interfaces 注意:他只是规定了在什...
阅读全文
摘要:分为两个部分 backend and front end backend部分代码主要就一个server.js 里面包含了各种请求头和...
阅读全文
摘要:分为两个部分 backend and front end backend部分代码主要就一个server.js 里面包含了各种请求头和...
阅读全文
摘要:Node/Express sends requests to the React.js backend ...
阅读全文
摘要:Node/Express sends requests to the React.js backend ...
阅读全文
摘要:reference: https://www.jianshu.com/p/2ad286397f7a Similarity: the ...
阅读全文
摘要:reference: https://www.jianshu.com/p/2ad286397f7a Similarity: the ...
阅读全文
摘要:Given an array of integers, a, count the number of pairs of i and ...
阅读全文
摘要:Given an array of integers, a, count the number of pairs of i and ...
阅读全文
摘要:就是对于每个b_i来说都去找离它最近的那个a_k,然后gain_i就是|b_i - a_i| - |b_i - a_k|,意为如果...
阅读全文
摘要:就是对于每个b_i来说都去找离它最近的那个a_k,然后gain_i就是|b_i - a_i| - |b_i - a_k|,意为如果...
阅读全文
摘要:for example: input: [[6, 5], [2, 3], [4, 3], [4, 5], [1, 2]] outpu...
阅读全文
摘要:for example: input: [[6, 5], [2, 3], [4, 3], [4, 5], [1, 2]] outpu...
阅读全文
摘要:Python Version: def figureEnderGravity(matrix): if not matrix ...
阅读全文
摘要:Python Version: def figureEnderGravity(matrix): if not matrix ...
阅读全文
摘要:similar to leetcode move zeros. move zeros: given an integer array...
阅读全文
摘要:similar to leetcode move zeros. move zeros: given an integer array...
阅读全文
摘要:Python version of code, it can be easily changed into java def a...
阅读全文
摘要:Python version of code, it can be easily changed into java def a...
阅读全文
摘要:public int reverseSum(int[] numbers) { int res = 0; for (int nu...
阅读全文
摘要:public int reverseSum(int[] numbers) { int res = 0; for (int nu...
阅读全文
摘要:the picture above is the process of rotating. codes in java: publ...
阅读全文
摘要:the picture above is the process of rotating. codes in java: publ...
阅读全文
摘要:given two arrays, arr and pieces arr is a one dimension array and ...
阅读全文
摘要:given two arrays, arr and pieces arr is a one dimension array and ...
阅读全文
摘要:test if any consecutive triplet can form the length of edges that ...
阅读全文
摘要:test if any consecutive triplet can form the length of edges that ...
阅读全文
摘要:given two arrays a and b, they contains no duplicated and it is so...
阅读全文
摘要:given two arrays a and b, they contains no duplicated and it is so...
阅读全文
摘要:The problem describes it in a subtle way, so it’s better to just g...
阅读全文
摘要:The problem describes it in a subtle way, so it’s better to just g...
阅读全文
摘要:this problem is relatively simple. Given two integer arrays, a and...
阅读全文
摘要:this problem is relatively simple. Given two integer arrays, a and...
阅读全文
摘要:we are given an array of integers, stock. represents the prices. a...
阅读全文
摘要:we are given an array of integers, stock. represents the prices. a...
阅读全文

浙公网安备 33010602011771号