I emptied the major search engines and compiled 146 Java interview questions for you. Remember to collect them when you are full of dry goods

Java collection 22 questions

This is a basic question in java, but don't underestimate these questions, some of them may not be answered. I find that more and more low-level questions are being asked recently. This is also a basic line. If you can’t answer it, it will be cold.

  • The difference between ArrayList and Vector.
  • Talk about the storage performance and characteristics of ArrayList, Vector, LinkedList.
  • What is the difference between fail-fast and fail-safe?
  • The data structure of hashmap.
  • How does HashMap work?
  • When will Hashmap expand?
  • What are the characteristics of the three interfaces of List, Map, and Set when accessing elements?
  • The elements in the Set cannot be repeated, so what method is used to distinguish whether they are repeated? Is == or equals()? What is the difference between them?
  • Two objects have the same value (x.equals(y) == true), but they can have different hash codes. Is this sentence correct?
  • What is the difference between heap and stack.
  • What are the basic interfaces of the Java collection framework?
  • What is the difference between HashSet and TreeSet?
  • What is the underlying implementation of HashSet?
  • How does LinkedHashMap work?
  • Why does the collection class not implement the Cloneable and Serializable interfaces?
  • What is an iterator?
  • What is the difference between Iterator and ListIterator?
  • What is the difference between Array and ArrayList? When should I use Array instead of ArrayList?
  • What are the best practices for the Java collection framework?
  • The elements in a set cannot be repeated, so what method is used to distinguish whether they are repeated or not? Should I use == or equals()? What is the difference between them?
  • What are the Comparable and Comparator interfaces? List their differences
  • The difference between Collection and Collections.

 

JVM and tuning 21 questions

JVM is a must-have knowledge point when you go to a big factory. Performance tuning issues, garbage collection mechanisms, parent delegation, and architecture. The more you get, the more points you get.

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

 

  • Java class loading process?
  • Describe the principle mechanism of JVM loading Class files?
  • Java memory allocation.
  • What is GC? Why is GC?
  • Briefly describe the Java garbage collection mechanism
  • How to judge whether an object is alive? (Or how to determine the GC object)
  • The advantages and principles of garbage collection. And consider 2 recycling mechanisms
  • What is the basic principle of the garbage collector? Can the garbage collector reclaim memory immediately? Is there any way to proactively notify the virtual machine for garbage collection?
  • Will there be a memory leak in Java, please describe briefly
  • Deep copy and shallow copy.
  • What will System.gc() and Runtime.gc() do?
  • When is the finalize() method called? What is the purpose of finalization?
  • If the object reference is set to null, will the garbage collector immediately release the memory occupied by the object?
  • What is the difference between a serial collector and a throughput collector?
  • In Java, when can an object be garbage collected?
  • Briefly describe Java memory allocation and recovery strategies, Minor GC and Major GC.
  • Will garbage collection occur in the permanent generation of the VM?
  • What are the methods of garbage collection in Java?
  • What are class loaders and what are the class loaders?
  • The class loader parent delegation model mechanism?

28 concurrent programming questions

Concurrency is the key point. I remember an interview about concurrency. The interviewer slammed me for half an hour. The arrangement from the lock mechanism to the thread pool was clear.

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

 

  • Have you used Synchronized and what is its principle?
  • You just mentioned acquiring a lock on an object. What exactly is this "lock"? How to determine the lock of an object?
  • What is reentrancy, and why is Synchronized a reentrant lock?
  • What optimizations has VM made to Java's native locks? 48
  • Why is Synchronized an unfair lock? 49
  • What is lock elimination and lock coarsening? 49
  • Why is Synchronized a pessimistic lock? What is the principle of optimistic locking? What is CAS and what are its characteristics?
  • Is optimistic locking necessarily good?
  • Compared with Synchronized, what is the difference in the implementation principle of ReentrantLock?
  • So please talk about the AQS framework?
  • Please compare the similarities and differences between Synchronized and ReentrantLock in as much detail as possible.
  • How does ReentrantLock achieve reentrancy?
  • Apart from ReetrantLock, what other concurrency tools in JUC have you been exposed to?
  • Please talk about ReadWriteLock and StampedLock.
  • How to synchronize Java threads with each other? Which synchronizers have you known? Please introduce them separately.
  • CyclicBarrier and CountDownLatch look very similar, please compare?
  • Java thread pool related issues
  • How is the thread pool implemented in Java?
  • Several core construction parameters for creating a thread pool?
  • How are threads in the thread pool created? Was it created at the beginning with the start of the thread pool?
  • Since it is mentioned that different thread pools can be created by configuring different parameters, what thread pools are implemented by default in Java? Please compare their similarities and differences
  • How to submit threads in the Java thread pool?
  • What is Java's memory model, and how do threads in Java see each other's variables?
  • Please talk about the characteristics of volatile and why it can guarantee the visibility of variables to all threads?
  • Since volatile can guarantee the visibility of variables between threads, does it mean that operations based on volatile variables are concurrently safe?
  • Please compare the similarities and differences between volatile and Synchronized.
  • Please talk about how ThreadLocal solves concurrency safety?
  • Many people say that ThreadLocal should be used with caution. Talk about your understanding, what should be paid attention to when using ThreadLocal?

