Android development menu! How can anxious mobile Internet developers break the game? Check out this article!

Is the programmer's career really short?

Not short, I am proof! I am 44 years old, a Fortune 500 company, programming for 20 years, and a software technology expert. I have always been in the front line of programming and have never left. Technically, I have used Java, .net, Js, etc. deeply. Maybe, I barely counted as the last "full stack engineer".

I think many answers say that the reason why programmers do not work long is because experience is not worth money. Old programmers and young people are no different, and they cannot work overtime, so they are naturally not seen by the boss. I especially don't understand why some people believe such ridiculous and illogical remarks. I can say with certainty that in the software development industry, as long as time is not wasted, time will give you rich returns and will establish sufficient thresholds to ensure that you are on this track for a long time.

To a large extent, programmers are a "copy and paste" profession, because most programmers in most companies will not encounter unique problems at work. The problems we have encountered have long been The mature answer, the so-called research process, is not to invent the answer, but to discover the answer.

Interview Department + Position : Commercialization-Senior Android Development Engineer
Interview Feelings : The overall face is relatively tired, basic face, cross face, Boss face, and 6 interviewers (from the 3 sides that I told me at the beginning + HR The face seems to be a little far worse (¬_¬). The algorithm is still being written to the boss, but fortunately the interviewer did not embarrass me (I honestly explained that the algorithm didn't prepare much, hey...), the algorithm is not too difficult. The overall project has more questions than the basics.
Interview suggestions : Algorithms and foundations are the stepping stone, projects are touchstones, and a good interview image is a bonus item.
Think about the items listed on your resume, why did you do this project? What is the goal of this project? What is my plan? What are my advantages over other programs? What are the benefits of the project? Can the project architecture diagram be drawn? Are the main framework principles used in the project clear before and after? (I probably saved myself from the project, and the basic preparation is a bit hasty T^T).
If it is an on-site or video interview, a good interview image is still more necessary. In the department TL interview, I mentioned that my better than many other interviewers is that the image of the whole person is better, and it does not make people feel very tired.

[ 1 side-basic side ]

  1. When you developed Android, how did you adapt the px of the UI draft?
  • dpi: Screen pixel density, refers to the number of pixels per unit size specified on the system software , it is often a fixed value written in the system factory configuration file;
  • ppi: It is also the pixel density of the screen, but this is a physical concept, and it exists objectively and will not change. dpi is a value manually specified by the software after referring to the physical pixel density, which ensures that the physical pixel density in a certain interval uses the same value on the software;
  • dp plus adaptive layout and weight proportional layout can solve 90% of the adaptation problems . Because not all 1080P mobile phones have a dpi of 480, for example, the dpi of Google’s Pixel2 (1920*1080) is 420;
  • Width and height qualifier adaptation: Exhaust the width and height pixel values ​​of all Android phones on the market, set a reference resolution, and other resolutions are calculated based on this reference resolution. In different size folders, according to Write the corresponding dimens file for this size. But it has a fatal flaw, that is, it needs to be accurately hit to fit, and the size of the App package will also become larger.
  1. Two Integer objects with equal values, == compare to determine whether they are equal?

  2. Activity A jumps to Activity B, Activity B then presses the back key to go back, the life cycle of the two processes

  • In the process of ActivityA jumping to ActivityB, the execution order of their respective life cycles. For example: A.onCreate A.onStart A.onPause A.onStop B.onCreate B.onStart B.onPause B.onStop B.onDestroy?
    ActivityA and ActivityB life cycle execution order is as follows: A.onPause -> B.onCreate -> B .onStart-> B.onResume-> A.onStop
  • ActivityB press the back button?
    After pressing the back key: B.onPause->A.onRestart->A.onStart->A.onResume->B.onStop->B.onDestory
  • When ActivityB is a window Activity, what about the conclusions of 1 and 2?
    If ActivityB is a window, when ActivityA jumps to ActivityB, the part of ActivityA that loses focus is visible, so onStop will not be called. At this time, the life cycle sequence: A.onPause -> B.onCreate -> B.onStart -> B.onResume is
    pressed After the Back key: B.onPause->A.onResume->B.onStop->B.onDestory
  • Will onCreate be called when switching between horizontal and vertical screens? several times?
    When the program is running, the configuration of some devices may change, such as: switching between horizontal and vertical screens, keyboard availability or language switching, etc. At this time, Activity will restart. The process is: before destroying, it will call onSaveInstancestate() to save some data in the application, then call onDestory(), and finally call onCreate() or onRestoreInstanceState to restart Activiy. When switching screens, each life cycle will be called again. OnCreate will be executed once when switching to a horizontal screen, and onCreate will be executed twice when switching to a vertical screen.
  1. Can child threads be context.startActivity() (such as ApplicationContext), will there be any problems?

It is possible to write a demo and try it. But what will be the problem hasn’t been figured out yet...

  1. The overall process of the Handler mechanism; why Looper.loop() does not block the main thread; IdHandler (idle-time mechanism); the specific implementation of postDelay(); the difference between post() and sendMessage(); what problems need to be paid attention to when using Handler and how to solve it ?

The questions are very detailed, so you can prepare as much as you can. They encapsulated a set of Handlers to avoid memory leaks

  1. When Native, H5, and RN pages are mixed to jump, how does the page clearing bridge work?

For a project made by yourself, just explain the principle clearly, and draw the picture if you don’t explain it clearly.

  1. How to calculate the percentage of the visible part of a View on the screen?

  2. ClassLoader's parent delegation mechanism

  3. Briefly introduce the principle of Https

  4. What causes the memory leak and how to fix it?

  5. How can I ensure that I download a large picture without oom?

  6. Have you done any UI optimization and what have you done?

  • Debug GPU overdraw, reduce Overdraw to a reasonable range;
  • Reduce the nesting level and the number of controls, keep the tree structure of the view as flat as possible (use Hierarchy Viewer for easy viewing), and remove all views that do not need to be rendered;
  • Use GPU to configure the rendering tool, locate the specific step where the problem occurred, and use TraceView to accurately locate the code;
  • Use tags, merge to reduce nesting levels, viewStub delayed initialization, reuse of include layout (used with merge)
  1. What is the difference between WebView and JS interaction, shouldOverrideUrlLoading, onJsPrompt use

  2. Have you been in contact with Flutter and Kotlin?

  3. Other project related issues

  4. Algorithm-Binary tree outputs node elements at level k

2 Sides-Project Special

  1. When the Native, H5, and RN pages are mixed to jump, the page clearing bridge is implemented

  2. Design and Difficulties of Page Hybrid Framework

  3. Design of RN universal container

  4. User behavior monitoring program design

  5. JS error management program

  6. RN page monitors user behavior and JS error management, what are the gains and optimization points of problem discovery

  7. What are the advantages of Meituan RN over native RN

[ 3 sides-deepened foundation ]

  1. Have you ever used Picasso in your company? Let’s introduce

  2. Picasso single engine, how to ensure data isolation in the case of multiple Bundles?

  3. The difference between Meituan RN and Picasso

4. Omit some project related issues...

  1. How RN's page tracking is implemented

  2. Is the Meituan homepage an RN page? MTFlexBox principle

  3. Synchronized modified static method, ordinary method, class, method block difference

  4. Synchronized underlying implementation principle

  5. The role and principle of volatile

  6. An int variable is modified with volatile and multi-threaded to operate i++. Is it thread safe? How to ensure i++ thread safety? The underlying realization principle of AtomicInteger?

Use AtomicInteger to make i++ thread safe

  1. Talk about the understanding of the thread pool, and several key parameters to create the thread pool

  2. The Handler mechanism asks again...

  3. What is the difference between the Binder mechanism and the memory sharing mechanism?

  4. Java collection, introduce the usage scenarios of ArrayList and HashMap, and the underlying implementation principle

  5. The difference between ArrayList and LinkedList

  6. Algorithm-the merging of two ordered linked lists

  7. Algorithm-Input a string (excluding * and .), regular (any combination of letters, * and .), and judge whether the string is legal

  8. Briefly introduce some technical difficulties encountered in the project

4 Sides-Crossing Sides

  1. In the following code, what is the final value of str? What is the value of Integer? Will it be changed?
  • Test site : Java value transfer (same for question 2). Write a code test, modify the input parameters in the changeValue() method, and it will not change the previous value;
  • Principle : The method gets a copy of all parameter values, that is, the method cannot modify the content of any parameter variable passed to it. The basic type parameter is passed a copy of the parameter, and the object type parameter is a copy of the object address;
  • Solution : In changeValue(), for the object type parameter, directly modify the value of the object address copy , so the address of the variable has not been modified before! If you modify a value in the object instance, the previous variable will be modified
public void test() {
    String str = "123";
    changeValue(str); 
    System.out.println("str值为: " + str);  // str未被改变,str = "123"
}

public changeValue(String str) {
    str = "abc";
}

  1. In the following code, does it need to be null when using the object student again?

Summary of the usage of method parameters in Java:

  • A method cannot modify a parameter of a basic data type (ie numeric or boolean);
  • A method can change the state of an object parameter;
  • A method cannot let the object parameter refer to a new object
public void test()  {
    Student student = new Student("Bobo", 15);
    changeValue1(student);   // student值未改变,不为null! 输出结果 student值为 name:Bobo、age:15
    // changeValue2(student);  // student值被改变,输出结果 student值为 name:Lily、age:20
    System.out.println("student值为 name: " + student.name + "、age:" + student.age);
}

public changeValue1(Student student) {
    student = null;
}

public static void changeValue2(Student student)  {    
     student.name = "Lily";    
     student.age = 20;
}

  1. Several types of references in Java, and the use scenarios of weak references?

  2. Thread pool classification, explain a few core parameters?

  3. What is the packaging process of APK?

  • The aapt tool packs resource files and generates R.java file
  • The aidl tool processes AIDL files and generates corresponding .java files
  • The javac tool compiles the Java file and generates the corresponding .class file
  • Convert .class files into .dex files supported by Davik VM
  • The apkbuilder tool is packaged to generate an unsigned .apk file
  • jarsigner signs unsigned .apk files
  • The zipalign tool aligns the signed .apk file
  1. Why do APKs need to be signed? Have you learned about the specific signature mechanism?

In order to confirm the identity of the apk developer and prevent tampering of the content, Android has designed a set of apk signature schemes to ensure the security of the apk, that is, the developer signs the apk when packaging, and the Android system will have corresponding development when the apk is installed To verify the correctness of the user’s identity and content, the apk can be installed only after the verification is passed. The design of the signature process and verification is based on the idea of ​​asymmetric encryption.
A set of signature schemes used by Android before 7.0: generate signature files in the META-INF/ folder in the root directory of the apk, and then verify the signature files in the system's PackageManagerService during installation.
Starting from 7.0, Android provides a new V2 signature scheme: using the apk (zip) compressed file format, a data area for storing signature information is added to the original content area, and then the same in the system during installation The V2 version of the signature verification is performed in the PackageManagerService. The V2 solution will be more secure and make the verification faster and faster to install.
Of course, the V2 signature scheme will be backward compatible. If the V2 signature is not used, it will default to the verification process of the V1 signature scheme.

  1. Why divide dex? SDK 21 does not divide dex, will there be any problem with loading all directly?

Seek the right answer from the passing gods...

  1. What are the common design patterns? What design patterns did you use for the JS error management solution you provided?

  2. Algorithm-Binary tree layer order traversal, odd-numbered layer reverse order traversal of nodes, even-numbered layer positive order traversal

  3. What is the plan for the next 3 to 5 years?

  4. What do you think are your strengths? What are the disadvantages?

  5. What is the current rank and recent performance

5 Sides-Department TL

  1. Business introduction related to the commercialization department (the core is probably that the commercialization department has high barriers, the cost of training a person is high, and it is more valuable than doing other businesses, and can accumulate a lot of business strategy knowledge), and then ask him to ask questions

  2. Planning for the next few years? What's the plan in life?

  3. What do you think are your strengths? What are the disadvantages?

  4. What is the current rank and recent performance

  5. Why give you such a good performance?

  6. Are there any other opportunities? The situation of Ali interview

6 sides-Big Boss

  1. Algorithm-array insertion, consider expansion

  2. What are the more challenging things encountered in the project?

  3. What are your business in Meituan?

  4. What are the plans for the next few years?

  5. What do you think are your strengths? What are the disadvantages?

  6. What is the current rank and recent performance

[HR surface]

  1. Both undergraduate and graduate majors are partial to hardware. Do you have relevant software experience?

  2. Are postgraduates undergraduate or take the exam by themselves?

  3. Do you have Android development experience before going to Meituan?

  4. Why did you choose to go to Meituan? Why choose to come to Beijing?

  5. Why change jobs? What are your expectations for your future work?

Golden sentence: Now I have encountered a bottleneck in my technology growth, and I have always admired your company.

  1. What is the recent performance for your current rank?

  2. With such a good performance, why not choose Meituan to change departments to see opportunities?

  3. What was the highlight of the performance during several promotions?

  4. Where is the home? Are there any plans to go home and develop there?

  5. Are you planning to see job opportunities like Kuaishou again?

  6. Ask some about Ali's current interview progress and situation

  7. Expected salary

At last

Students who want to know more about Dachang’s interview can ** click here to get the "Interview Document" for free** In addition, I also share some free high-quality resources, including: Android learning PDF + architecture video + source notes , advanced Architecture technology advanced brain map, Android development interview topic materials, advanced advanced architecture materials these pieces of content. Share with everyone, it is very suitable for friends who have interviews in the near future and want to continue to improve on the road of technology. Come and get learning materials~

Guess you like

Origin blog.csdn.net/m0_53537576/article/details/113093354