Sorted out 136 Ali Java interview questions, all to challenge, see how good you are. The following questions have super detailed solutions, see the bottom for details.

Java based

  1. Arrays.sort and Collection
  2. Foreach vs. while (compiled)
  3. Types, differences, and usage scenarios of thread pools
  4. Analysis of thread pool implementation principle and thread scheduling process
  5. How can thread pools be tuned
  6. What determines the maximum number of threads in a thread pool
  7. Several ways of dynamic proxy
  8. Concurrency issues with HashMap
  9. Do you know anything about LinkedHashMap
  10. How does reflection work, what are the three ways that reflection creates class instances?
  11. Cloneable interface implementation principle, shallow copy or deep copy
  12. Java NIO use
  13. Hashmap can ask for array index. How to solve hash collision
  14. Arraylist and LinkedList differences and implementation principles
  15. In reflection, class. forName is different from ClassLoader
  16. What’s the difference between String, Stringbuffer, StringBuilder?
  17. Is it possible that two objects that are not equal have the same Hashcode
  18. Describe NIO best practices, such as Netty, Mina
  19. Implementation principles of TreeMap

The JVM related

  1. The order in which classes are instantiated, such as superclass static data, constructors, fields, subclass static data, constructors, fields, the order in which they are executed
  2. JVM memory generation
  3. Java 8 memory generation improvements
  4. JVM garbage collection mechanism, when to trigger MinorGC, etc
  5. What is a complete GC flow in the JVM (from YGC to FGC), focusing on how objects are advanced to the old age, the main JVM parameters, etc.
  6. You know which garbage collectors, their pros and cons, focus on CMS, G1
  7. New generation and old generation memory reclamation strategies
  8. Eden and Survivor ratio allocation, etc
  9. In-depth analysis of Classloader, parent delegation mechanism
  10. Compilation optimization for the JVM
  11. An understanding of the Java memory model and its application to concurrency
  12. Instruction reordering, memory fencing, etc
  13. OOM error, StackOverflow error, Permgen space error
  14. Common JVM parameters
  15. Tomcat structure, class loader flow
  16. The semantics of volatile. Are the variables it modiates thread-safe
  17. G1 and CMS differences, throughput first and response first garbage collector selection
  18. What do you understand about the environment variable CLASspath? Why does a class throw a ClassNotFoundException if it is not in the classpath, and how can it be loaded correctly without changing the classpath?
  19. Talk about strong references, soft references, weak references, virtual references and the relationship between them and GC

JUC/ concurrency related

  1. Have you used ThreadLocal before, how does it work, and what should you pay attention to when using it
  2. The difference between Synchronized and Lock
  3. Principle of synchronized, what is spin lock, bias lock, lightweight lock, what is reentrant lock, what is fair lock and unfair lock
  4. Concurrenthashmap implementation and its principle, jdK8 under the revision
  5. Which atomic classes have been used, and what are their parameters and principles
  6. What is CAS and what problems it can cause (ABA problem solving, such as adding number of changes, version number)
  7. If you were asked to implement a concurrency safe linked list, what would you do
  8. Briefly describe the uses and differences of ConcurrentLinkedQueue and LinkedBlockingQueue
  9. This section describes the implementation principle of AQS
  10. What are the uses of countdowlatch and cyclicbarrier, and the differences between them?
  11. What classes are used in the Concurrent package? In what scenario is it used? Why use it?
  12. LockSupport tools
  13. Condition interface and its implementation principle
  14. Understanding the Fork/Join framework
  15. ParallelStream for JDK8
  16. The principle of segmental lock, lock force reduced thinking

Spring

  1. Implementation principle of Spring AOP and IOC
  2. The difference between Spring’s beanFactory and factoryBean
  3. Why can CGlib be used to implement proxies for interfaces?
  4. RMI versus the proxy pattern
  5. Spring transaction isolation level, implementation principle
  6. Understanding of Spring, how does non-singleton injection work? Its life cycle? The principle of circular injection, the implementation principle of AOP, some terms in AOP, how do they work with each other?
  7. The underlying realization principle of Mybatis
  8. MVC framework, how do they do URL routing
  9. Spring Boot features, advantages, and application scenarios
  10. Quartz and Timer
  11. Is the Spring controller singleton or multi-instance? How to ensure concurrency security

Distributed correlation

  1. The underlying implementation principles and mechanisms of Dubbo
  2. Describes the detailed process of a service from publication to consumption
  3. How do distributed systems do service governance
  4. The concept of idempotency of interfaces
  5. How does messaging middleware solve message loss
  6. Dubbo service request failed
  7. Does the reconnection mechanism cause errors
  8. Understanding of distributed transactions
  9. How to achieve load balancing and what algorithms can be used to achieve it?
  10. What is the purpose of Zookeeper and how does election work?
  11. Vertical split of data Horizontal split.
  12. Zookeeper principles and application scenarios
  13. They watch mechanism
  14. How can I handle the redis/ ZK node failure
  15. How to achieve unique sequence number in distributed cluster
  16. How to make a distributed lock
  17. 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
  18. How is the data of the MQ system guaranteed against loss
  19. List all the strategies you can think of for separating databases from tables; How to solve the problem of query of whole table after dividing database and table.

