Preface:
Due to the isolation of the new coronavirus, I left my job last year and now I have no way to find a job. I have stayed in Shenzhen for more than a month. A lot of outsourcing companies say hello to each other after announcing their resumes in early March. Because of their external outsourcing company impression is not good so refused a lot of job interviews in recent days interviewed several research product companies, so the interview questions do a summary!
To get down to business:
-
I see you are proficient in Gosn and FastJson on your resume. Can you talk about other differences? FastJson is a high-performance Json parser developed by Alibaba. Both of them are dependency free, do not need to exception additional JAR, can run directly on the JDK! Parsing process: Gosn: The type and members of the object must be created before the JSON string can be successfully converted into the corresponding object. FastJson: There are some problems in converting JSON from complex type beans. The referenced type may appear, leading to error in JSON conversion. FastJson uses an original algorithm that makes Parse faster than any OTHER JSON library.
-
2 since you know that FastJson performance is better than Gson, do you have any in-depth understanding of the reason? FastJson performance optimization is an internal use of the for loop…
-
Tell me about a common layout you use in projects. Why do you use it? Because the layout I used the most in my last company was basically ConstraintLayout why do I use that? ConstraintLayout The reason is simple: reduce layout levels, optimize rendering performance, use flexibility, etc
-
Can you talk about the MVP mode? What are the benefits? MVP evolved from the classic MVC pattern. Their basic ideas are similar: Controller/Presenter handles logic processing, Model provides data, and View displays.
-
5 Uploading Files See Uploading Files to the Server on Android (Android + Server)
-
Has the singleton pattern been used? What are the benefits of singletons?
- 1) Some classes are created frequently, which is a lot of overhead for some large objects.
- 2) The new operator is omitted to reduce the frequency of system memory usage and reduce GC pressure.
- 3) the core of the engine, some like exchange controls the transaction process, if the class can create multiple system totally messed up. (such as a military commander appeared multiple command at the same time, will certainly be a mess), so only use the singleton pattern, independent control of the entire process to ensure that the core transaction server.
Here are some questions:
-
Context is one of the core function classes that keep the Android application components working properly. Context is also the interface to global information in the application environment. Android memory leaks are caused by Context memory leaks. The Context leaks are caused by Context memory leaks.
- Involving various systems and APP resources, with too powerful functions,
- This leads to too many uses and confusion in the process and reference relationships
- 1. For example: asynchronous network requests, View animations, etc., are improperly processed in the process, resulting in failure to release
- 2. Haphazard value passing allows many objects to Hold a Context, opening up too many resources that cannot be reclaimed
- 3.Drawable objects and Bitmap objects are not recovered in time, or even bound to View
- 4. Abuse of singletons causes Context to be referenced for a long time
Solution: Use the Application Context when there is no need to pass values. This ensures that the Context can be used globally and does not create multiple copies. Avoid loop holding Context
-
8 What are the differences between Android Raw and Assets?
- Assets is a special Android directory for storing fixed files required by the APP, which are not encoded into binary files when packaged into APK. Android also has a raw directory placed under RES, which is different from assets. Notes: 1. Assets directory will not be mapped to R. Therefore, resources cannot be obtained through R.ID, and must be operated and obtained through AssetManager. Resources in the res/raw directory are mapped to R and can be obtained using the getResource() method. 2. Multi-level directory: Assets can contain multi-level directories, but RES/RAW cannot. 3. Encoding (none will be encoded) : resources in assets directory will not be binary encoded; Res/RAW should not be encoded either.
-
This topic is not familiar to bloggers, please refer to the Summary of Android hot fixes
-
How to optimize UI adaptation in Android? Refer to Hongyang Daishen’s blog on Android UI performance optimization to identify performance problems in drawing
-
11 which platforms have been posted refer to the blogger’s blog Android APK package reinforcement and upload review process
-
12 How to solve the Android model adaptation? Refer to Android Development: the most comprehensive and easy-to-understand Android screen adaptation solution
-
13. How to check the memory leak and how to solve it? Android memory leak causes and solutions
-
14 Questions: An array in ascending order good int [] array = {5, 1,0,5,9,11,13,15,22,35,46}, enter an x, int x = 31, find out in the data and the two Numbers for x, 9 + 22 = 31, for example, require the time complexity of the algorithm is O (n); Solutions:
public class GetNumber { public static void main(String[] args) { GetNumber gn = new GetNumber(); Int [] num = {-5, -1, 1, 3, 8, 9, 11, 15, 19, 20, 23, 25, 30, 35, 44}; Int a = 44; int[] x = gn.getNum(num, a); System.out.println(x[0]); System.out.println(x[1]); } public int[] getNum(int[] array, int x) { int headNum = 0; int footNum = array.length - 1; int[] newNum = new int[2]; for (int i = 0; i < array.length; i++) { if (array[headNum] + array[footNum] ! = x) { if (array[headNum] + array[footNum] < x) { headNum++; } else if (array[headNum] + array[footNum] > x) { footNum--; } } newNum[0] = array[headNum]; newNum[1] = array[footNum]; if (headNum >= footNum) { return newNum; } } return newNum; }} The command output is 9. The command output is 35Copy the code
Share with you
I want to work my way up
Fly forward on the blades at the highest point
Let the wind blow dry tears and sweat
I want to work my way up
Waiting for the sun to watch its face
Little days have big dreams
I have my day
Let the wind blow dry tears and sweat
One day I will have my day