preface
2021 autumn recruit is coming, many students will ask Java interview essay is necessary to back?
My answer is: yes. You can hate this mode, but you have to carry it, because if you don’t carry it, you can’t enter the big factory.
The Internet interview system in China is probably the closest existing system to the imperial examination.
Moreover, The Eight-part essay of our country is really unique. In the U.S., for example, Coding is more important in engineering interviews. In recent years, Design rounds (System Design and object Oriented Design) and Behavioral questions (BQ) have been added.
So why domestic interviews do not take such a way of investigation? To put IT simply, there are too many job seekers in the Internet IT industry. If the investigation is a series of algorithm questions and design questions, IT will require the interviewer to have a very high technical level, and also spend a lot of time, cost and energy.
Perhaps the current eight-part interview is not the best solution, but IT is indeed the most consistent with the current domestic IT environment.
Therefore, AFTER interviewing more than 20 senior factory interviewers, I have been trying to refine and accurately sort out a set of feasible eight-part essay. Now 329 fans have entered ideal positions through this set of questions, so I would like to share with you, welcome to comment on any shortcomings.
Limited space in this article will only post the topic, students can have a look at what questions will be, the answer is arranged in a “Java interview essay” PDF, if you need to directly click to obtain.
First, Java foundation 44
1. Explain what object orientation is. What’s the difference between object-oriented and procedural?
2. Three features of Object orientation? Explain them separately?
3. The relationship between JDK, JRE, and JVM?
4. What is the difference between overloading and overwriting?
5. Can I override a private or static method in Java?
6. What are the characteristics of constructors?
7. What is the use of defining a constructor in Java that does nothing and takes no arguments?
8. How many ways to create objects in Java?
9. What is the difference between abstract classes and interfaces?
10. What are the differences between static variables and instance variables?
11. Short s1 = 1; S1 = s1 + 1; What’s wrong with that? So short s1 = 1; S1 + = 1; ? Are there any mistakes?
12. What is the difference between Integer and int?
13. The difference between packing and unpacking
14. Can switch statements work on byte, long, and String?
15. 16. Differences between final, finally and Finalize
16. What is the difference between == and equals?
17. If two objects have the same hashCode(), equals() must also be true?
18. Why does overwriting equals() require overwriting hashCode()?
19. The difference between & and &&?
20. What about passing values when passing parameters in Java? Or quote?
21. What is math.round (-1.5) in Java?
22. How to implement object cloning?
23. The difference between deep clone and shallow clone?
24. What is Java serialization and how is it implemented?
25. When is serialization needed?
26. How do Generics in Java work? What is type erasure?
27. What are qualified and unqualified wildcards in generics?
What’s the difference between List and List?
29. What does reflection mean in Java? What are the application scenarios?
30. Pros and cons of reflection?
31. What is dynamic proxy in Java? What are the applications?
32. How to implement dynamic proxy?
33. What does the static keyword do?
34. What does the super keyword do?
35. What is the difference between bytes and characters?
36. Why is String designed to be immutable?
37. What is the difference between String, StringBuilder, and StringBuffer?
38. String String modification implementation principle?
39. Is String STR = “I” the same as String STR = new String(” I “)?
What are the common methods of the String class?
41. Can we append a StringBuffer after final modification?
Class of IO streams in Java? Name some implementation classes that you are familiar with?
What is the difference between a byte stream and a character stream?
44. What is the difference between BIO, NIO and AIO?
2. 9 Java exceptions
When is the code in the 1.finally block executed?
2. Does finally have to be executed?
3. In try-catch-finally, if a catch returns, will finally be executed?
4. Which part of the try-catch-finally can be omitted?
5. What is the difference between Error and Exception?
6. What are the similarities and differences between runtime exceptions and checked exceptions?
Throw throws
8. What are the common exception classes?
9. Can the main thread catch exceptions from child threads?
Java set 24 channels
1. Which containers are commonly used in Java?
2. The difference between ArrayList and LinkedList?
3. ArrayList implements RandomAccess. Why doesn’t LinkedList implement this interface?
4. Expansion mechanism of ArrayList?
5. What’s the difference between Array and ArrayList? When is it better to use Array?
6. The implementation principle/underlying data structure of HashMap? JDK1.7 and JDK1.8
7. How to execute the put method of HashMap?
8. How to execute the HashMap get method?
9. How to execute the resize method of HashMap?
10. Why must the size of a HashMap be an integer power of 2?
11. HashMap multithreaded loop problem?
12. Can the get method of a HashMap determine whether an element is in the map?
13. What is the difference between HashMap and HashTable?
14. What is the difference between HashMap and ConcurrentHashMap?
15. What is the difference between HashTable and ConcurrentHashMap?
16. What is the implementation principle of ConcurrentHashMap?
17. How does HashSet work?
18. How does a HashSet guarantee that elements are not repeated?
19. How does LinkedHashMap work?
20. How to use Iterator? What are the characteristics?
21. What is the difference between Iterator and ListIterator?
22. What are the differences between Iterator and Enumeration interfaces?
23. What is the difference between fail-fast and fail-safe?
24. What’s the difference between Collections and Collections?
Java concurrency 42
1. What is the difference between parallelism and concurrency?
2. What is the difference between threads and processes?
3. What is a daemon thread?
4. How many ways to create a thread?
5. What’s the difference between Runnable and Callable?
6. Thread states and transitions?
What is the difference between sleep() and wait()?
8. What is the difference between run() and start() for a thread?
9. How to ensure the safety of multithreading in Java procedures?
10. How many ways to synchronize Java threads?
11. How does the thread.interrupt () method work?
12. What do you understand about ThreadLocal?
13. In what scenarios will ThreadLocal be used?
14. Talk about what you know about synchronized.
15. How do you use synchronized in your project?
16. Talk about the underlying optimization of synchronized keyword after JDK1.6, can you introduce these optimization in detail?
17. What is the difference between synchronized and ReenTrantLock?
18. What is the difference between synchronized and volatile?
19. What is your understanding of the volatile keyword?
20. What do you understand about ReentrantReadWriteLock?
21. What is the understanding of pessimistic lock and optimistic lock?
22. What are the two common implementations of optimistic locking?
23. What are the disadvantages of optimistic locking?
24. CAS and synchronized?
25. What is your understanding of atomic classes in Java?
26. What is the principle of atomic?
27. What is your understanding of synchronizer AQS?
28. What is the principle of AQS?
29. What are the resource sharing modes of AQS?
30. AQS uses the template method pattern. Can you name some methods that need to be rewritten?
31. What is your understanding of Semaphore?
32. What is the difference between CountDownLatch and CyclicBarrier?
33. What do you understand about thread pools? Why use thread pools?
34. What are the parameters for creating a thread pool?
35. How do I create a thread pool?
36. How to set the number of threads in the thread pool? What issues need to be considered?
37. What is the difference between the execute() and submit() methods?
38. What is your understanding of Fork and Join parallel computing framework?
39. What concurrent containers are provided in the JDK?
40. What do you understand about CopyOnWriteArrayList?
41. What do you understand about BlockingQueue? What are the implementation classes?
What do you understand about ConcurrentSkipListMap?
Java JVM 42 tracks
1. What are the main components of the Jvm? And its role?
2. What is your understanding of the runtime data area?
3. What is the difference between heap and stack?
4. What is stored in the heap? What’s in the stack?
5. Why distinguish heap from stack? Isn’t it possible to store data on a stack?
6. What about passing values when passing parameters in Java? Or quote?
7. How is the size of a Java object calculated?
8. Two ways to access and locate objects?
9. What are the ways to determine whether garbage can be recycled?
10. Where does garbage collection start?
11. Are objects marked as garbage always recycled?
12. What do you know about Java references?
13. What is your understanding of memory leaks?
14. What is the root cause of memory leaks?
15. What are some possible memory leaks?
16. How to avoid memory leaks as much as possible?
17. What are the common garbage collection algorithms?
18. Why is generational collection algorithm adopted?
19. What garbage collection algorithms should be adopted for the younger and older generations under generational collection?
20. What is floating garbage?
21. What is memory fragmentation? How to solve it?
22. What are the common garbage collectors?
23. What is your understanding of the CMS garbage collector?
24. What is your understanding of the G1 collector?
25. What is your understanding of garbage collection strategy/garbage collection timing?
26. What is your understanding of memory allocation? How are large objects allocated? Space allocation guarantee?
27. Tell me about a JVM monitoring tool you have used.
28. How to tune using monitoring tools?
29. Some JVM parameters?
30. What is your understanding of class file structure? What are the components?
31. What do you know about class loading?
32. What are the functions of each phase of class loading?
33. What class loaders are available? What are the roles of the two?
34. The relationship between classes and classloaders?
35. What is your understanding of the parental delegation model? Work process? Why use it
36. How to implement a custom class loader? What should I pay attention to?
37. How to break the parental delegation model?
38. Are there any practical scenarios where the parental delegation model needs to be broken?
39. What do you understand about compile-time optimization and runtime optimization?
40. Why does the HotSpot VIRTUAL machine use an interpreter and compiler architecture?
41. What is your understanding of the Java memory model?
42. What are the memory interactions? What rules need to be met?
6. 37 SSM frameworks
1. What are the benefits of using the Spring framework?
2. Explain what AOP is?
3. What are the ways of AOP proxying?
4. How to implement JDK dynamic proxy?
5. AOP’s basic concepts: aspects, join points, pointcuts, etc.
6. What types of Advice are there?
7. What is your understanding of IOC?
8. Bean life cycle?
9. Bean scope?
10. Do you understand the thread-safety issues of singleton beans in Spring?
11. What is your understanding of things in Spring?
12. Transaction isolation level in Spring?
13. Do things spread in Spring?
14. What are the common injection methods in Spring?
15. What design patterns are used in the Spring framework?
16. What are the common implementations of ApplicationContext?
17. What is your understanding of the MVC pattern?
18. How does SpringMVC work/execution flow?
19. What are the core components of SpringMVC?
20. What are the common annotations used by SpringMVC?
21. What does @requestMapping do?
22. How to solve the problem of Chinese garbled characters in POST request and how to handle GET request?
23. Is SpringMVC’s controller a singleton? If so, what are the problems?
24. How does SpringMVC set redirection and forwarding?
25. How is the interceptor written in SpringMVC?
26. What are the differences between SpringMVC and Struts2?
27. What is your understanding of MyBatis?
28. What are the advantages and disadvantages of MyBaits?
29. What are the differences between MyBatis and Hibernate?
What is the difference between #{} and ${} in MyBatis?
31. How does MyBatis paginate? How does paging plug-ins work?
32. How many pagination methods does MyBatis have?
33. What is the difference between logical paging and physical paging in MyBatis?
34. Does MyBatis support lazy loading? If so, how does it work?
What about MyBatis level 1 cache and level 2 cache?
36. What executors do Mybatis have?
What does MyBatis dynamic SQL do? What is the dynamic SQL? Can you briefly explain how dynamic SQL is executed?
The answers are available in a PDF of Java Interview Essay I compiled. If necessary, you can click on it directly.
MySQL > select * from ‘MySQL’
1. What do you know about MySQL architecture?
2. The execution process of an SQL statement in the database framework?
3. What are the three paradigms of database?
4. What is the difference between char and varchar?
5. The difference between varchar(10) and varchar(20)?
6. What is your understanding of the index?
7. What data structure is used at the bottom of the index?
8. What is your understanding of B+ trees?
9. Why InnoDB storage engine uses B+ tree instead of B tree?
10. What is your understanding of clustering index?
11. What is your understanding of hash indexes?
12. What do you know about overwriting indexes?
13. Classification of indexes?
14. What is your understanding of the left-most prefix principle?
15. How do I know if the index I created is used? Or how do I know why this statement is running slowly?
16. When does an index fail? That is, the query does not walk the index?
17. Query performance optimization method?
18. How does InnoDB compare with MyISAM?
19. What is your understanding of horizontal and vertical shards?
20. Which three threads are involved in master-slave replication?
21. The reason for the delay of master/slave synchronization and the solution?
22. Tell me about your understanding of database read-write separation.
23. Can you describe the characteristics of transactions?
24. What is your understanding of the transaction isolation level?
25. Explain dirty reading, unrepeatable reading, and magic reading.
What is the default isolation level for MySQL?
27. What do you know about MVCC?
MySQL > alter table lock ();
29. What are the locking algorithms of InnoDB storage engine?
30. What are the methods used to troubleshoot MySQL problems?
MySQL database CPU up to 500%
Eight, Redis 12
1. What do you know about Redis?
2. What are the general usage scenarios of Redis?
3. What are the common functions of Redis?
4. What data types are supported by Redis?
5. Why is Redis so fast?
6. What is cache penetration? How to solve it?
7. What is cache avalanche? How to solve it?
8. How to ensure the consistency of cache and database data?
9. How many ways can Redis persist?
10. How does Redis implement distributed lock?
11. What are the Redis elimination strategies?
12. Redis Common performance issues and solutions?
Nine, computer network 45 channels
1. Why three handshakes? Not twice?
2. Why do you need four waves? Three times?
3. What are the differences between TCP and UDP? Application scenarios?
4. HTTP1.0, 1.1, 2.0 version differences
5. What are the differences between POST and GET? Application scenarios?
6. What are the common status codes and usage scenarios of HTTP?
7. What are the differences between HTTP status codes 301 and 302?
8. In the process of interaction, what should I do if I do not want to disconnect the connection after data transmission? How to maintain the connection?
9. How does HTTP implement long connections? At what time does it run out?
10. How does TCP ensure effective transmission and congestion control principle
11. What are the types of IP addresses?
12. Significance of URL encoding in GET requests
13. What is SQL injection? What’s an example?
14. What about XSS attacks, for example?
15. What are the responsibilities of each layer of the network model?
16. A brief description of the difference between HTTPS and HTTP
17. The difference between symmetric and asymmetric encryption
18. What are the network protocols corresponding to each layer?
19. How does ARP work?
20. What are the main features of TCP?
21. What are the main features of UDP?
22. What are the common application-layer protocols corresponding to TCP and UDP?
23. Why do time-wait states have to WAIT 2MSL?
24. The function of the keepalive timer?
25. How does TCP ensure reliable transmission?
26. What is your understanding of the agreement to stop waiting?
27. What is your understanding of ARQ agreement?
28. What do you know about sliding Windows?
29. What is your understanding of flow control?
What is your understanding of TCP congestion control? What algorithms are used?
31. What is sticky bag?
32. How is TCP sticky packet generated?
33. How to solve the problem of unpacking and sticking bags?
34. What’s the difference between forward and redirect?
35. What are the HTTP methods?
36. How to enter the URL in the browser to display the home page?
37. DNS resolution process?
38. What do you know about domain name caching?
39. What is your understanding of HTTP long and short connections? Which scenarios do they apply to?
40. How does HTTPS work?
41. What is the difference between HTTP and HTTPS?
42. Advantages and disadvantages of HTTPS?
43. What is a digital signature?
44. What is a digital certificate?
45. What is the difference between cookies and sessions?
X. Operating system 32 channels
1. What is your understanding of concurrency and parallelism?
2. Concepts of synchronous, asynchronous, blocking, and non-blocking
3. Basic concepts of processes and threads
4. What is the difference between a process and a thread?
5. Why are there threads when there are processes?
6. Process status conversion
7. What are the communication methods between processes?
8. What are the scheduling algorithms for the process?
9. What is a deadlock?
10. What is the cause of deadlocks?
11. What are the necessary conditions for deadlock?
12. Basic methods to resolve deadlocks?
13. How to prevent deadlocks?
14. How do I avoid deadlocks?
15. How do I unlock a deadlock?
16. What is a buffer overflow? What’s the harm?
17. What is the difference between pagination and segmentation?
18. Concepts of physical address, logical address, and virtual memory
19. What are the page replacement algorithms?
20. What is your understanding of dynamic and static linked libraries?
21. What is the difference between an external interrupt and an exception?
22. How much can you tell about the complete process of a program from start to finish?
23. What are user-mode and kernel-mode
24. How to switch between user mode and kernel mode?
25. How the process terminates
Daemons, zombie processes, and orphan processes
27. How to avoid zombie processes?
28. What are some typical locks?
29. Common memory allocation errors
30. In memory swapping, where is the swapped process stored?
31. How are atomic operations implemented
32. Do you know what jitter is? It’s also called the bump phenomenon
Message queue and distributed 26 channels
1. What are the basic functions of message queues?
2. What are the advantages and disadvantages of message queues?
3. How to ensure high availability of message queues?
4. How to ensure that messages are not reused? In other words, how can message consumption be idempotent?
5. How to ensure reliable transmission of messages? In other words, how do you handle message loss?
6. How to ensure the order of messages?
7. A large number of messages are backlogged in MQ for a long time. How can I resolve this problem?
8. What if messages in MQ are out of date?
9. What are the important roles of RabbitMQ?
10. What are the important components of RabbitMQ?
11. How many broadcast types are available for RabbitMQ?
12. Can Kafka be used independently of ZooKeeper? Why is that?
13. How many data retention strategies does Kafka have?
14. What are Kafka’s partitioning policies?
15. What do you know about Zookeeper?
16. What functions does Zookeeper provide?
17. Tell us what you know about ZAB agreement.
18. How does Zookeeper synchronize the status of the primary and secondary nodes?
19. How many deployment modes are available for Zookeeper?
20. What is the notification mechanism of Zookeeper?
21. Why do you need a primary node in a cluster?
22. There are three servers in the cluster and one node is down. Can Zookeeper still be used?
23. What is the two-phase commit and three-phase commit process? What are the problems?
24. What can I do if Zookeeper breaks down?
25. What are the four types of data nodes?
26. The relationship between Zookeeper and Dubbo?
Well, that’s all for this article, and I’ve compiled the answers to all of the above questions in PDF
The answer I sorted out a “Java interview essay” PDF are available, if you need to directly click to obtain.