123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="Asciidoctor 2.0.15">
- <title>Interview-Questions</title>
- <link rel="stylesheet" href="css/site.css">
- <link href="css/custom.css" rel="stylesheet">
- <script src="js/setup.js"></script><script defer src="js/site.js"></script>
- </head>
- <body class="article toc2 toc-left"><div id="banner-container" class="container" role="banner">
- <div id="banner" class="contained" role="banner">
- <div id="switch-theme">
- <input type="checkbox" id="switch-theme-checkbox" />
- <label for="switch-theme-checkbox">Dark Theme</label>
- </div>
- </div>
- </div>
- <div id="tocbar-container" class="container" role="navigation">
- <div id="tocbar" class="contained" role="navigation">
- <button id="toggle-toc"></button>
- </div>
- </div>
- <div id="main-container" class="container">
- <div id="main" class="contained">
- <div id="doc" class="doc">
- <div id="header">
- <h1>Interview-Questions</h1>
- <div id="toc" class="toc2">
- <div id="toctitle">Table of Contents</div>
- <span id="back-to-index"><a href="index.html">Back to index</a></span><ul class="sectlevel1">
- <li><a href="#_type">1. Type</a></li>
- <li><a href="#_code">2. Code</a></li>
- <li><a href="#_threadlocal">3. ThreadLocal</a></li>
- </ul>
- </div>
- </div>
- <div id="content">
- <div class="sect1">
- <h2 id="_type"><a class="anchor" href="#_type"></a>1. Type</h2>
- <div class="sectionbody">
- <div class="paragraph">
- <p>八股文 问题处理 实战与技术广度 基础与底层原理</p>
- </div>
- </div>
- </div>
- <div class="sect1">
- <h2 id="_code"><a class="anchor" href="#_code"></a>2. Code</h2>
- <div class="sectionbody">
- <div class="olist arabic">
- <ol class="arabic">
- <li>
- <p>如何实现多继承(不是真正的多继承,指一个类包含两个其它类的功能)</p>
- </li>
- <li>
- <p>equals()方法需要具备自反性、对称性、传递性、一致性,分别写几个违背对称性、传递性、一致性的示例代码</p>
- </li>
- <li>
- <p>说出3到5个常见的运行时异常</p>
- </li>
- <li>
- <p>说出5个以上Object类中的方法</p>
- </li>
- <li>
- <p>微服务单点登录实现原理</p>
- </li>
- <li>
- <p>MyBatis注入与执行原理
- 7。记住我功能实现过程</p>
- </li>
- <li>
- <p>jdk8之后新特性</p>
- </li>
- <li>
- <p>线程池关键参数及其意义</p>
- </li>
- <li>
- <p>fixedPoll singlePool cachedPool 使用的队列</p>
- </li>
- <li>
- <p>设计模式</p>
- </li>
- <li>
- <p>内存溢出时被占用的内存会被回收吗</p>
- </li>
- <li>
- <p>内存溢出时线程会终止吗</p>
- </li>
- <li>
- <p>内存溢出问题如何排查</p>
- </li>
- <li>
- <p>常用单元测试框架与单元测试注意事项</p>
- </li>
- <li>
- <p>页面卡住问题排查方法与思路</p>
- </li>
- <li>
- <p>云原生</p>
- </li>
- <li>
- <p>数据权限实现思路</p>
- </li>
- <li>
- <p>Spring Security框架原理(用过的话)</p>
- </li>
- <li>
- <p>OAuth2</p>
- </li>
- <li>
- <p>什么是系统调用、物理内存与虚拟内存</p>
- </li>
- <li>
- <p>@Scheduled实现原理</p>
- </li>
- <li>
- <p>websocket连接过程</p>
- </li>
- <li>
- <p>SpringMVC请求处理过程</p>
- </li>
- <li>
- <p>spring-jdbc事务使用方式</p>
- </li>
- <li>
- <p>jdk中日期相关的类以及塔曼的区别</p>
- </li>
- <li>
- <p>请求参数校验与Bean Validation</p>
- </li>
- <li>
- <p>用户登录功能的实现过程</p>
- </li>
- <li>
- <p>SpringMVC的拦截器以及它的使用场景</p>
- </li>
- <li>
- <p>常用的日志框架以及它们之间的关系</p>
- </li>
- <li>
- <p>CORS是什么</p>
- </li>
- <li>
- <p>GET与POST的区别,都用POST会有问题吗</p>
- </li>
- <li>
- <p>Java中有哪些函数式接口</p>
- </li>
- <li>
- <p>http缓存机制与缓存相关的响应头</p>
- </li>
- <li>
- <p>SpringMVC用的哪个库实现Json序列号与反序列号,Jackson与Fastjson的比较</p>
- </li>
- <li>
- <p>http2新特性,Spring Boot支持使用http2吗</p>
- </li>
- <li>
- <p>Spring Boot常用的有哪些starter,分别用来做什么</p>
- </li>
- <li>
- <p>jdk中常用的排查问题工具</p>
- </li>
- <li>
- <p>Spring Boot Actuator的作用</p>
- </li>
- <li>
- <p>Maven同一个依赖多个版本怎么选择</p>
- </li>
- <li>
- <p>Spring Boot应用怎么修改日志级别</p>
- </li>
- <li>
- <p>Spring Boot默认用的什么日志框架</p>
- </li>
- <li>
- <p>Spring Boot怎么做国际化</p>
- </li>
- <li>
- <p>Spring Boot应用怎么打包成容器镜像</p>
- </li>
- <li>
- <p>Linux上用什么命令把文件中一个词替换成另一个词</p>
- </li>
- <li>
- <p>怎么监控Spring Boot应用</p>
- </li>
- <li>
- <p>k8s中怎么暴露服务</p>
- </li>
- <li>
- <p>k8s中StorageClass是什么</p>
- </li>
- <li>
- <p>详细设计要包含哪些内容</p>
- </li>
- <li>
- <p>日志太多刷太快日志看不清怎么办</p>
- </li>
- <li>
- <p>单元测试怎么测试Controller,需要new Service吗,怎么测试DAO层,MyBatis的单元测试怎么做</p>
- </li>
- <li>
- <p>远程调试怎么用,线上环境怎么调试</p>
- </li>
- <li>
- <p>性能测试工具有哪些,测试时关注什么数据</p>
- </li>
- <li>
- <p>泛型 类型擦除</p>
- </li>
- <li>
- <p>vim查看文件内容时显示行号</p>
- </li>
- <li>
- <p>从倒数500行开始查看日志用什么命令</p>
- </li>
- <li>
- <p>一个Java程序开机自启动怎么实现</p>
- </li>
- <li>
- <p>修改一个文件的属组和属主用什么命令</p>
- </li>
- <li>
- <p>修改一个文件的读写执行权限用什么命令</p>
- </li>
- <li>
- <p>volatile使用场景</p>
- </li>
- <li>
- <p>Spring Cloud中做负载均衡的子项目</p>
- </li>
- <li>
- <p>curl常用参数</p>
- </li>
- <li>
- <p>SpringMVC根据请求头路由怎么实现</p>
- </li>
- <li>
- <p>日常学习途径</p>
- </li>
- <li>
- <p>B树 B+树</p>
- </li>
- <li>
- <p>解决Hash冲突除链表外的其他方案</p>
- </li>
- </ol>
- </div>
- </div>
- </div>
- <div class="sect1">
- <h2 id="_threadlocal"><a class="anchor" href="#_threadlocal"></a>3. ThreadLocal</h2>
- <div class="sectionbody">
- <div class="olist arabic">
- <ol class="arabic">
- <li>
- <p>使用WeakReference是因为ThreadLocal可能在线程结束之前就已经使用完了,如果不用弱引用,线程结束前ThreadLocal都不能被回收,这里与方法局部变量区别在于方法执行完成后其局部变量就能被回收,而ThreadLocal是Thread的属性,不用弱引用的话就只能等线程结束后再被回收;另一方面ThreadLocal是在多个线程中使用的,如果是强引用只要存在一个线程没结束ThreadLocal就不能被回收。</p>
- </li>
- <li>
- <p>内存泄漏问题与弱引用无关,指的是在tomcat这类连接池的场景,线程根本不会结束,例如在springMVC的controller中声明一个ThreadLocal用于保存特定请求参数,请求结束后由于线程并未结束,之前保存的参数也仍然在内存中。</p>
- </li>
- <li>
- <p>另一种内存泄漏的场景就是ThreadLocal已经被回收了但线程还没结束,其中的Entry也已经失效了但还不能被回收,由于Value不能回收,它的ClassLoader也不能被回收,因此可能同时会导致ClassLoader内存泄漏。</p>
- <div class="literalblock">
- <div class="content">
- <pre>If a short-lived object is held for a long time by a long-lived object, it will cause the short-lived object to not be released after use, resulting in memory leaks.</pre>
- </div>
- </div>
- <div class="literalblock">
- <div class="content">
- <pre>https://stackoverflow.com/questions/17968803/threadlocal-memory-leak
- https://www.programmersought.com/article/88854924004/
- https://java.jiderhamn.se/2012/01/29/classloader-leaks-iv-threadlocal-dangers-and-why-threadglobal-may-have-been-a-more-appropriate-name/</pre>
- </div>
- </div>
- </li>
- </ol>
- </div>
- </div>
- </div>
- </div>
- <div id="footer">
- <div id="footer-text">
- Last updated 2024-03-18 05:44:42 UTC
- </div>
- </div>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
- <script>
- if (!hljs.initHighlighting.called) {
- hljs.initHighlighting.called = true
- ;[].slice.call(document.querySelectorAll('pre.highlight > code')).forEach(function (el) { hljs.highlightBlock(el) })
- }
- </script>
- <script src="https://utteranc.es/client.js"
- repo="pxzxj/articles"
- issue-term="title"
- label="utteranc"
- theme="github-light"
- crossorigin="anonymous"
- async>
- </script>
- </div>
- </div>
- </div>
- </body>
- </html>
|