preface

Interview: If you don’t prepare for an interview, it’s a waste of time and irresponsible of yourself.

Today to share with you my BATJava architecture interview topics and answers, most of which are often asked by large enterprises interview questions, can compare this check to fill in the gaps, of course, here is certainly not possible to cover all the way, but also hope to be looking for a job of friends to play some help! In this due to a lot of text, I summarized the Java interview involves the scope of frequently asked questions and the framework of the interview topics and answers and the framework of the video material free to share with you, the end of the article has received!

The interview questions and categories are as follows (answers are available at the end of the essay) :

Concurrent programming:

  1. What are multithreaded concurrency and parallelism?
  2. What are thread safety issues?
  3. What are memory visibility issues for shared variables?
  4. What are atomic operations in Java?
  5. What are CAS operations in Java and how does AtomicLong work?
  6. What is Java instruction reorder?
  7. What are the memory semantics of the Synchronized keyword in Java?
  8. What are the memory semantics of the Volatile keyword in Java?
  9. What is pseudo-sharing, why does it happen, and how can it be avoided?
  10. What are reentrant locks, optimistic locks, pessimistic locks, fair locks, unfair locks, exclusive locks, shared locks?
  11. How does ThreadLocal work?
  12. How does ThreadLocal work internally as a thread-isolation method for variables?
  13. What is the implementation of InheritableThreadLocal?
  14. How does InheritableThreadLocal compensate for ThreadLocal not supporting inheritance?
  15. How is the implementation inside CyclicBarrier different from CountDownLatch?
  16. How does the Random number generator class use CAS algorithm to ensure the uniqueness of new seeds in multithreading?
  17. How does ThreadLocalRandom use ThreadLocal principles to solve the limitations of Random?
  18. How to use ThreadLocal to implement request Scope scoped beans in Spring framework?
  19. And the implementation of the lock in the packet?
  20. How about exclusive lock ReentrantLock?
  21. Talk about ReentrantReadWriteLock.
  22. StampedLock lock principle?
  23. ConcurrentLinkedQueue is a non-blocking unbounded queue based on linked lists.
  24. How is the CAS non-blocking algorithm used inside ConcurrentLinkedQueue to ensure thread safety for queue entry and queue exit operations in multiple threads?
  25. Principle of LinkedBlockingQueue based on linked list.
  26. How to use two exclusive reentrantLocks and corresponding condition variables inside the LinkedBlockingQueue to ensure thread safety for multi-threaded in-queue and out-queue operations?
  27. Analyze the use and principle of CountDownLatch in JUC?
  28. What is the difference between CountDownLatch and thread Join methods?
  29. What is the use of CyclicBarrier in JUC?
  30. How is the implementation inside CyclicBarrier different from CountDownLatch?
  31. What is the internal implementation of Semaphore?
  32. The concurrent component CopyOnWriteArrayList is a List that achieves concurrency safety through copy-on-write.

JVM

  1. Java memory allocation?
  2. What is the structure of the Java heap?
  3. What is Perm Gen space in the heap?
  4. What is the role of each region?
  5. Is there a memory leak in Java?
  6. Java class loading process?
  7. Describe how the JVM loads Class files.
  8. What is a class loader?
  9. What are class loaders?
  10. What is the Tomcat class loading mechanism?
  11. Class loader parent delegate model mechanism?
  12. What is the GC? Why GC?
  13. What is the Java garbage collection mechanism?
  14. How do you tell if an object is alive?
  15. What are the advantages and principles of garbage collection and consider 2 recycling mechanisms?
  16. What is the rationale behind the garbage collector?
  17. Can the garbage collector reclaim memory right away? Is there any way to proactively notify the virtual machine for garbage collection?
  18. Deep copy and shallow copy?
  19. What do system.gc () and Runtime.gc() do?
  20. What is Distributed Garbage Collection (DGC)? How does it work?
  21. What is the difference between a serial collector and a throughput collector?
  22. When can objects be garbage collected in Java?
  23. How about Minor and Major GC?
  24. What are the methods of garbage collection in Java?
  25. Describe your understanding of performance evaluation and test metrics?
  26. What are the common performance tuning methods?
  27. What about distributed caching and consistent hashing?
  28. Synchronous versus asynchronous? Blocking and non-blocking?
  29. What is GC tuning?
  30. What are the common asynchronous methods?

Spring

What needs the proxy pattern?
  1. What are the advantages and bottlenecks of the static proxy pattern?
  2. Understanding how the Java interface proxy pattern works?
  3. How do I implement dynamic proxies using Java reflection?
  4. Specific enhancements to the Java interface proxy pattern?
  5. Talk about the implementation of Cglib class enhanced dynamic proxy?
  6. How do I understand aspects of aspect oriented programming?
  7. A simple comparison between OOP and AOP?
  8. JDK dynamic proxy and CGLIB proxy.
  9. Explain the implementation principle of AOP based on Schema in Spring framework.
  10. How to implement AOP based transaction management in the Spring framework?
  11. Talk about your understanding of the design idea of inversion of control?
  12. How to understand the Spring IOC container?
  13. How does Spring IOC manage dependencies between beans and avoid circular dependencies?
  14. Understanding dependency injection for the Spring IOC container?
  15. What are the singleton patterns and advanced features of Spring IOC?
  16. What’s the difference between a BeanFactory and a FactoryBean?
  17. What’s the difference between BeanFactory and ApplicationContext?
  18. How does Spring address loop dependencies during Bean creation?
  19. What about design patterns during Spring Bean creation?

The database

  1. What storage engines does MySQL have? What’s the difference?
  2. How do Float and Decimal store amounts?
  3. Timestamp, Datetime, Timestamp
  4. Char, Varchar, Varbinary
  5. How about B+ tree index versus Hash index?
  6. MySQL index type?
  7. How to manage MySQL index?
  8. Understanding of Explain parameters and important parameters?
  9. What are the advantages and disadvantages of index and index classification?
  10. What is the difference between a clustered index and a non-clustered index?
  11. How to optimize B+tree? What principles does the index follow?
  12. What is the relationship between indexes and locks?
  13. What are the other index types, and what are the pros and cons of each?
  14. What about Innodb transactions?
  15. Describe database transaction characteristics and potential problems?
  16. What is MySQL isolation level?
  17. How many transaction failure scenarios are there and how are they resolved?
  18. What are consistent unlocked reads and consistent locked reads?
  19. How does Innodb solve phantom reading?
  20. How about Innodb row locking?
  21. What are deadlocks and monitoring?
  22. Self-growth and locking, locking algorithms, locking problems, what is locking escalation?
  23. How does the thread of optimistic lock compensate for failure?
  24. How to prevent deadlocks and ensure data consistency in high-concurrency scenarios (receiving red packets)?
  25. MySQL > lock concurrency
  26. What is the basic idea of query optimization?
  27. MySQL > separate read and write tables
  28. What impact does table structure have on performance?
  29. Index optimization?
  30. What are the principles of Sql optimization?
  31. MySQL table design and specification?
  32. Describe the application scenarios of MySQL storage engine.
  33. What are the common optimization methods for MySQL?
  34. MySQL > alter database
  35. MySQL Bottleneck Analysis?

The cache

  1. What are redis data structures?
  2. Redis cache penetration, cache avalanche?
  3. How to use Redis to implement distributed locks?
  4. How to solve Redis concurrency competition problem?
  5. What are the advantages and disadvantages of Redis persistence? How to implement it?
  6. Redis cache invalidation policy?
  7. Redis cluster, high availability, principle?
  8. Redis cache sharding?
  9. Redis data elimination strategy?
  10. Redis queue application scenario?
  11. Distributed usage scenario (store session)?

Network programming

  1. How does TCP establish and disconnect a connection?
  2. HTTP interaction flow, HTTP and HTTPS differences, SSL interaction flow?
  3. What does TCP’s sliding window protocol do?
  4. What are the HTTP protocol methods?
  5. The basic flow of Socket interaction?
  6. Talk about TCP (connection setup, slow start, sliding window, seven-tier model)?
  7. Webservice protocol (WSDL/SOAP format, different from RESTT)?
  8. Tell us about the Netty threading model. What is zero copy?
  9. TCP three handshakes, four waves?
  10. DNS resolution process?
  11. How does TCP ensure reliable data transmission?

distributed

  1. What is the CAP theorem?
  2. CAP theory and BASE theory?
  3. What is final consistency? How is the final consistency implemented?
  4. What is a consistent Hash?
  5. What about distributed transactions?
  6. How to implement distributed locking?
  7. How to implement distributed sessions?
  8. How can message consistency be guaranteed?
  9. Load balancing?
  10. Forward and reverse proxies?
  11. CDN implementation principle?
  12. How to improve system QPS and throughput?
  13. The underlying implementation principles and mechanisms of Dubbo?
  14. Describe the detailed process of a service from publication to consumption?
  15. How do distributed systems do service governance?
  16. How does messaging middleware solve message loss?
  17. Dubbo service request failed.
  18. Understanding distributed transactions?
  19. How to achieve load balancing and what algorithms can be used to achieve it?
  20. What is the purpose of Zookeeper and how does election work?
  21. Talk about vertical splitting of data horizontal splitting?
  22. Working principles and Application scenarios of ZooKeeper?
  23. Mechanism of ZooKeeper Watch?
  24. How can I handle the redis/ ZK node failure?
  25. How to achieve unique sequence number in distributed cluster?
  26. What MQ has been used, how has it been used, how does it compare to other MQS, and is the connection to MQ thread-safe?
  27. How is the data of the MQ system guaranteed against loss?
  28. Can you think of any strategies for dividing databases into tables?

For the above knowledge points, after a long time of sorting, has formed a document information and explain the video and so on, the following part of the screenshots:

The Spring source

Neety