Algorithms and data structures and design patterns

  1. Massive URL reclassification problem (Bloom filter)
  2. Array and linked list data structure description, their time complexity
  3. Binary tree traversal
  4. Quick sort
  5. Operations related to BTree
  6. What design patterns have you encountered in your work and how have you applied them
  7. What hash algorithms are used, advantages and disadvantages, and application scenarios
  8. What is a consistent hash
  9. Paxos algorithm
  10. How do you choose between decorator mode and proxy mode
  11. The steps and reasons for code refactoring, and how to understand refactoring to patterns?

The database

  1. MySQL InnoDB storage file structure
  2. How is the index tree maintained?
  3. Possible problem with database auto-increment primary key
  4. MySQL optimization
  5. Why use B+ tree for mysql index
  6. Database lock table related processing
  7. Index Failure Scenario
  8. How to safely modify the same row under high concurrency? What are optimistic locks and pessimistic locks? What are INNODB row-level locks
  9. Mysql > database deadlocks

Redis is related to caching

  1. How to solve the Redis concurrency race problem Understand the CAS operation of Redis transactions
  2. How to minimize the impact of the cache machine on the system, the implementation of consistent hash
  3. What are the advantages and disadvantages of Redis persistence? How to implement it
  4. Redis cache invalidation policy
  5. Workaround for cache penetration
  6. Redis cluster, high availability, principle
  7. MySQL has 2000W data, redis only 20W data, how to ensure that the data in Redis is hot data
  8. With Redis and any language to achieve a malicious login protection code, limit 1 hour per user Id can only login 5 times
  9. Redis’ data obsolescence strategy

Network related

  1. What is the difference between HTTP1.0 and HTTP1.1
  2. TCP/IP protocol
  3. TCP three-way handshake and four-way wave process, why disconnection takes four times, if there are only two handshakes, what happens
  4. Difference between TIME_WAIT and CLOSE_WAIT
  5. Name some HTTP response codes you know
  6. What steps does the computer take when you open a link with a browser
  7. How does TCP/IP ensure reliability and what data packets consist of
  8. Long connection and short connection
  9. Http request get and POST differences and packet format
  10. Briefly describes the process of TCP three-way handshake for establishing a connection and four-way handshake for disconnecting a connection. What is the cause of excessive TIMEWAIT when closing a connection? Is it active or passive?

other

  1. Maven resolves dependency conflicts, the difference between snapshot releases and distributions
  2. There are several IO models in Linux. What are their meanings
  3. Actual scenario Q: How do I sort massive login logs and process SQL operations, mainly the application of index and aggregation functions
  4. Actual scenario problem solving, typical TOP K problem
  5. Online bug handling process
  6. How do I find problems from online logs
  7. What commands does Linux use to find out what went wrong (e.g., IO intensive tasks, excessive CPU)?
  8. Scenario problem, there is a third party interface, there are many threads to call the data, now specify a maximum of 10 threads per second to call it at the same time, how to do it.
  9. Print the letters ABC in a sequence of three threads, such as abcabcabc.
  10. What are the common caching strategies, what is the caching system used in your project, and how is it designed
  11. Design a seckill system that automatically closes transactions if no payment is made in 30 minutes (concurrency is high)
  12. List the performance testing tools you know
  13. How does the backend system prevent requests from being submitted repeatedly?

conclusion

Summarizes some experience in the previous interview experience, actually when you interview to a relatively high level position, often fight technology is second, most companies after chatting with you technology, more weight is given to your communication skills, problem solving skills, as well as some of the more successful your past experiences.

Ready for an interview is not just these not only including technology, as well as your understanding of the company, this is in the hr this pass on, they want to find the Montana is not only technology, more important is can make progress together with company’s partners, so when you actually start to interview, then come up with their own sincere, let the hr feel you to the company’s interest, enthusiasm and confidence, Speaking decisively and firmly is often preferred by many recruiters. If you are interested in a certain company and technology, customs clearance, so how to make the company in the multiple choice to choose you, that is to make the hr in communication with you feel happy and smooth, this is very important, a lot of people can be qualified for a job, but can be a notch above in communication, the job should be is belong to you!

Finally, based on the above frequently asked interview questions, I also summarized most of the interview questions and answers involved in the interview of Java programmers in major Internet companies into a document, study notes and architecture video materials free to share with everyone (including Dubbo, Redis, Netty, ZooKeeper, Spring Cloud, distributed, high concurrency and other architecture technology information), I hope to help you review before the interview and find a good job, but also save the time to study on the Internet to search for information, you can also pay attention to me later will have more dry goods to share.

Data acquisition:

 

 

Review the bible

(1) Java interview Manual

  • Performance optimization interview column
  • Microservices Architecture interview column
  • Advanced Interview column for Concurrent programming
  • Open source framework interview questions column
  • Distributed Interview

 

(2) Actual combat documents

  • Redis of actual combat
  • MySQL of actual combat
  • Spring the Boot of actual combat
  • Spring Cloud of actual combat
  • Actual Java virtual machine

The actual Java VM is used as an example:

  1. An introduction to the Java VIRTUAL machine
  2. Understand the basic structure of Java virtual machines (VMS)
  3. Common Java VIRTUAL machine parameters
  4. Garbage collection concepts and algorithms
  5. Garbage collector and memory allocation
  6. Performance Monitoring tool
  7. Analysis of the Java heap
  8. Locking and concurrency
  9. Class file structure
  10. Class loading system
  11. Bytecode execution

 

(3) Java core knowledge points sorted out documents

 

 

Due to the limitation of space, many contents only show catalog and screenshots, which are organized in the document, need these documents, can be shared with you for free, I hope all programmers can learn up, and strive to achieve our dream of Dachang!

Data acquisition: