Golden Nine and Silver Ten interviews are a must, the "new" Java interview surprise book for Internet giants

foreword

The peak recruitment season of Golden September Silver October is coming soon. I don’t know if everyone is ready. Facing the peak recruitment season of Golden September Silver October, I think it is irresponsible for me if I don’t make careful preparations. As far as we Java programmers are concerned, the interviews in most companies are based on the process of self-introduction + project introduction + project details/difficult questions + basic knowledge assessment + algorithm questions.

Some companies may also ask a few questions about actual scenarios, which Ali must ask in this link. Usually there is no correct answer to this kind of question, and it depends on personal understanding and personal accumulation. The rest is nothing, it’s all about changing the soup, not the medicine, talking about the project depends on whether you have a thorough understanding of your own project, such as often asking you why you choose this technology, why you deal with it like this, there are only so many basic knowledge points in the regular test, and the final algorithm is based on brushing the questions.

What I would like to share with you today is the most frequently used interview question bank by Internet companies. After careful sorting, all the questions have been updated with detailed answer analysis. For those that are difficult to understand, technical documents have been specially prepared for everyone to read and learn.

This sharing involves a total of knowledge points : Java foundation, multithreading, JVM, Spring, SpringMVC, SpringCloud, Spring Boot, high concurrency, Redis, kafka, message middleware MQ, Dubbo, Tomcat, network protocol, data structure, MySQL, MyBatis, design patterns, algorithms, etc.

1. Multi-threaded interview topics

  1. Now there are three threads T1, T2, and T3. How do you ensure that T2 is executed after T1 is executed, and T3 is executed after T2 is executed?

  2. What is the advantage of Lock interface over synchronized block in Java? You need to implement an efficient cache that allows multiple users to read but only one user to write to maintain its integrity, how would you implement it?

  3. What is the difference between wait and sleep methods in java?

  4. Implement blocking queue in Java.

  5. Write code in Java to solve the producer-consumer problem.

  6. Program a program in Java that causes a deadlock. How would you solve it?

  7. What is an atomic operation and what are atomic operations in Java?

  8. What does the volatile key do in Java? how to use it How is it different from a synchronized method in Java?

  9. What is a race condition? How do you spot and resolve competition?

  10. How would you use threaddump? How would you analyze the Thread dump?

  11. Why does the run() method execute when we call the start() method, why can't we call the run() method directly?

  12. How do you wake up a blocked thread in Java?

  13. What is the difference between CycliBarriar and CountdownLatch in Java?

  14. What is an immutable object, and how does it help in writing concurrent applications?

  15. What are the common problems you encounter in a multi-threaded environment? How did you solve it?

2. JVM interview topic

  1. The memory model and partitions need to detail what to put in each area.

  2. Partitions in the heap: Eden, survival (from+to), old generation, and their respective characteristics.

  3. Object creation method, object memory allocation, object access location.

  4. Two judgment methods of GC:

  5. What is SafePoint?

  6. The principles and characteristics of the three collection methods of GC: mark clearing, mark sorting, and copying algorithms, where are they used respectively, and if you are asked to optimize the collection method, what ideas do you have?

  7. What are the GC collectors? Characteristics of CMS collector and G1 collector.

  8. When do Minor GC and Full GC occur respectively?

  9. Several common memory debugging tools: jmap, jstack, jconsole, jhat

  10. Several processes of class loading:

  11. How to judge whether an object is alive? (or the method of judging GC objects)

  12. Briefly describe the java garbage collection mechanism?

  13. java memory model

  14. Briefly describe the java class loading mechanism?

  15. Class loader parent delegation model mechanism?

  16. What is a class loader and what are the class loaders?

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

3. Spring interview topic

  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 IoC in Spring framework?

  5. What is the difference between BeanFactory and ApplicationContext?

  6. How many configuration methods does Spring have?

  7. How to configure Spring with XML-based configuration?

  8. How to configure Spring with Java-based configuration?

  9. How to configure Spring with annotations?

  10. Please explain the life cycle of Spring Bean?

  11. What is the difference between Spring Bean scopes?

  12. What are Spring inner beans?

  13. Are singleton beans in the Spring framework thread-safe?

  14. Please give an example how to inject a Java Collection in Spring?

  15. How to inject a Java.util.Properties into a Spring Bean?

  16. Please explain Spring Bean autowiring?

  17. Please explain the difference between autowire mode?

  18. How to enable annotation-based autowiring?

  19. Please explain the @Required annotation with an example?

  20. Please explain the @Autowired annotation with an example?

  21. Please give an example of @Qualifier annotation?

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

Four, Spring Cloud, Spring Boot, SpringMVC interview topics

1) Spring Cloud interview topics

  1. What is Spring Cloud?

  2. What are the advantages of using Spring Cloud?

  3. What does service registration and discovery mean? How does Spring Cloud implement it?

  4. What is the meaning of load balancing?

  5. What is Hystrix? How does it achieve fault tolerance?

  6. What is a Hystrix circuit breaker? do we need it

  7. What is Netflix Feign? What are its advantages?

  8. What is Spring Cloud Bus? do we need it

2) Spring Boot interview topics

  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 are monitors in Spring Boot?

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

  7. How to run Spring Boot application on custom port?

  8. What is YAML?

  9. How to implement security in Spring Boot application?

  10. How to integrate Spring Boot and ActiveMQ?

  11. How to implement pagination and sorting with Spring Boot?

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

  13. What are Spring Profiles?

  14. What is Spring Batch?

  15. What are FreeMarker templates?

  16. How to implement exception handling with Spring Boot?

  17. Which starter maven dependencies did you use?

  18. What is a CSRF attack?

  19. What are WebSockets?

  20. What is AOP?

  21. What is Apache Kafka?

  22. How can we monitor all Spring Boot microservices?

3) Spring MVC interview topic

  1. What is Spring Mvc?

  2. Advantages of Spring MVC:

  3. How does Spring MVC work?

  4. Spring MVC process?

  5. Is the controller of SpringMvc a singleton mode? If so, what is the problem and how to solve it?

  6. If you have also used struts2, what are the differences between springMVC and struts2?

  7. Which annotation is generally used for the controller in SpingMvc, and is there any other annotation that can be replaced?

  8. What does the @RequestMapping annotation do on a class?

  9. How to map a request to a specific method?

  10. If in the interception request, I want to intercept the method submitted by get method, how to configure it?

  11. How to get Request or Session in the method?

  12. I want to get the parameters passed in from the foreground in the interception method, how to get it?

  13. If there are many parameters passed in at the foreground, and these parameters are all an object, how to get this object quickly?

  14. What is the return value of the function in SpringMvc?

  15. How does SpringMVC set redirection and forwarding?

  16. What object does SpringMvc use to transfer data from the background to the foreground?

  17. There is a class in SpringMvc that combines views and data. What is it called?

  18. How to put the data in ModelMap into Session?

  19. How does SpringMvc and AJAX call each other?

  20. When a method returns a special object to AJAX, such as Object, List, etc., what needs to be done?

  21. How is the interceptor written in SpringMvc

  22. Talk about the execution process of SpringMvc

Five, Redis interview topic 50 questions

  1. What is Redis?

  2. What are the advantages of Redis over memcached?

  3. What data types does Redis support?

  4. What physical resources does Redis mainly consume?

  5. What is the full name of Redis?

  6. What kinds of data elimination strategies does Redis have?

  7. Why doesn't Redis officially provide a Windows version?

  8. What is the maximum capacity that a value of type string can store?

  9. Why does Redis need to put all data in memory?

  10. What should be done in the Redis cluster solution? What are the plans?

  11. Under what circumstances will the Redis cluster solution cause the entire cluster to be unavailable?

  12. There are 20 million data in MySQL, and only 20 million data in Redis. How to ensure that the data in Redis are all hot data?

  13. What are the suitable scenarios for Redis?

  14. What are the Java clients supported by Redis? Which one is officially recommended?

  15. What is the relationship between Redis and Redisson?

  16. What are the advantages and disadvantages of Jedis compared with Redisson?

  17. How does Redis set password and verify password?

  18. Tell me about the concept of Redis hash slot?

  19. What is the master-slave replication model of Redis cluster?

  20. Will there be write loss in Redis cluster? Why?

  21. How are Redis clusters replicated?

  22. What is the maximum number of nodes in a Redis cluster?

  23. How does a Redis cluster choose a database?

  24. How to test the connectivity of Redis?

  25. What is the use of pipes in Redis?

  26. How to understand Redis transactions?

  27. What are the commands related to Redis transactions?

  28. How to set the expiration time and permanent validity of the Redis key?

  29. How does Redis do memory optimization?

  30. How does the Redis recycling process work?

  31. What algorithm does Redis recycling use?

  32. How does Redis do massive data insertion?

  33. Why do Redis partitions?

  34. Do you know of any Redis partitioning implementations?

  35. What are the disadvantages of Redis partitioning?

  36. How to expand Redis persistent data and cache?

  37. Should distributed Redis be done in the early stage or after the scale is up in the later stage? Why?

  38. What is Twemproxy?

  39. Which clients support consistent hashing?

  40. How is Redis different from other key-value stores?

  41. What is the memory usage of Redis?

  42. What are the ways to reduce the memory usage of Redis?

  43. What command is used to view Redis usage and status information?

  44. What happens when Redis runs out of memory?

  45. Redis is single-threaded, how to improve the utilization of multi-core CPU?

  46. How many keys can a Redis instance store at most? List, Set, Sorted Set, how many elements can they store at most?

  47. Redis common performance problems and solutions?

  48. What persistence methods does Redis provide?

  49. How to choose the appropriate persistence method?

  50. Will modifying the configuration take effect in real time without restarting Redis?

