Interview company: Xiamen MOU Communication Technology Insurance Company

Interview questions:

1. What kind of class are you familiar with when programming strings?

My answer: Use String. References: blog.csdn.net/qq_37358860…

2. Have you used StringBuffer and StringBuilder?

My response: StringBuilder is more efficient than StringBuffer. I use it less often. I use String more often.

3. What about StringBuilder?

My answer: StringBuilder can be modified, String cannot. StringBuffer is more efficient than StringBuilder, which is new to JDK1.5. (See Question 1 references for details)

4. You just mentioned that String cannot be modified. Why can’t it be modified?

A: String cannot be modified means that the reference address cannot be modified, for example: String s = “abd”; S = “ABD”; In this case, from “abd” to “abd”, s is simply a reference object that points to a string object “abd”. The meaning of the second line of code is to redirect S to a new string object “abd”, but it has become an unreachable object. Or the JVM generates two new strings, abd and ABD, and S simply changes the referenced object, not the value of any string between them.

5. What are the common methods in String?

.length(); // Get the length of the string. Char (); // Equals (); // Compare the current string with the argument string, returning true if the two strings are equal, false.indexof () otherwise; // Find the character or substring in the current string, return the character or substring in the current string, etc.

6. Write the number of occurrences of A, B, and C in the string AABBC. (Code required for interview)

7. What is Oauth2?

A: OAuth2 (Open Authorization) is an open standard that allows users to authorize third-party mobile applications to access their information stored on another service provider without having to provide user names and passwords to third-party mobile applications or share all the content of their data; If your Baidu account can be logged in through your registered QQ account, access to the same rights as baidu account after registration.

8. What frameworks are useful for projects you are familiar with and introduce one that you are most familiar with?

A: Spring is a lightweight open source framework based on IOC (Inversion of Control) and AOP (Aspect oriented Programming). IOC means that the spring framework manages the manually created objects in the program. AOP is based on dynamic proxies. If the object to be propped implements an interface, Spring uses JDK dynamic proxies. If the object to be propped does not implement an interface, Spring uses Cglib dynamic proxies to generate a subclass of the propped object. . , etc.

9. What are the familiar spring annotations?

A: @Component: used on classes to instantiate beans () @Repository: used on dao layer classes to instantiate beans (Repository) @Controller: Used on Web layer to instantiate beans (web) @Service: Used to instantiate beans (service) @beans on servi layer classes: Identifies a method used to configure and initialize a new object managed by the SpringIoc container, similar to an XML configuration file, usually in coordination with @configration using @requestMapping: Writing string data back, etc. References: blog.csdn.net/weixin_4210…

10. Which label is used to configure a bean parameter injection in Spring XML?

A: Bean tags

11. Tell me your understanding of Spring’s transaction propagation mechanism.

To create a new transaction if there is no transaction currently. To join a transaction if there is one already in existence. This is the most common choice. Propagation_supports: Supports the current transaction. If there is no current transaction, execute as a non-transactional method. Propagation_mandatory: Use the current transaction, or throw an exception if there is no current transaction. Propagation_required_new: Create a transaction, and suspend the current transaction, if one exists. Propagation_not_supported: Executes an operation in a non-transactional manner, and suspends the current transaction, if one exists. Propagation_never: Executes an operation in a non-transactional manner, throws an exception if the current transaction exists. Propagation_nested: Executes within a nested transaction if a transaction currently exists. If the current does not transaction execution and propagation_required for similar operations References: www.cnblogs.com/myseries/p/…

12. Which selectors have you used?

A: Class selector ID selector Element selector etc. References: www.cnblogs.com/s-1314-521/…

13. What are the common Linux commands?

CD // Switch the directory CD.// Indicates the current directory CD.. / / is the location of the current directory at the next higher level for the clear / / clear screen PWD / / display the current path date/date/ll / / detailed information: lists the current file or directory, and so on References: www.cnblogs.com/xuxinstyle/… : www.linuxcool.com/.

14. What is your understanding of polymorphism?

A: Multiple forms of the same thing at different times. A superclass reference refers to a subclass object. A superclass reference can be used as an argument to receive a subclass object. An interface reference can be used as an argument to receive an implementation object. Prerequisite: There must be a relationship between classes, either inherited or implemented. You have to have a way to rewrite it. A parent class or interface reference points to a subclass object. Polymorphism can be implemented in two ways. 1 is implemented through an interface and a parent class reference points to a subclass object. A subclass inherits and overrides the methods of its parent class.

15. What is the difference between overwriting and overloading?

Answer: Method overloading and overwriting are both ways of implementing polymorphism, the difference being that overloading implements compile-time polymorphism, while overwriting implements runtime polymorphism. Overloading occurs when a method with the same name has different argument lists (different parameter types, different number of arguments, or both) and is considered overloaded. Overrides occur between a subclass and a parent class. Overrides require that the subclass overridden method has the same return type as the parent overridden method, is more accessible than the parent overridden method, and cannot declare more exceptions than the parent overridden method. Overloading has no special requirements for return types.

16. What is Dubbo? How does it all work?

A: Dubbo is an ali open source high-performance, lightweight RPC architecture. Used for remote calls across a network, such as a front-end service calling a server over a network.

17. What is rabbitMQ and how is it used in a project?

A: rabbitMQ can use application decoupling, traffic peaking, and asynchronous processing. For example, in A second kill scenario, using rabbitMQ to initiate A peak shaving function, the client will send the request message directly to rabbitMQ, and the system will consume the request in rabbitMQ to reach the peak shaving purpose.

18. What is your understanding of rabbitMQ for distributed transactions?

A: For example, in a payment scenario in a project, ensure data consistency when paying multiple servers to consume rabbitMQ.

19. Introduce Redis and what are the application scenarios in the project?

A: Redis is an open source high performance slave key-value pair database (i.e., non-relational database) that can support 10W requests and supports rich data types such as list, set, Zset, Hash, and String. Application scenarios include caching (news content, product content, data query), chatting online friend list, task queue (seckill, snap up, 12306, etc.), application ranking, website visit statistics, data expiration processing (accurate to milliseconds), and session separation in distributed cluster architecture.

If have what wrong place to ask everybody big guy to remind small white me! Whisper and ask what kind of difficult interview do you think this is?