[Interview questions] The fifth set of the most complete Java interview clearance cheats in 2018!

[Interview questions] The fifth set of the most complete Java interview clearance cheats in 2018!

The first set: "The first set of the most complete Java interview clearance cheats in 2018!

The second set: " The second set of the most complete Java interview clearance cheats in 2018!

The third set: "The third set of the most complete Java interview clearance cheats in 2018!

The fourth set: " The fourth set of the most complete Java interview clearance cheats in 2018!

Note: This article is compiled from the interview experience of many interviewers, many of which are some of my own questions, and there are many online resources. Any similarity is purely coincidental! All forms of touching porcelain are prohibited! All forms of reprinting and copying are prohibited without permission, and legal liability will be pursued if there is any violation!

Don't ask me why I don't have an answer. The reason is the same as I said before. The simple back test questions can't solve any problems. Only by digging into its internal principles can you do it with ease! Later series of articles will continue to discuss these classic interview questions, so stay tuned! You are also welcome to add and discuss in the comments!

1. Java related

  • The design of optimistic and pessimistic locks, how to ensure atomicity, and the problems to be solved;

  • The bytes of char and double, and how are they distributed in memory;

  • Object memory layout, and then talk about the death process of the object?

  • Object head, in detail;

  • The principle of sync is detailed, what happens when an exception is thrown in sync, is it deadlock? Or release it? How to troubleshoot deadlock? What happens to deadlock? Are there any better alternatives?

  • Talk about the collection in detail, HashSet source code, HashMap source code, if you want thread safety, what do you need to do?

  • What problem does multithreading solve? What problem does the thread pool solve?

  • Thread pool, how is it designed, how many kinds of parameters are there, what is the structure of the work queue and thread queue in it, and if it is given to you, how to design the thread pool?

  • AQS principle, ReentranLock source code, design principle, overall process.

  • Continue to talk about multi-threaded source code, sync principle, and then a scene design question;

  • float f = 1.4f; double d = 1.4d; and float f = 1.5f; double d = 1.5d; is true, what is the memory;

  • The source code of split, split("a|b|c"); how many arrays are obtained;

  • Write all the familiar and familiar classes under JUC (java.util.concurrent (JUC for short) package), talk about usage, and then talk about native thread operations;

  • Open-closed principle, parsing factory method pattern, builder pattern, difference. Hand out.

  • Talk about the large page mode of the JVM, the JVM memory model;

  • What is agile development, defensive programming, parallel programming. Team Leader's thinking;

  • What is escape analysis, what is its role, and what is its purpose;

  • How to consider a class to be thread safe? What is the definition of thread safety? How many keywords does Java have for synchronization? Why is it designed this way? (talked a lot, a lot of why);

  • Two thread design questions. Remember one is: t1, t2, t3, let t1, t2 execute before executing t3, native implementation.

  • Write a suffix expression, why design a suffix expression, and what are the benefits? Then write the infix.

  • I see that you have done performance optimization. For example, how do you analyze the OOM in the project and memory leaks? elaborate ideas;

  • Speaking of multi-threading, when do we need to analyze the number of threads, how to analyze, and what factors to analyze;

  • The difference between abstract methods and class methods, can static abstract methods work?

  • Let's talk about the Java clone system;

  • Involving OOM, JVM optimization, source code problems, database optimization, multi-threading and other issues;

  • High CPU? When is the CPU high? Solve what problem?

  • Have you ever encountered critical section problems? Have you encountered it? How did you solve this problem in your project?

  • volatile keyword role;

  • How to implement polymorphism in Java;

  • explain the spin;

  • Explain the semaphore;

  • Under what circumstances will class loading be triggered;

  • Java memory jitter is serious, optimization ideas;

2. Database related

  • SQL optimization ideas, the mapping relationship between the joint index and the underlying tree structure, the index structure (B+, B-), why use such a structure;

  • Talk about MySQL cluster? What problems has the cluster encountered? sql optimization?

  • What is the largest amount of data you have encountered so far? Do you know how to design when it is 1 million? 10 million? Over billions?

  • How many parameters MySQL has tunable, in addition to the maximum number of connections. List them all and analyze them one by one.

  • Talk about the optimized index, how to optimize it;

  • The difference between red-black tree and balanced tree, why the database does not use red-black tree;

  • What locks does mysql have, and what is the use of intention locks;

  • Optimization ideas under high database concurrency;

  • Under what circumstances will the database index fail;

3. Data structure and operating system related

  • Have you learned about data structure, let’s talk about it? What structure did you study? Talk about trees and queues? What about B-trees?

  • Have you learned the operating system, let’s talk about it? What is the system memory like? Segment paging virtual memory?

  • What about the page replacement algorithm? How many? Is there an optimal permutation algorithm?

  • What courses have you taken? Then talk about the operating system, the kernel, users, etc.

  • Reverse the chain watch by hand;

  • Quick sort, give a string of arrays, write down the specific patition, and write the final result as 45, 32, 41, 35, 38, 20, 50;

  • An integer status, to determine whether the Kth bit is bit 1;

  • Change the recursive implementation of quicksort to non-recursive, do you know what is the benefit of non-recursion;

  • Give an example of an algorithm using the divide and conquer idea;

4. Network related

  • Tell me about the request header details?

  • Http and Https? Http1.0, 1.1, 2.0, talk about long connections and short connections? What is HTTPS like? What if I tamper with the public key? How to prevent it?

  • Get and Post, talk about the difference, ask me to simulate the packet capture.

  • Talk about Cookie and Session, Token, OAuth2.0 protocol in detail;

  • Does the congestion algorithm know? Which and how?

  • Have you studied computer networking? Are you familiar with sockets? Any understanding of its read and write buffers? what? What about sliding windows? Why is it designed this way?

  • Let's talk about Http basic authentication of Http;

  • Https process;

5. Framework related

  • Let’s talk about the Spring source code, how much you know, let’s talk about it;

  • Talk about Spring annotations, @Autowire, @Resource, and their parsing process;

  • Let’s talk about architecture, access layer architecture, and service layer architecture. Talk about the technology stack, Spring Boot, Spring Cloud, Docker;

  • What is the difference between the specific advantages of Spring ioc and the direct New object;

  • Servlet life cycle, whether it is a singleton, why is it a singleton;

  • Spring Mvc initialization process;

5. Distributed correlation

  • How many RPC frameworks are there?

  • What is consistent hashing for?

  • How to design a high-concurrency and high-availability system? What to consider and how much to say.

  • What do you understand by caching? What problem does caching solve? What are the back-end caches and what problems do they solve?

  • Let's talk about distributed locks;

  • How did you design the system cache, why, and what scenarios;

  • Let's also talk about the various implementations of peak clipping, Redis? MQ?

  • Why use mq to cut peaks? Solve what problem?

6. Design questions

  • There are several machines that store hundreds of millions of Taobao search logs, and you only have a 2GB computer, how to select the ten most popular search keywords;

  • How to design an algorithm to compress a URL;

  • There is a page that can display two advertisements at the same time, and now there are five advertisements, and the design algorithm makes the five advertisements display probability of 1:2:3:4:5;

  • There are 25 horses and five tracks, sort the 25 horses with the least number of races;

7. Other related

  • Tomcat cache, talk about the overall understanding of cache, know how many kinds of cache;

  • Explain the principle of Mucene, inverted index, how to perform Chinese word segmentation, and what is the basis for word segmentation;

  • TopN's big data volume problem;

  • What do you think about the access layer? What problems have you encountered? What factors should be considered when building a system?

  • Then the project problem, the optimization problem;

  • Familiar with maven, right? Let's talk about the principle of Maven's source code. When Maven conflicts, how to choose a dependency package, how do we check, we encounter two different versions, how should we choose, and why?

  • How the projects are grouped and what the performance optimization team should do;

  • Let's talk about the construction of the access layer and cognitive analysis;

  • Ask about the system construction of the project, think, why is it constructed this way?

  • How to judge the quality of a piece of code;

 

Click on the image to see more recommended content

↓↓↓

Step by step to take you to understand what the ID number generator is, why and how to do it!

Interview Essentials: How to Convert a Long URL to a Short URL?

Take a deep dive into Redis' memory model!

How to participate in the world's outstanding open source projects?

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325219209&siteId=291194637