[Dachang Interview Questions Self-Test] What is your level? After answering these basic interview questions, the pass rate has increased by 80%!

Like and follow, you won’t get lost!   

Preface

Continuously update the quality content of Java learning interviews. Someone told me recently that when I look at a question, I can’t help but look at the answer. This time I have compiled a collection of some technical questions frequently asked in interviews by major companies, and it happens that you can also self-check. After these basic questions are answered, the pass rate will be higher!

text

The test begins. Are you ready?

28 concurrent programming questions

  1. Have you ever used Synchronized and what is its principle?

  2. You just mentioned acquiring a lock on an object. What exactly is this "lock"? How to determine the lock of an object?

  3. What is reentrancy, and why is Synchronized a reentrant lock?

  4. What optimizations does JVM make to Java's native locks?

  5. Why is Synchronized an unfair lock?

  6. What is lock elimination and lock coarsening?

  7. Why is Synchronized a pessimistic lock? What is the principle of optimistic locking? What is CAS and what are its characteristics?

  8. Is optimistic locking necessarily good?

  9. Compared with Synchronized, what is the difference in the implementation principle of ReentrantLock?

  10. So please talk about the AQS framework?

  11. Please compare the similarities and differences between Synchronized and ReentrantLock in as much detail as possible.

  12. How does ReentrantLock achieve reentrancy?

  13. Apart from ReetrantLock, what other concurrency tools in JUC have you been exposed to?

  14. Please talk about ReadWriteLock and StampedLock.

  15. How to synchronize the threads of Java with each other? Which synchronizers have you known? Please introduce them separately.

  16. CyclicBarrier and CountDownLatch look very similar, please compare?

  17. Java thread pool related issues

  18. How is the thread pool implemented in Java?

  19. Several core construction parameters for creating a thread pool?

  20. How are threads in the thread pool created? Was it created at the beginning with the thread pool started?

  21. 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

  22. How to submit threads in the Java thread pool?

  23. What is Java's memory model, and how do threads in Java see each other's variables?

  24. Please talk about the characteristics of volatile and why it can guarantee the visibility of variables to all threads?

  25. Since volatile can guarantee the visibility of variables between threads, does it mean that operations based on volatile variables are concurrently safe?

  26. Please compare the similarities and differences between volatile and Synchronized.

  27. Please talk about how ThreadLocal solves concurrency safety?

  28. Many people say that ThreadLocal should be used with caution. Talk about your understanding, what should be paid attention to when using ThreadLocal?

how about it? Are you sure about these basic questions? This time it won’t make it so easy for you to see the answer. Think about it for yourself first

 

 

JVM and tuning 21 questions

  1. Java class loading process?

  2. Describe the principle mechanism of JVM loading Class files?

  3. Java memory allocation.

  4. What is GC? Why is GC?

  5. Briefly describe the Java garbage collection mechanism

  6. How to judge whether an object is alive? (Or how to determine the GC object)

  7. The advantages and principles of garbage collection. And consider 2 recycling mechanisms

  8. 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?

  9. Will there be a memory leak in Java, please describe briefly

  10. Deep copy and shallow copy.

  11. What will System.gc() and Runtime.gc() do?

  12. When is the finalize() method called? What is the purpose of finalization?

  13. If the object's reference is set to null, will the garbage collector immediately release the memory occupied by the object?

  14. What is distributed garbage collection (DGC)? How does it work?

  15. What is the difference between a serial collector and a throughput collector?

  16. In Java, when can an object be garbage collected?

  17. Briefly describe the Java memory allocation and recovery strategy, Minor GC and Major GC.

  18. Will garbage collection occur in the permanent generation of the JVM?

  19. What are the methods of garbage collection in Java?

  20. What are class loaders and what are the class loaders?

  21. The class loader parent delegation model mechanism?

 

Redis 16 questions

  1. What is redis?

  2. Features of Reids

  3. Data types supported by Redis

  4. Redis is single-process and single-threaded

  5. Virtual Memory

  6. Redis lock

  7. Read-write separation model

  8. Data fragmentation model

  9. Redis recycling strategy

  10. What are the benefits of using Redis?

  11. What are the advantages of redis over memcached?

  12. Redis common performance problems and solutions

  13. There are 2000w data in MySQL, and only 20w data in redis. How to ensure that the data in redis is hot data

  14. What are the differences between Memcache and Redis?

  15. What are the common performance problems of Redis? How to solve?

  16. Redis is the most suitable scenario

 

 

Java collection 22 questions

  1. The difference between ArrayList and Vector.

  2. Talk about the storage performance and characteristics of ArrayList, Vector, LinkedList.

  3. What is the difference between fail-fast and fail-safe?

  4. The data structure of hashmap.

  5. How does HashMap work?

  6. When will Hashmap expand?

  7. What are the characteristics of the three interfaces of List, Map, and Set when accessing elements?

  8. The elements in the Set cannot be repeated, so what method is used to distinguish whether they are repeated or not? Is == or equals()? What is the difference between them?

  9. Two objects have the same value (x.equals(y) == true), but they can have different hash codes. Is this sentence correct?

  10. What is the difference between heap and stack.

  11. What are the basic interfaces of the Java collection framework?

  12. What is the difference between HashSet and TreeSet?

  13. What is the underlying implementation of HashSet?

  14. How does LinkedHashMap work?

  15. Why does the collection class not implement the Cloneable and Serializable interfaces?

  16. What is an iterator?

  17. What is the difference between Iterator and ListIterator?

  18. What is the difference between Array and ArrayList? When should I use Array instead of ArrayList?

  19. What are the best practices for the Java collection framework?

  20. 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?

  21. What are the Comparable and Comparator interfaces? List their differences

  22. The difference between Collection and Collections.

The way to get the answer is at the end of the article, read it after you finish it

 

spring 25 questions

  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 ways to configure Spring?

  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 are 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 autowiring of Spring Bean?

  17. Please explain the difference in auto-assembly mode?

  18. How to enable annotation-based automatic assembly?

  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 of @Qualifier annotation?

  22. What is the difference between constructor injection and setting 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

  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. Design an ATM machine, please tell me your design ideas?

  9. In Java, when do you use overloading and when do you use rewriting?

  10. Give examples to illustrate when you would prefer to use abstract classes instead of interfaces

 

 

springboot 22 questions

  1. What is Spring Boot?

  2. What are the advantages of Spring Boot?

  3. What is JavaConfig?

  4. How to reload changes on Spring Boot without restarting the server?

  5. What is the monitor in Spring Boot?

  6. How to disable Actuator endpoint security in Spring Boot?

  7. How to run Spring Boot applications on custom ports?

  8. What is YAML?

  9. How to realize the security of Spring Boot application?

  10. How to integrate Spring Boot and ActiveMQ?

  11. How to use Spring Boot to implement paging and sorting?

  12. What is Swagger? Have you implemented it with Spring Boot?

  13. What is Spring Profiles?

  14. What is Spring Batch?

  15. What is a FreeMarker template?

  16. How to use Spring Boot to implement exception handling?

  17. Which starter maven dependencies did you use?

  18. What is a CSRF attack?

  19. What is WebSockets?

  20. What is AOP?

  21. What is Apache Kafka?

  22. How do we monitor all Spring Boot microservices?

The above are the 22 SpringBoot questions frequently asked by the first-line Internet companies in the interview. The corresponding learning and review materials are attached at the end of the article.

 

Netty 10 questions

  1. What is the difference between BIO, NIO and AIO?

  2. What is the composition of NIO?

  3. The characteristics of Netty?

  4. Netty's threading model?

  5. The reason and solution of TCP sticking/unpacking?

  6. Which serialization protocols do you know?

  7. How to choose a serialization protocol?

  8. Netty's zero copy implementation?

  9. What are the high performance of Netty?

  10. NIOEventLoopGroup source code?

At last

That’s all for today’s Java basic questions interview questions. For the answer collection method, you can click on the ["Learning Together"] below (it is so easy for you to see the answer, what should you do directly?). There will be more different content in the follow-up, I hope it will be helpful to everyone.

Finally, I want to say something to you. I have worked for so many years and have interviewed some people for others. Whether it is from the perspective of the interviewer or the leader, in addition to interview skills and experience, great technology and project experience are also their trump cards and confidence. Core technology sharing of first-tier manufacturers

 It took me a long time to sort out some learning materials. What I posted above is the tip of the iceberg in the materials. I hope I can help you! Click to learn the secret code together: csdn

                         

  I will share more pure dry goods articles in the follow-up, and hope to really help you. Your support is my biggest motivation! Welcome to follow and like!

                                                       

In view of the above-mentioned technical points of the interviews frequently asked by major companies, I have specially compiled a set of corresponding Java interface pdf document review materials, which cover a wide range of content, and are especially suitable for some Java developers who are about to interview or are about to change jobs. To make up for leaks, readers and friends who need to obtain this set of documents can subscribe and follow me

 

 

Guess you like

Origin blog.csdn.net/weixin_50333534/article/details/109150279