Skip to content

Commit b182df3

Browse files
committed
面试复习
1 parent c4c435c commit b182df3

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Senior Java engineer interview exams in 2019
44

55
高级Java工程师面试题2019
66

7+
## 资深Java工程师复习计划
8+
9+
[资深Java工程师复习计划-2019](readme/study2019.md)
10+
711
## 面试题目
812

913
### 面试题来自本人的程序员朋友面试经历,经本人和开源爱好者汇总
@@ -209,6 +213,8 @@ String s = " z111,c888,n222,,,g000, t333,a999,c888 ,p000 ,z111 ";
209213
* [微服务调用超时的处理方案](readme/call-timeout-process.md)
210214

211215
* [设计模式六大原则](/readme/design-pattern-principle.md)
216+
217+
* [CAP定理](/readme/cap.md)
212218

213219
* sql遗漏知识点
214220

readme/cap.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CAP定理
2+
3+
* 一致性(C):在分布式系统中的所有数据备份,在同一时刻是否同样的值。即数据保持一致,在分布式系统中,可以理解为多个节点中数据的值是一致的。同时,一致性也是指事务的基本特征或特性相同,其他特性或特征相类似。
4+
* 可用性(A):在集群(由多个独立的计算机通过高速的通信网络连接起来的,具有单一系统映象的高性能计算机系统。)中一部分节点故障后,集群整体是否还能响应客户端的读写请求。(可用性不仅包括读,还有写) 。
5+
* 分区容忍性(P):集群中的某些节点在无法联系后,集群整体是否还能继续进行服务。
6+
7+
分区容忍性的理解:
8+
9+
一个分布式系统里面,节点组成的网络本来应该是连通的。然而可能因为一些故障,使得有些节点之间不连通了,整个网络就分成了几块区域。数据就散布在了这些不连通的区域中。这就叫分区。当你一个数据项只在一个节点中保存,那么分区出现后,和这个节点不连通的部分就访问不到这个数据了。这时分区就是无法容忍的。提高分区容忍性的办法就是一个数据项复制到多个节点上,那么出现分区之后,这一数据项就可能分布到各个区里。容忍性就提高了。然而,要把数据复制到多个节点,就会带来一致性的问题,就是多个节点上面的数据可能是不一致的。要保证一致,每次写操作就都要等待全部节点写成功,而这等待又会带来可用性的问题。总的来说就是,数据存在的节点越多,分区容忍性越高,但要复制更新的数据就越多,一致性就越难保证。为了保证一致性,更新所有节点数据所需要的时间就越长,可用性就会降低。
10+
11+
12+
"Partition Tolerance" 这个形容词确实挺容易 confuse 的,《A Critique of the CAP Theorem》文章曾这样批评:we can interpret partition tolerance as meaning “a network partition is among the faults that are assumed to be possible in the system.” It is misleading to say that an algorithm “provides partition tolerance,” and it is better to say that an algorithm “assumes that partitions may occur.”至于 Network Partition 应当理解为 CAP 理论中讨论的故障模型,这里需要注意 Network Partition 并非节点 Crash(节点 Crash 属于 FLP 的故障模型),更侧重于 "节点双方一时联系不上对方" 的一个状态。造成 Partition 的原因可能是网络不可达,也可能是 GC 的 Stop The World 阻塞太久,也可能是 CPU 彪到一个死循环上,总之种种血案。aphyr 曾整理过这么一些灾难问题,可以参考:
13+
14+
[https://github.com/aphyr/partitions-post](https://github.com/aphyr/partitions-post)

readme/red-black-tree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
## 平衡二叉树
3+
4+
平衡二叉搜索树(Self-balancing binary search tree)又被称为AVL树(有别于AVL算法),且具有以下性质:它是一 棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。平衡二叉树的常用实现方法有红黑树、AVL、替罪羊树、Treap、伸展树等。 最小二叉平衡树的节点总数的公式如下 F(n)=F(n-1)+F(n-2)+1 这个类似于一个递归的数列,可以参考Fibonacci(斐波那契)数列,1是根节点,F(n-1)是左子树的节点数量,F(n-2)是右子树的节点数量。
5+

readme/study2019.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
| 序号 | 状态 | 标题 | 简介 |
3+
| :---: | :---: | :---: | :---: |
4+
| 1 | DONE | MPush源码研究 | IM中间件的原理学习 |
5+
| 2 | DONE | OAuth2.0原理 | |
6+
| 3 | DONE | HashMap源码jdk8 | 参考 [HashMap源码jdk8](https://blog.csdn.net/v123411739/article/details/78996181) |
7+
| 4 | DONE | [红黑树](https://www.cnblogs.com/skywang12345/p/3245399.html) | 红黑树是平衡的二叉查找树, 主要是左旋和右旋。 [详情](red-black-tree.md) |
8+
| 5 | DONE | 单点登录SSO原理 | [博客](https://www.cnblogs.com/ywlaker/p/6113927.html) |
9+
| 6 | DONE | MySQL B-Tree 和 B+tree | [博客](https://www.cnblogs.com/vianzhang/p/7922426.html) |
10+
11+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy