There are 130 interview questions (microservices, high concurrency, big data, cache, etc. middleware) in the Java Senior Engineer Interview Collection. If you don't know this question, you can't even pass it!

There are 130 interview questions (microservices, high concurrency, big data, cache, etc. middleware) in the Java Senior Engineer Interview Collection. If you don't know this question, you can't even pass it!

The following questions are just part of the frequently asked interview questions I have compiled. In addition, I have collected more than 20 years of company interview knowledge points, as well as various Java core knowledge points for free to share with you. The following are just some screenshots if you want information. Yes: Click here to get it! ! ! Secret code CSDN.Insert picture description here

1. Data structure and algorithm foundation

1.· Talk about several common sorting algorithms and their respective complexity.
2. Write a bubble sort algorithm in Java
3. Describe the chain storage structure.
4.· How to traverse a binary tree?
5.· Invert a LinkedList.
6.· Write a recursive traversal of all files under the directory in Java.

Two, Java basics

1.· What is the difference between an interface and an abstract class?
2.· What are the types of exceptions in Java? How to use each?
3.· What are the commonly used collection classes? For example, how to sort List?
4. What is the general implementation of ArrayList and LinkedList? The difference between them and their advantages and disadvantages?
5.· What is the memory overflow? Please give an example?
6.· What is the difference between == and equals?
7.· What does the hashCode method do?
8.· What is NIO? What kind of scene is applicable?
9.· How to ensure the thread safety of HashMap?
10.· JVM memory structure, why do we need GC?
11.· NIO model, the difference between select/epoll, the principle of multiplexing
12.· How many bytes a character occupies in Java, expand and ask how many bytes int, long, double occupies
13.· Create a class What are the methods for examples?
14.· What is the difference between final/finally/finalize?
15.· What is the difference between Session/Cookie?
16.· The difference between String/StringBuffer/StringBuilder, how to extend it?
17.· Servlet life cycle?
18.· How to allocate a continuous 1G memory space with Java? What needs attention?
19.· Java has its own memory recovery mechanism, but why is there still a memory leak problem?
20.· What is java serialization and how to implement java serialization? (write an example)?
21.· String s = new String("abc"); How many String Objects have been created?

Three, JVM

1. The basic structure of the JVM heap.
2.· What are the junk algorithms of JVM? The basic process of CMS garbage collection?
3.· What are the common startup parameters of JVM that can be adjusted, and how many are described?
4.· How to check the memory usage of JVM?
5.· Will Java programs have memory overflow or memory leaks? Give a few examples.
6.· What are your commonly used JVM configuration and tuning parameters? What is the role of each?
7.· JVM memory structure?
8.· When will the commonly used GC strategy trigger YGC and when will it trigger FGC?

Four, multithreading/concurrency

1.· How to create a thread? How to ensure thread safety?
2.· How to implement a thread-safe data structure
3.· How to avoid deadlock
4.· The role of the Volatile keyword?
5.· What should I pay attention to when using HashMap in a multithreaded environment? why?
6.· Is run or start used to start a thread in a Java program?
7.· What is a daemon thread? What is the use?
8.· What is a deadlock? How to avoid
9.· What is the difference between threads and processes?
10.· How is Threadlocal implemented in Java?
11.· What is the realization principle of ConcurrentHashMap?
12.· The difference between sleep and wait
13.· The difference between notify and notifyAll
14.· The work of the volatile keyword
15.· The role and implementation of ThreadLocal
16.· How two threads execute serially
17.· What is the meaning of context switching
18. · Can a thread be killed at runtime?
19.· What are conditional locks, read-write locks, spin locks, and reentrant locks?
20.· How to realize the thread pool ThreadPoolExecutor?

Five, Linux use and problem analysis and troubleshooting

1.· Use two commands to create a file?
2.· What is the difference between hard link and soft link?
3.· What are the commonly used Linux commands?
4.· How to see the resource consumption of a Java thread?
5.· What are the possibilities for too high Load?
6.· What does the /etc/hosts file do?
7.· How to quickly replace all "abc" in a text with "xyz"?
8.· How to find the error log in the log file?
9.· I find that the disk space is not enough, how to quickly find the file that takes up the largest space?
10.· Java server-side troubleshooting (OOM, high CPU, high load, class conflict)
11.· Common Java troubleshooting tools and usage (top, iostat, vmstat, sar, tcpdump, jvisualvm, jmap, jconsole)
12.· How to analyze thread dump files (Runnable, lock, code stack, operating system thread ID correlation)
13.· How to view thread information of Java applications?

Six, frame use

1.· Describe the three states of Hibernate?
2. The life cycle of Bean in Spring.
3.· SpringMVC or Struts process request processing.
4.· What problem does Spring AOP solve? How did it happen?
5.· What is the propagation property of Spring transaction? What will it affect?
6.· What is the difference between BeanFactory and FactoryBean in Spring?
7.· What is the principle of IOC in Spring framework?
8.· What are the several ways of dependency injection in spring?
9.· Struts workflow
10.· How to implement an aspect with Spring?
11.· How does Spring implement database transactions?
12.· Hibernate's use of primary and secondary caches and Lazy-Load understanding;
13.· How does mybatis implement batch submission?

Seven, database related

1.· What are the characteristics of MySQL InnoDB and Mysaim?
2.· What is the difference between optimistic lock and pessimistic lock?
3.· What is the database isolation level? what's the effect?
4. The basic principle of MySQL master-slave synchronization.
5.· Select * from table t where size> 10 group by size order by size SQL statement execution order?
6.· How to optimize database performance (index, sub-database and table, batch operation, paging algorithm, upgrade hard disk SSD, business optimization, master-slave deployment)
7.· Under what circumstances will SQL not use indexes (not included, not equal to, Function)
8.· What field is generally indexed on (the field with the most filtered data)
9.· How to find all the rows whose name field does not contain "XYZ" from a table?
10.· MySQL, B+ index implementation, row lock implementation, SQL optimization
11.· Redis, RDB and AOF, how to make high availability and cluster
12.· How to solve the problem of high concurrency and inventory reduction
13.· Implementation of index in mysql storage engine Mechanism;
14. Several granularities of database transactions;
15. Row locks, table locks; optimistic locks, pessimistic locks

Eight, network protocol and network programming

1. The process of TCP establishing a connection.
2. The process of TCP disconnection.
3.· The logic behind the browser 302 jump?
4.· The interactive process of HTTP protocol. What is the difference between HTTP and HTTPS, and how does SSL interact?
5.· What is the relationship between Rest and Http? Everyone says that Rest is very lightweight, how do you understand the style of Rest?
6.· What is the use of TCP's sliding window protocol? Talk about the principle.
7.· What are the methods of HTTP protocol?
8.· What is the difference between a switch and a router?
9.· The basic process of Socket interaction?
10.· Protocol (message structure, resumable transmission, multi-threaded download, what is a long connection)
11.· tcp protocol (connection establishment process, slow start, sliding window, seven-layer model)
12.· webservice protocol (wsdl /soap format, the difference from rest protocol)
13.· The benefits of NIO, Netty thread model, what is zero copy

Nine, Redis and other caching systems/middleware/NoSQL/consistent Hash, etc.

1.· List a common concurrency model for Redis clients.
2.· How does HBase implement fuzzy query?
3.· Enumerate a commonly used message middleware, if the message is to be preserved, how to realize it?
4.· How to implement a Hashtable? How does your design consider Hash conflicts? How to optimize?
5.· Distributed cache, consistent hash
6.· LRU algorithm, slab allocation, how to reduce memory fragmentation
7.· How to solve the problem of single-machine cache hotspot
8.· What is bloom filter, and its implementation principle? What does false positive mean?
9.· The difference between memcache and redis
10.· What are the functions of zookeeper and how the election algorithm is performed
11.· The map/reduce process, how to use map/reduce to achieve joint statistics of two data sources

10. Design patterns and refactoring

1.· Can you give examples of a few common design patterns
2.· What principles will you follow when designing a factory package?
3.· Can you list an open source project/library that uses the Visitor/Decorator model?
4.· What are your most commonly used design patterns when coding? In what scenario is it used?
5.· How to implement a singleton?
6.· Proxy mode (dynamic proxy)
7.· Singleton mode (lazy man mode, evil man mode, how to solve concurrent initialization, the use of volatile and lock)
8.· What are the design patterns in the JDK source code that impress you Use, take an example?

Eleven: Microservices

1. What is a microservice?

2. How to communicate independently between microservices

3. What are the differences between springCloud and dubbo?

4. Springboot and springcloud, would you please talk about your understanding of them?

5. What is a microservice circuit breaker? What is service degradation?

6. What are the advantages and disadvantages of microservices? Talk about the pits you encountered in project development

7. What are the microservice technology stacks you know? Please list one or two

8. Both eureka and zookeeper can provide service registration and discovery functions, please tell us the difference between the two?

At last

There are 130 interview questions (microservices, high concurrency, big data, cache, etc. middleware) in the Java Senior Engineer Interview Collection. If you don't know this question, you can't even pass it! This is the end of the article.

Guess you like

Origin blog.csdn.net/a646705816/article/details/108718523