Current location - Quotes Website - Signature design - As an interviewer, what questions would I ask junior java engineers?
As an interviewer, what questions would I ask junior java engineers?
Junior java engineers are mostly newcomers who have just graduated or worked for 1 or 2 years. For newcomers, the interview will ask many basic questions, because the foundation of this person must be examined first.

On the basic topic, when interviewing junior java engineers, I usually ask the following two questions, five questions each, so that I can basically understand the level of engineers.

Java basic class

Object-oriented basic class

Java basic class

1. Describe the access modifiers of java and the differences between them?

Answer: if it can return to public ownership, private ownership and protection, it is ok; If you answer by default, you will get extra points.

What's the difference between 2.int and Integer?

Answer: If the answer is that Integer is the wrapper class of int, then OK; Answer other basic types and their corresponding packaging classes, and score.

3. How to define a single-precision floating-point variable?

Answer: floating-point variable name =1.2f; If the answer is a double-precision floating-point type, without adding the last f, you will get extra points.

4. What is the difference between 4.equals and = =?

Answer: equals is a value comparison (generally speaking, it is ok when dealing with java development) and = = is a reference comparison (or an object comparison); The answer equal sign can be customized and added points.

5. Pass the array as a parameter to the method. In the method, the values of the elements in the array are changed. Besides methods, are the elements in the array adaptive?

Answer: Yes, because references are passed in java methods, you can. If you answer, you will quote to explain your understanding and add points.

Object-oriented basic class

1. What's the difference between overloading and rewriting?

Answer: this depends on personal understanding, and understanding is ok without any big deviation; If the answer is polymorphic, add points.

2. Can the constructor be overloaded?

Answer: it can be overloaded, ok; You can't inherit when answering the constructor, so if you want to call the specified parent constructor, you must rewrite the subclass constructor to get extra points.

3. Can abstract methods be modified by final, static and native?

Answer: No, because abstract methods must be implemented by subclasses, and final methods cannot be overridden. Static is a method that must be implemented by the parent class, and native is a method implemented by the local language. Answer questions related to encapsulation and inheritance, and get extra points.

4. When the reference of the parent class points to the object of the subclass, the subclass rewrites the methods and properties of the parent class, so when accessing the properties, whose properties are accessed? When calling a method, whose method is called?

Answer: I visited the property of the parent class and called the method of the subclass, OK; If you can draw a picture, add points.

5. What are the similarities and differences between abstract classes and interfaces?

Answer: Some classes have different definitions, OK; Answer how to define the interface according to the business in the application process, which adds a lot of points.

Finally, if the previous question is answered correctly, two programming habit questions will be added.

1. Have you ever written more than two loops in your code? How did you do that?

Answer: no, even ok; If the answer is yes, listen to the realization, if the reason can't be said, deduct points.

2. In the code you write, if statements are nested at most several layers and at most several branches. How is it realized?

Answer: below 3 floors, even if it is ok; If the answer is above level 3, listen to the realization. Deduct money if you can't tell the reason.

4, 5 branches, even if OK; If you answer more than 5 branches, listen to the realization. Deduct money if you can't tell the reason.

The latter two questions are actually traps, but they are a kind of reverse thinking, which can understand the interviewer's previous work status.

If the interviewer has good habits on weekdays, there is no need to worry.