preface

Two months will soon enter December, however, in the face of this year’s environment, the difficulty of job-hopping success is much higher than in previous years, obviously feeling is: for this year’s Java developer friend job-hopping interview, no matter one or two interviews, are beginning to test the technical skills and foundation of a Java programmer. Understanding the source code interpretation and core principles is also a plus, especially for some core basic knowledge of Java is not enough or no system direction of the friend interview has become a distressed thing.

Today in this share the current domestic company Java interview often asked questions including JVM, commonly used algorithms and data structures, Redis cache, distributed, Spring, micro services and so on. Is the so-called know yourself and know your enemy, only the system of knowledge consolidation, in the face of constantly updated technology to quickly master, at the same time in the interview, work can also stand out!

Due to the lack of space, I will not show all the answers here. I have sorted these questions into PDF files and shared them with those friends who need them for free. Meanwhile, it took a lot of time to sort them out

 

300 Frequently asked Java Architecture Interview Questions

Java set 22

  1. Difference between an ArrayList and a Vector.
  2. Talk about storage performance and features for ArrayList,Vector, and LinkedList.
  3. What is the difference between fail-fast and fail-safe?
  4. The data structure of the HashMap.
  5. How does HashMap work?
  6. When will Hashmap be expanded?
  7. What are the features of the List, Map, and Set interfaces when accessing elements?
  8. Elements in a Set cannot be repeated, so what is the way to distinguish between repeated and not? Equals == or equals()? What’s the difference?
  9. Two objects with the same value (x.equals(y) == true) can have different hash codes.
  10. What’s the difference between heap and stack?
  11. What are the basic interfaces of the Java Collection Class framework?
  12. What’s the difference between HashSet and TreeSet?
  13. What is the underlying implementation of HashSet?
  14. How does LinkedHashMap work?
  15. Why do collection classes not implement Cloneable and Serializable interfaces?
  16. What is an Iterator?
  17. What is the difference between Iterator and ListIterator?
  18. What’s the difference between an Array and an ArrayList? When should you use Array instead of ArrayList?
  19. What are the best practices for Java collection class frameworks?
  20. Elements in a Set cannot be repeated, so what is the way to distinguish between repeated and not? Equals == or equals()? What’s the difference?
  21. What are the Comparable and Comparator interfaces for? List the differences
  22. The difference between Collections and Collections.

JVM and tuning 21

  1. Java class loading process?
  2. Describe how the JVM loads Class files.
  3. Java memory allocation.
  4. What is GC? Why GC?
  5. Describe the Java garbage collection mechanism
  6. How do you tell if an object is alive? (or GC object determination method)
  7. Advantages and principles of garbage collection. Two recycling mechanisms are considered
  8. What is the rationale behind the garbage collector? Can the garbage collector reclaim memory right away? Is there any way to proactively notify the virtual machine for garbage collection?
  9. Is there a memory leak in Java? Please describe it briefly
  10. Deep copy and shallow copy.
  11. What do system.gc () and Runtime.gc() do?
  12. When is the Finalize () method called? What is the purpose of finalization?
  13. If a reference to an object is set to NULL, does the garbage collector immediately free 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. When can objects be garbage collected in Java?
  17. Briefly describe the Java memory allocation and reclamation policy and the Minor and Major GC.
  18. Does garbage collection occur in JVM permanent generations?
  19. What are the methods of garbage collection in Java?
  20. What is a class loader, and what are class loaders?
  21. Class loader parent delegate model mechanism?

Concurrent programming 28 problems

  1. Has Synchronized ever been used? What’s the mechanism?
  2. You mentioned a lock on an object. What exactly is this “lock”? How do I determine the lock of an object?
  3. What is reentrant and why is Synchronized reentrant?
  4. What optimization has the JVM made to Java’s native locking? 48
  5. Why is Synchronized unfair? 49
  6. What is lock elimination and lock coarsening? 49
  7. Why is Synchronized a pessimistic lock? What is the implementation principle of optimistic lock? What is CAS and what are its features?
  8. Is optimism lock necessarily good?
  9. How is the implementation principle of ReentrantLock different from Synchronized?
  10. So what is the AQS framework?
  11. Compare Synchronized and ReentrantLock in as much detail as possible.
  12. How does ReentrantLock achieve reentrancy?
  13. Besides ReetrantLock, what other concurrency tools in JUC have you been exposed to?
  14. Talk about ReadWriteLock and StampedLock.
  15. How do I synchronize Java threads with each other? What synchronizers have you learned about? Please introduce them separately.
  16. CyclicBarrier and CountDownLatch look very similar.
  17. Java thread pool related issues
  18. How is thread pooling implemented in Java?
  19. How many core construction parameters to create a thread pool?
  20. How are threads created in a thread pool? Was it created initially with the start of the thread pool?
  21. Since you can create different thread pools by configuring different parameters, what are the default thread pools implemented in Java? Please compare their similarities and differences
  22. How do I submit a thread in a Java thread pool?
  23. What is the Java memory model, and how do threads in Java see each other’s variables?
  24. Talk about what is special about volatile, and why it makes variables visible to all threads?
  25. Since volatile guarantees variable visibility between threads, does that mean that operations based on volatile variables are concurrency safe?
  26. Compare volatile to Synchronized.
  27. How does ThreadLocal address concurrency security?
  28. When using ThreadLocal, you need to be careful.

Spring25 topic

 

Microservices 58 (SpringBoot,SpringCloud, Dubbo)

 

 

Netty10 topic

  1. What is the difference between BIO, NIO and AIO?
  2. What is NIO made of?
  3. The Netty thing?
  4. Netty’s threading model?
  5. What is the cause and solution of TCP packet Sticking/unpacking?
  6. What serialization protocols do you know?
  7. How do I choose a serialization protocol?
  8. Zero copy implementation of Netty?
  9. What is Netty’s high performance?
  10. NIOEventLoopGroup source?

network

  1. Network layer 7 architecture
  2. Principle of TCP/IP
  3. TCP three handshakes/four waves
  4. Principle of HTTP
  5. Transfer process
  6. HTTP status
  7. Principle of CDN

Redis

  1. What is redis?
  2. The characteristics of the Reids
  3. Data types supported by Redis
  4. Redis is single-process, single-thread
  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 advantages does Redis have over memcached? 4
  12. Redis Common performance problems and solutions
  13. MySQL has 2000W data, redis only 20W data, how to ensure that redis data is hot data
  14. What are the differences between Memcache and Redis?
  15. What are the common performance issues with Redis? How to solve it?
  16. Redis is the most suitable scenario

Zookeeper, Kafka

 

Due to space reasons, I will not show all the questions here. I have sorted out these questions into PDF files and shared them with those friends who need them for free. At the same time, sorting also took a lot of time.

All table of contents and answers are displayed, and the data structure is sorted out separately

 

The reader’s welfare

If you read this, you can also send me a free copy of the Java core knowledge system document and more advanced Jav knowledge notes and videos.

Information free access: forward + forward + forward attention, sa can be free access!

Important things three times, forward + forward + forward!

 

Share more Notes