[Interview Question Analysis]-20200409 Java Software Development Engineer Interview Question Analysis

1. What is the role of load balancing and reverse proxy?

Load balancing is to distribute multiple requests to the same address to a specified server through a certain strategy, and a reverse proxy can forward a request to a real application server.

2. Have you encountered any problems when using the cache? How did you solve this problem?

For example 缓存穿透, cache penetration is because there is no specified data row of a key in the database, and then the key does not exist in the cache, so the request directly accesses the database, which puts pressure on the database. To solve this problem, only need to query the database, if there is no query to the specified value, then store a null value in the cache and set the expiration time.

3. What is the execution flow of SpringMVC?

First, a request reaches the server and will be intercepted by DispatcherServlet. At this time, DispatcherServlet will call HandlerMapping, create the corresponding request processor and corresponding request interceptor, and return DispatcherServlet, and then call HandlerAdapter (processor adapter), this time The specified controller will be called. After the controller is processed, it will return to the ModelAndView object, first return to the HandlerAdapter, finally return to the DispatcherServlet, DispatcherServlet will hand ModelAndView to ViewResolver, and finally return a view object View, and finally the DispatcherServlet renders the view Respond to client requests.

4. What are the roles of reflection and dynamic agents?

The reflection mechanism is to construct a specified object through a string parameter. Through the reflection mechanism, we can know any class object, as well as its properties and methods. Dynamic proxy can realize new functions without changing the original code.

5. What is the difference between Integer and int types?

There are two types of data in Java, one is primitive data type, one is reference type, Integer is an int package class, its default value is null, int is primitive data type, and its default value is 0.

Published 143 original articles · 75 praises · 30,000+ views

Guess you like

Origin blog.csdn.net/qq_43199016/article/details/105426706