As expected of Baidu’s social recruitment, JVM+spring+mysql+Zookeeper really asked, I doubt my life.

Preface

Let me introduce myself first. I have been working for two years, and I have been working in a fairly small company before (which company I will not disclose), because the ruthless oppression of the superiors finally ended this year. I couldn’t stay in the month, and I left with the people below. After leaving the job, I have been reviewing and enriching myself at home. Later, my friend asked me if I had a Baidu internal recommendation. Would you like to try it? , I didn’t expect that I actually got the offer. Let’s summarize my own experience and information and share it with you. It is also paving the way for the younger generation!

Here I have prepared interview materials for first-line manufacturers and my original super hardcore PDF technical documents, as well as multiple sets of resume templates that I have carefully prepared for everyone (continuously updated). I hope everyone can find their favorite job! Friends in need can click here to remark csdn to download by themselves, hope it will be helpful to you!

one side

JAVA basics
  • Hashmap bottom layer, is it thread safe, and what problems will arise in the case of high concurrency?

  • How to make hashmap safe?

  • The underlying implementation of Concurrenthashmap

  • What is reflection?

  • What should the key pay attention to when putting Hashmap (hashcode and equals)

Thread
  • Thread implementation

  • Thread pool parameters

  • Thread abandonment strategy

  • Whether the work queue in the thread is bounded

  • Implementation process of thread pool

  • The role of Volatile

  • Tell me in detail happens-before

  • The difference between ReetrantLock and sychronized

  • Sychronized lock (bias lock-spin lock-heavyweight lock)

  • How to solve the problems in CAS

JVM
  • Introduce what is JMM?

  • How does JAVA create objects? What is contained in the object header?

  • JVM memory area? What is stored in the virtual machine stack?

  • Algorithm for garbage collection?

  • What objects can GC roots be

  • Tell me more about the parent delegation mechanism?

  • Can the parent delegation mechanism be broken? (Rewrite the classload method yourself, or set the search parent to null)

  • What are the class loaders?

  • Where does the loaded class information exist?

  • Talk about object locks and class locks?

Spring
  • Talk about the implementation of Spring AOP

  • Those design patterns used in Spring

  • The generation process of Bean object in Spring

Mysql
  • What are the database engines? The difference between them

  • What are the MySQL indexes?

  • What is MVCC?

  • What should I do if I find a slow query?

  • What are the keywords in Explain? (Id, table, type, key, rows)

  • The difference between Hbase and MySQL?

  • Does MySQL guarantee atomicity? (Using the undo log to achieve atomic consistency, when the transaction is rolled back, you can use the undo log to roll back, if you inert, you need to delete at this time; he records the information needed for the rollback)

Zookeeper
  • Talk about Zookeeper (file configuration, cluster management, distributed lock, queue management) (monitoring mechanism: ZooKeeper's Watcher mechanism mainly includes three parts: client thread, client WatcherManager, and Zookeeper server. The client is registered with the ZooKeeper server at the same time , The Watcher object will be stored in the client's WatcherManager. When the ZooKeeper server triggers the Watcher event, it will send a notification to the client, and the client thread will retrieve the corresponding Watcher object from the WatcherManager to execute the callback logic) Election mechanism: half mechanism

  • Zookeeper's heartbeat mechanism

  • Do you understand load balancing?

Two sides (focus on developing issues through the project)

  • Is there any improvement for large file data upload? (Multi-thread upload, whether the static internal class of value can be used for enumeration, whether boolean can be used for bit storage)

  • Advantages and disadvantages of multithreading? (Advantages: high concurrency, less use of context switching resources on multi-core CPUs) (disadvantages: deadlock, cache consistency, and instruction rearrangement in the case of fewer resources)

  • Do you think instruction rearrangement may occur on the CPU?

  • If you are talking about multi-threaded context switching with less resources, can you not use processes? Exchange data using shared memory

  • Suppose there are 4 CPUs and one process on each CPU. Shared memory is used between processes? Do you think it is okay not to use threads? Like ngnix

  • Why is there cache coherency during multithreading? (Working memory and shared main memory)

  • How does Volatile guarantee memory visibility?

  • Where are working memory and shared memory?

  • So if it exists in the stack, there shouldn't be cache coherency?

  • How many cache levels are there in the MESI protocol? Which level in the cache is private and which level is shared? Where does the cache exist?

  • How can deadlock occur?

  • Will you write a deadlock?

  • Why don't you report an error after writing this?

  • Open the snapshot and ask if you can understand it? Why not report an error?

Three sides

  • Can you come for an internship?
  • Future career plan?
  • Your own strengths and weaknesses?

At last

Finally, free Java architecture learning materials are provided. The learning technology content includes: Spring, Dubbo, MyBatis, RPC, source code analysis, high concurrency, high performance, distributed, performance optimization, microservice advanced architecture development, etc.
Insert picture description here
Insert picture description here

There are also Java core knowledge points + a full set of architect learning materials and videos + first-line interview books + interview resume templates can be obtained + Ali Meituan Netease Tencent Xiaomi Iqiyi Kuaishou Bilibili interview questions + Spring source code collection + Java architecture Practical e-books. Friends in need can click here to note the csdn to download by themselves. I hope to help you who are preparing for the interview. In the end, I still wish everyone, begging for wives, children, children, and offers.

Guess you like

Origin blog.csdn.net/jiagouwgm/article/details/110734217