Six, RabbitMQ interview topics

  1. What is the broker in RabbitMQ? What does cluster mean?

  2. What is metadata? What are the types of metadata? What is included? What metadata is associated with the cluster? How is metadata stored? How is metadata distributed in the cluster?

  3. What is the difference between RAM node and disk node?

  4. Is there a limit on the number of messages stored in a queue on RabbitMQ?

  5. Are the channel, exchange, and queue in the RabbitMQ concept logical concepts, or do they correspond to process entities? What is the role of these stuff?

  6. What is a vhost? What is the role?

  7. What is the difference between declaring queue, exchange, and binding in a single node system and a multi-node cluster system?

  8. Can the client connect to any node in the cluster work normally?

  9. If the owner node of a queue in the cluster fails, and the queue is declared to have the durable attribute, can the queue be re-declared from other nodes successfully?

  10. What impact will the failure of the node in the cluster have on the consumer? If a mirrored queue is created in the cluster, what impact will the node failure have on the consumer?

  11. Can a RabbitMQ cluster be used in geographically separated data centers?

  12. Why is disk node not recommended for heavy RPC usage scenarios?

  13. What happens when I send a publish message to an exchange that doesn't exist? What happens when you execute the consume action on a queue that doesn't exist?

  14. What is the maximum length of routing_key and binding_key?

  15. How big is the maximum message that RabbitMQ allows to send?

  16. Under what circumstances is it safe for the producer not to actively create a queue?

  17. What is the "dead letter" queue for?

  18. Why do you say that the condition to ensure that the message is reliably persisted is that the queue and exchange have the durable attribute, and the message has the persistent attribute?

  19. Under what circumstances will the blackholed problem occur?

  20. How to prevent blackholed problem?

  21. What scenario is the Consumer Cancellation Notification mechanism used for?

  22. What is the usage of Basic.Reject?

  23. Why shouldn't all messages be persisted?

  24. What problems are the cluster, mirrored queue, and warrens mechanisms in RabbitMQ used to solve? What are the problems?

Seven, Nginx, Netty interview topics

1) Nginx interview topic

  1. Explain what is Nginx?

  2. Please list some features of Nginx.

  3. Please list the differences between Nginx and Apache

  4. Please explain how Nginx handles HTTP requests.

  5. In Nginx, how to prevent processing request with undefined server name?

  6. What are the advantages of using a "reverse proxy server"?

  7. Please list the best uses for Nginx server.

  8. Please explain what are the Master and Worker processes on the Nginx server?

  9. Please explain how you start Nginx on a port other than 80?

  10. Explain Is it possible to replace Nginx's errors with 502 errors, 503?

  11. Explain how to preserve double slashes in URLs in Nginx?

  12. Please explain what is the role of ngx_http_upstream_module?

  13. Please explain what is the C10K problem?

  14. Please state what the stub_status and sub_filter directives do?

  15. Explain whether Nginx supports compressing requests upstream?

  16. Explain how to get current time in Nginx?

  17. What is the purpose of -s explained with Nginx server?

  18. Explain how to add modules on Nginx server?

2) Netty interview topic

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

  2. What is NIO made of?

  3. Netty features?

  4. Netty's threading model?

  5. Reasons and solutions for TCP sticky/unpacking?

  6. What serialization protocols do you know?

  7. How to choose a serialization protocol?

  8. Netty's zero-copy implementation?

  9. What are the performance aspects of Netty?

  10. NIOEventLoopGroup source code?

Eight, data structure interview topics

  1. Why is ConcurrentHashMap not locked for reading.

  2. How HashMap is synchronized.

  3. Let's talk about the common collections.

  4. The difference between HashMap and HashTable.

  5. The specific process of the put method of HashMap.

  6. How is the expansion operation of HashMap realized.

  7. How does HashMap resolve hash collisions.

  8. Why doesn't HashMap directly use the hash value processed by hashCode() as the subscript of the table.

  9. Why are wrapper classes such as String and Integer in HashMap suitable as Key.

  10. The difference between ConcurrentHashMap and HashMap.

  11. The fail-fast mechanism "fail-fast" for Java collections, and the fail-safe "fail-safe".

  12. The difference between ArrayList and CopyOnWriteArrayList.

  13. The difference between ArrayList and LinkedList.

  14. HashSet is how to ensure that the data is not repeatable.

  15. What is BlockingQueue.

  16. Why HashMap chooses red-black tree.

  17. Whether Add method exists in Iterator.

Catalog Details

Basic

JVM articles

Multithreading & Concurrency

Spring articles

MyBatis articles

SpringBoot articles

MySQL articles

SpringCloud 篇

Dubbo article

Nginx articles

MQ articles

Linux

Zookeeper articles

Redis articles

Distributed articles

Network articles

Design Patterns

maven articles

ElasticSearch 篇

tomcat articles

Git articles

Soft Power

content at a glance

Summary of JVM knowledge points

lock, thread

My shoe

Zookeeper

TCP

Summarize

The above are some summaries about programmer interview topics. Interviews not only test technology but also mentality. As long as you have sufficient technical support and a good mentality, it is definitely not a problem to get an offer. Don't think about it very difficult, set the threshold for yourself! I hope that everyone can get their favorite offer, and move towards promotion, job-hopping, salary increase, and winning and marrying Bai Fumei!

Guess you like

Origin blog.csdn.net/qq13321123/article/details/131761191