Java面试被虐过程

java面试

Posted on 2020-07-08 12:00:00   阅读(7252) Last updated on 2020-07-22 20:37:19

记录一下面试过程中被问到一些经典问题和答案

spring

事务注解原理  
多事务嵌套   
spring boot 启动原理  
spring mvc 加载流程 https://www.cnblogs.com/RunForLove/p/5688731.html  

java

java堆实现排序  
1.8形函数怎么调用的  
stringbuffer和stringbuilder有什么区别  
如何保证代码的安全性避免宕机  
java多态, 代码中怎么用到的  

jvm

GC root 收集哪些对象?  除了堆,方法区、本地栈、本地方法栈  
fullgc怎么触发 新的对象老年区放不下       https://blog.csdn.net/weixin_42237752/article/details/104905769?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase  
怎么让一个对象直接放到老年区  有一个jvm参数可以设置,超过这个大小直接保存到老年区    
String放入运行时常量池的时机与String.intern()方法解惑  https://blog.csdn.net/rainnnbow/article/details/50461303
jvm工具阿里巴巴阿尔萨斯  
jvm调优 https://blog.csdn.net/SELECT_BIN/article/details/83148612  
    XMX&XMS固定防止内存抖动 在实际生产中,一般把-Xms和-Xmx设置成一样的  
    堆空间调整:年轻代Age调整、年轻代eden:s0:s1比例调整  
    收集器调整:大促前把CMS的预清理次数调低一些,CMS的清理阈值调高一些  
线上机器cpu100%你怎么处理?  
    容器化时代,一定要top看下是不是st过高,存在超卖的可能性  
    如果不是的话top看下哪个进程有问题,然后看这个进程哪个线程吃了cpu  
    jstack直接把线程dump出来然后找对应有问题的线程再分析  
    也有可能是内存泄漏导致的频繁GC问题,可以拉GClog然后在jmap把heap dump出来看下  

多线程

java实现多线程   
多线程 线程池 https://www.cnblogs.com/kuoAT/p/6714762.html  
sync和re的区别   
thread runnable callable future有什么区别  
高并发怎么锁库存,而且不影响业务 redis increment  
CountDownLatch、CyclicBarrier和Semaphore https://www.cnblogs.com/dolphin0520/p/3920397.html  

集合

hashmap list set 初始大小   
迭代器  
list和linklist  
Concurrenthashmap和hashmap的区别,除了线程不安全,https://blog.csdn.net/xuefeng0707/article/details/40834595   
红黑树 https://segmentfault.com/a/1190000012728513  
hashmap 1.7和1.8的hashmap有什么区别  https://blog.csdn.net/qq_36520235/article/details/82417949  
hashmap https://blog.csdn.net/h1458280799/article/details/85265135  
hashmap https://blog.csdn.net/carson_ho/article/details/79373134  
hashmap深一点 https://www.jianshu.com/p/9fe4cb316c05  
hashmap 1.7 头插 扩容后插入   
hashmap 1.8 尾插 插入后再扩容   
hashmap 为什么重写 equal, hashcode  

dubbo http://dubbo.apache.org/zh-cn/docs/user/quick-start.html

dubbo线程池怎么设置合理 https://blog.csdn.net/weixin_34061555/article/details/92030363  
dubbo负载均衡 https://www.cnblogs.com/qingfengbuluo/p/5527930.html  
dubbo通讯原理 https://blog.csdn.net/wj1607162253/article/details/77948376  

mysql

mysql select 索引字段 需要回表吗  
关系型和非关系型怎么选择  
mybatis源码 分页器、慢sql  
mysql sql执行过程  https://www.itqiankun.com/article/mysql-sql-execute  
mysql为什么用b+树  
mysql死锁   
mysql 联合索引问题  
数据库散列  
如何避免回表 https://www.cnblogs.com/myseries/p/11265849.html  
mysql有哪些锁 有什么区别  

redis

redis setnx 分布式锁 https://blog.csdn.net/KingCat666/article/details/77892176  
如果Redis的master节点宕机了怎么办呢?redis哨兵机制 https://blog.csdn.net/belongtocode/article/details/104325782  
java手写redis lru算法 https://blog.csdn.net/u18256007842/article/details/100151569  
用redis做缓存,数据库先删除和redis先删  会有什么危险 https://zhuanlan.zhihu.com/p/91770135  

网络

Netty https://www.jianshu.com/p/b9f3f6a16911  
mq如何保证信息不重复 https://github.com/doocs/advanced-java/blob/master/docs/high-concurrency/how-to-ensure-that-messages-are-not-repeatedly-consumed.md  
kfk   
RocketMQ mq消息类型 messageId怎么生成的   
RocketMQ 为什么不用zookeeper https://blog.csdn.net/manzhizhen/article/details/52606733  
RocketMQ和kafka的有什么区别  
RocketMQ 面试题https://blog.csdn.net/dingshuo168/article/details/102970988  https://blog.csdn.net/pzq915981048/article/details/106070686?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase