preface
As a developer, have you met your dream company’s salary expectations?
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 arrangement of Java architecture interview topics and answers, most of which are often asked by large enterprises interview questions, can compare this check to fill the gap, 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 are as follows (answers are available here) :
Concurrent programming:
What are multithreaded concurrency and parallelism?
What are thread safety issues?
What are memory visibility issues for shared variables?
What are atomic operations in Java?
What are CAS operations in Java and how does AtomicLong work?
What is Java instruction reorder?
What are the memory semantics of the Synchronized keyword in Java?
What are the memory semantics of the Volatile keyword in Java?
What is pseudo-sharing, why does it happen, and how can it be avoided?
What are reentrant locks, optimistic locks, pessimistic locks, fair locks, unfair locks, exclusive locks, shared locks?
How does ThreadLocal work?
How does ThreadLocal work internally as a thread-isolation method for variables?
What is the implementation of InheritableThreadLocal?
How does InheritableThreadLocal compensate for ThreadLocal not supporting inheritance?
How is the implementation inside CyclicBarrier different from CountDownLatch?
How does the Random number generator class use CAS algorithm to ensure the uniqueness of new seeds in multithreading?
How does ThreadLocalRandom use ThreadLocal principles to solve the limitations of Random?
How to use ThreadLocal to implement request Scope scoped beans in Spring framework?
And the implementation of the lock in the packet?
How about exclusive lock ReentrantLock?
Talk about ReentrantReadWriteLock.
StampedLock lock principle?
ConcurrentLinkedQueue is a non-blocking unbounded queue based on linked lists.
How is the CAS non-blocking algorithm used inside ConcurrentLinkedQueue to ensure thread safety for queue entry and queue exit operations in multiple threads?
Principle of LinkedBlockingQueue based on linked list.
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?
Analyze the use and principle of CountDownLatch in JUC?
What is the difference between CountDownLatch and thread Join methods?
What is the use of CyclicBarrier in JUC?
How is the implementation inside CyclicBarrier different from CountDownLatch?
What is the internal implementation of Semaphore?
The concurrent component CopyOnWriteArrayList is a List that achieves concurrency safety through copy-on-write.
JVM
Java memory allocation?
What is the structure of the Java heap?
What is Perm Gen space in the heap?
What is the role of each region?
Is there a memory leak in Java?
Java class loading process?
Describe how the JVM loads Class files.
What is a class loader?
What are class loaders?
What is the Tomcat class loading mechanism?
Class loader parent delegate model mechanism?
What is the GC? Why GC?
What is the Java garbage collection mechanism?
How do you tell if an object is alive?
What are the advantages and principles of garbage collection and consider 2 recycling mechanisms?
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?
Deep copy and shallow copy?
What do system.gc () and Runtime.gc() do?
What is Distributed Garbage Collection (DGC)? How does it work?
What is the difference between a serial collector and a throughput collector?
When can objects be garbage collected in Java?
How about Minor and Major GC?
What are the methods of garbage collection in Java?
Describe your understanding of performance evaluation and test metrics?
What are the common performance tuning methods?
What about distributed caching and consistent hashing?
Synchronous versus asynchronous? Blocking and non-blocking?
What is GC tuning?
What are the common asynchronous methods?
Spring
Why is the proxy pattern needed?
What are the advantages and bottlenecks of the static proxy pattern?
Understanding how the Java interface proxy pattern works?
How do I implement dynamic proxies using Java reflection?
Specific enhancements to the Java interface proxy pattern?
Talk about the implementation of Cglib class enhanced dynamic proxy?
How do I understand aspects of aspect oriented programming?
A simple comparison between OOP and AOP?
JDK dynamic proxy and CGLIB proxy.
Explain the implementation principle of AOP based on Schema in Spring framework.
How to implement AOP based transaction management in the Spring framework?
Talk about your understanding of the design idea of inversion of control?
How to understand the Spring IOC container?
How does Spring IOC manage dependencies between beans and avoid circular dependencies?
Understanding dependency injection for the Spring IOC container?
What are the singleton patterns and advanced features of Spring IOC?
What’s the difference between a BeanFactory and a FactoryBean?
What’s the difference between BeanFactory and ApplicationContext?
How does Spring address loop dependencies during Bean creation?
What about design patterns during Spring Bean creation?
The database
What storage engines does MySQL have? What’s the difference?
How do Float and Decimal store amounts?
Timestamp, Datetime, Timestamp
Char, Varchar, Varbinary
How about B+ tree index versus Hash index?
MySQL index type?
How to manage MySQL index?
Understanding of Explain parameters and important parameters?
What are the advantages and disadvantages of index and index classification?
What is the difference between a clustered index and a non-clustered index?
How to optimize B+tree? What principles does the index follow?
What is the relationship between indexes and locks?
What are the other index types, and what are the pros and cons of each?
What about Innodb transactions?
Describe database transaction characteristics and potential problems?
What is MySQL isolation level?
How many transaction failure scenarios are there and how are they resolved?
What are consistent unlocked reads and consistent locked reads?
How does Innodb solve phantom reading?
How about Innodb row locking?
What are deadlocks and monitoring?
Self-growth and locking, locking algorithms, locking problems, what is locking escalation?
How does the thread of optimistic lock compensate for failure?
How to prevent deadlocks and ensure data consistency in high-concurrency scenarios (receiving red packets)?
MySQL > lock concurrency
What is the basic idea of query optimization?
MySQL > separate read and write tables
What impact does table structure have on performance?
Index optimization?
What are the principles of Sql optimization?
MySQL table design and specification?
Describe the application scenarios of MySQL storage engine.
What are the common optimization methods for MySQL?
MySQL > alter database
MySQL Bottleneck Analysis?
The cache
What are redis data structures?
Redis cache penetration, cache avalanche?
How to use Redis to implement distributed locks?
How to solve Redis concurrency competition problem?
What are the advantages and disadvantages of Redis persistence? How to implement it?
Redis cache invalidation policy?
Redis cluster, high availability, principle?
Redis cache sharding?
Redis data elimination strategy?
Redis queue application scenario?
Distributed usage scenario (store session)?
Network programming
How does TCP establish and disconnect a connection?
HTTP interaction flow, HTTP and HTTPS differences, SSL interaction flow?
What does TCP’s sliding window protocol do?
What are the HTTP protocol methods?
The basic flow of Socket interaction?
Talk about TCP (connection setup, slow start, sliding window, seven-tier model)?
Webservice protocol (WSDL/SOAP format, different from RESTT)?
Tell us about the Netty threading model. What is zero copy?
TCP three handshakes, four waves?
DNS resolution process?
How does TCP ensure reliable data transmission?
distributed
What is the CAP theorem?
CAP theory and BASE theory?
What is final consistency? How is the final consistency implemented?
What is a consistent Hash?
What about distributed transactions?
How to implement distributed locking?
How to implement distributed sessions?
How can message consistency be guaranteed?
Load balancing?
Forward and reverse proxies?
CDN implementation principle?
How to improve system QPS and throughput?
The underlying implementation principles and mechanisms of Dubbo?
Describe the detailed process of a service from publication to consumption?
How do distributed systems do service governance?
How does messaging middleware solve message loss?
Dubbo service request failed.
Understanding distributed transactions?
How to achieve load balancing and what algorithms can be used to achieve it?
What is the purpose of Zookeeper and how does election work?
Talk about vertical splitting of data horizontal splitting?
Working principles and Application scenarios of ZooKeeper?
Mechanism of ZooKeeper Watch?
How can I handle the redis/ ZK node failure?
How to achieve unique sequence number in distributed cluster?
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?
How is the data of the MQ system guaranteed against loss?
Can you think of any strategies for dividing databases into tables?
Write in the last
Based on the above interview questions, I have summarized most of the interview questions and answers involved in the interview of Java programmers in Internet companies into a document and architecture video material free to share with everyone (including Dubbo, Redis, Netty, ZooKeeper, Spring Cloud, distributed, high concurrency and other architecture technology information), here to obtain, I hope to help you review before the interview and find a good job, but also save you on the Internet to search for information to learn, you can also pay attention to my future will have more dry goods to share.