spring 25 questions

I believe everyone has used Spring. As an open source framework, its importance is undoubtedly. IOC and AOP are the two essential cores, from annotations to tags.

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

 

  • 1. What is the Spring framework? What are the main modules of the Spring framework?
  • 2. What are the benefits of using the Spring framework?
  • 3. What is Inversion of Control (IOC)? What is dependency injection?
  • 4. Please explain the IoC in the Spring framework?
  • 5. What is the difference between BeanFactory and ApplicationContext?
  • 6. How many configuration methods does Spring have?
  • 7. How to configure Spring based on XML configuration?
  • 8. How to configure Spring based on Java configuration?
  • 9. How to configure Spring with annotations?
  • 10. Please explain the life cycle of Spring Bean?
  • 11. What is the difference between the scope of Spring Bean?
  • 12. What is Spring inner beans?
  • 13. Are singleton beans in the Spring framework thread-safe?
  • 14. Please give an example of how to inject a Java Collection in Spring?
  • 15. How to inject a Java.util.Properties into Spring Bean?
  • 16. Please explain the automatic assembly of Spring Bean?
  • 17. Please explain the difference in automatic assembly mode?
  • 18. How to turn on automatic assembly based on annotations?
  • 19. Please give an example to explain the @Required annotation?
  • 20. Please give an example to explain the @Autowired annotation?
  • 21. Please give an example to illustrate the @Qualifier annotation?
  • 22. What is the difference between construction method injection and set value injection?
  • 23. What are the different types of events in the Spring framework?
  • 24. What is the difference between FileSystemResource and ClassPathResource?
  • 25. What design patterns are used in the Spring framework?

10 design patterns

I remember the most clearly the lazy and hungry modes of the singleton mode. The direction of this investigation is generally fixed. Of course, it does not rule out the problems encountered by the interviewer during the inspection and notification work (this is the case for students, and you will not be crazy if you work. Ask applicants, feel sorry for the interviewer).

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

 

  • 1. Please list several commonly used design patterns in JDK?
  • 2. What is a design pattern? Have you used any design patterns in your code?
  • 3. What is the singleton design pattern in Java? Please write a thread-safe singleton pattern in Java
  • 4. In Java, what is the observer design pattern (observer design pattern)?
  • 5. What are the main benefits of using the factory model? Where is it used?
  • 6. Give a decorator design pattern implemented in Java? Does it act on the object level or the class
    level?
  • 7. In Java, why is it not allowed to access non-static variables from static methods?
  • 8. To design an ATM machine, please tell us your design ideas?
  • 9. In Java, when do you use overloading and when do you use rewriting?
  • 10. Give examples of situations where you would prefer to use abstract classes instead of interfaces

springboot 22 questions

Recently, springboot and springcloud account for more and more weight, because they are the most popular among small and medium-sized enterprises, and they are the lowest even if they learn to starve.

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

 

  • What is Spring Boot?
  • What are the advantages of Spring Boot?
  • What is JavaConfig?
  • How to reload changes on Spring Boot without restarting the server?
  • What is the monitor in Spring Boot?
  • How to disable Actuator endpoint security in Spring Boot?
  • How to run Spring Boot applications on custom ports?
  • What is YAML?
  • How to realize the security of Spring Boot application?
  • How to integrate Spring Boot and ActiveMQ?
  • How to use Spring Boot to implement paging and sorting?
  • What is Swagger? Have you implemented it with Spring Boot?
  • What is Spring Profiles?
  • What is Spring Batch?
  • What is a FreeMarker template?
  • How to use Spring Boot to implement exception handling?
  • Which starter maven dependencies did you use?
  • What is a CSRF attack?
  • What is WebSockets?
  • What is AOP?
  • What is Apache Kafka?
  • How do we monitor all Spring Boot microservices?

Netty 10 questions

There are not many interviews, which is considered a bonus item, not many beeps, pass

  • What is the difference between BIO, NIO and AIO?
  • What is the composition of NIO?
  • The characteristics of Netty?
  • Netty's threading model?
  • The reasons and solutions for TCP sticking/unpacking?
  • Which serialization protocols do you know?
  • How to choose a serialization protocol?
  • Netty's zero copy implementation?
  • What are the performance aspects of Netty?
  • NIOEventLoopGroup source code?

Redis 8 questions

Redis's data characteristics and recycling strategies are an important part, and its advantages and usage scenarios need to be understood

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

 

  • What is redis?
  • Features of Reids
  • Data types supported by Redis
  • Redis is single-process and single-threaded
  • Virtual Memory
  • Redis lock
  • Read-write separation model
  • Data fragmentation model

So far, I have compiled the interview questions, I hope it will be useful to you. If you want the answer to the information, you can "add my assistant VX to collect it yourself", or check the comments to collect it yourself. Riding the wind and the waves, the future is promising. I wish everyone a satisfactory offer. If you feel that the writing is good, please like to collect and comment. Thank you, dear audience!

I emptied the major search engines and compiled 154 Java dry goods interview questions for you

Guess you like

Origin blog.csdn.net/a159357445566/article/details/108651054