An ordinary Android programmer worked hard to summarize eight interviews with large and small factories, collecting a wave of expanded knowledge system!

Write in front

(The full text is about 4k words)
A total of 8 companies (2 small, 4 medium, 2 large factories)

All the small ones were taken, 3 out of 4 in one round and 1 in three rounds. The two big ones have talked about salary.

Small companies tend to focus more on business, and they also focus on business during interviews, such as what they have done, the general plan, which libraries are used, and the principles of the libraries.

These will basically focus on image processing, network packaging, and custom view.

Dachang will start from the business and go deep into the principles and related knowledge points, especially focusing on the principle part, where there are certain requirements for the usual source code reading.

Or ask directly if you have any knowledge of the xxx source code.

For example, a handler mechanism, because it involves a lot of places and is easy to deploy, if you want a perfect answer, it really can't be done once or twice.

It is recommended that every time the interview is finished, the interview content should be recalled and recorded in time. At present, this is not for leaking and missing questions. In the future, it is meaningless.

The purpose is to review and polish your answer.

table of Contents

  • Resume writing
  • Original interview questions
  • Algorithm brushing
  • summarize

Resume writing

It is strongly recommended that you put your own strengths and highlights on the front of your resume . Everyone is busy and irritable, so that people can see the advantages at a glance and are friendly to both parties.

Because I am interested in Android performance optimization, and I usually spend a lot of time working here, so I will highlight on my resume that I have done memory optimization, and I am proficient in using xxx, and memory performance has improved xxx.

(Because the content here is controllable, if the interviewer is interested in you, you can also prepare the answer in advance)

How to write project experience? It is recommended to write according to what is, what is done, and what data indicators are supporting.

For example, I made xx project, responsible for xx module, and used xxx framework, which can cooperate with xx to do xxx, which improves efficiency by xxx%

Interview-byte

Byte round

1. Talk about your resume first.

2. Talk about performance optimization. I will systematically talk about lag, weight loss, memory, crash and other optimization experience.

3. What is the difference between sychronized and volatile?
Here can be a systematic answer, mainly from the perspective of JMM to answer, and finally deep into the difference between bytecode level. Because there is a difference in the scope of modification, there is the next question.

4. What is the difference in the effect of the lock object.

5. Talk about the Handler mechanism.
This question has been asked too much, so be sure to check the source code.
The key answer is MessageQueue, including when it is idle and blocked.
Divergent talk about thread-related ThreadLocal, and IdleHandler

6. There is a design question. When your service provider has a problem, design a plan for network availability.
Probably answer from HttpDNS, domain name disaster tolerance and so on.

7. Design a plan, the apk has been sent out, the java code is the latest, but the so file issued by the subcontract is an old version, how to make a compatible plan to ensure compatibility and availability.
There is no answer here, and I forgot how to answer it.

8. Java class loading mechanism.

This is a basic concept question. If you didn't answer it well, the parent loading mechanism of the answer.
Then lead to the difference between PathClassLoader and DexClassLoader, the loading process of a dex into a java class.

9. An algorithm problem.

Byte two round

1. Talk about resumes.

2. Performance optimization, expanded to talk about lag and memory.

3. The question of data structure, hashCode's perturbation algorithm, involves a number, 31. How does this 31 come from?

4. The static attribute field of the class, such as public static int a = 1, is assigned how many times?
This requires an understanding of the loading mechanism of the class.

5. Multiple activities jointly bind a service, an Activity destroy, and ask about the service.
Here is to ask about the life cycle of the service and examine the difference between bind and start.

6. The decorator mode is different from the proxy mode.
Examine common design patterns

7. okhttp cache logic implementation.
I thought it was about link caching and io caching. What I answered was connection pool reuse and okio's io reuse.
Later, when the reminder was cache, I answered CacheInterceptor and its source code implementation.

8. The difference between Commit and Apply of SharedPreference.

9. The performance problem of SharedPreference.
The anr of apply has a field that blocks the main thread and needs to clean up the queuedWork queue.

10. SharedPreference thread safety, and whether the process is safe, who is the target of SharedPreference lock?

11. Synchornized lock object, implemented in assembly. The compilation of volatile.

12. Can volatile modify boolean guarantee atomicity?

13. What kinds of animations does Android have.

14. Design questions, design a buried point data reporting library, which modules are needed, and which interfaces are provided.

15. Algorithmic problem, production consumer model.

16. The correlation of ConcurrentHashMap.
Including the implementation principle, put method, treeing, expansion, who inherited it, and how the remaining buckets perceive when expanding.

17. The difference between Android packaging signature v1, v2, and v3.

Byte three rounds

1. The difference between decorator mode and adapter mode. Give an example of an application in Android or java.
2. The advantages and disadvantages of singletons.
3. Has the architecture been done?
4. Talk about the project, the things in the project that best reflect your ability.
5. How do you usually learn.
6. Future career planning
7. Reasons for resignation
8. Plug-inization. Have you ever done plug-inization? What mainstream solutions do you understand?
9. Algorithmic questions.

Because the third round was suspended, I got out and changed positions to fight again.

Byte Supper Round (This round took 175 minutes, which is deep in memory)

Basic topic

1. Talk about the performance optimizations that have been done in general.

2. Interface
stuttering Start from the ViewStub source code to talk about the entire process of LayoutInflate,
including xml parsing, how to parse tags, and the details to which special tags are inside.

3. What are the time-consuming aspects of xml parsing, reflection, file reading, and parsing.

4. How to optimize this process: xml is generated as a class file during compilation, then this is the stage of gradle compilation to do this.

5. The problem of checkthread, from Window to the creation of ViewRootImpl, and the relationship between them.

The above is related to drawing, then rendering.

6. The principle of vector diagram.

7. How did canvas come from?

8. The relationship between Window and View.

9. The principle of hardware acceleration.

10. Double buffering mechanism.

11. Reasons for frame loss.

12. Calculation of the number of frames.

13. Design tools for how to detect over-drawing, which should be specific to View.

14. Blockcanary principle and purpose.

15. Sliding optimization of Listview, for example, an emoji can be rendered with TextView or ImageView, which is better.

16. Why does Toast display without permission.

17. The reason for Window BadTokenExcetion.

18. How to realize the floating window.

Start acceleration

1. How to do app startup acceleration

My answer said that using IntentService is an asynchronous loading mechanism. But it is not enough.

2. Guide me to start with the app startup process to see if I can find a way from the startup process.

3. The internal implementation of zygote, do you know about zygote.fork?

4. What is the communication method between zygote and ams.

5. What does mHandler do during the entire startup process.

6. Design a tool to monitor the startup time, and the granularity is required at the method level.

Memory related

1. Talk about memory leaks. Take the anonymous inner class of the handler as an example. What is the leak chain.

2. What did looper.prepare do.

3. Implementation of ThreadLocalMap.

4. Leakcanary principle.

5. Why do you need to check the jitter and what is the use?

6. Why is there jitter.

7. There are leaks online, how to collect, investigate, and design solutions.

stability

1. Methodology for solving online stability bugs.

2. Talk about a case of solving online bugs that can reflect the highlights.

3. Give a specific case, let me analyze the reason on site.

Mainly examine the way of thinking.

4. How to collect java crashes.

5. How to collect native crashes.

6. With thread-safe data structure, will ConcurrentHashMap modifyCountException?

ANR related

1. How to solve common anr problems.

2. Uncommon anr, such as MessageQueue.nativePollOnce, is normal, how to locate it, if it is online, how to collect it.

3. Reasons for ANR

4. IntentService will ANR, talk about internal implementation.

Keep-alive related issues

1. The source code of the kill process mechanism.
2. Process priority.
3. How to increase the priority.
4. Common means of keeping alive.

I'm here to focus on Tim's keep-alive principle. There is also the principle of the third-party library Leonic.

App slimming related

1. andRes principle.
2. Proguard source code.
3. Facebook's redex, bytex principle of bytes.
4. Multidex principle.
5. Many resource packs, how to lose weight.

Asked about the github library I maintain

1. Anti-multiple opening principle
2. Detection simulator principle
3. Check root authority, if it is a self-edited rom, how to deal with it.

Talked about the experience in the resume

1. The initial timing of contentProvider.

The main question here is to ask me what is the difference between LeakCanary 1.* and 2.*.

2. The difference between LocalBroadcast and Broadcast.

3. The principle of xposed.

4.BeforeMethodHooked, what did xposed do internally

5. The source code implementation of the legend without root hook framework.
I can't remember clearly, it seems I am talking about the change of native method pointer.

6. An algorithm.

7. Design a buried point library. What modules are needed.

8. Design a component to count the activity's front desk time and fragment's front desk time.

I forgot to record the replay in the follow-up interview of BYTE, and I can't remember it now. This round of interviews squeezed me out anyway.

Finally enter the salary negotiation stage. I just didn't agree, haha.

Interview-Goose Factory

The last is the Yuehai doll factory that I always wanted to go to.

I won’t elaborate on the specific round of interviews here. The topics are actually those topics, so let’s focus on providing directions for learning.

1. Talk about resumes and optimize performance.

2. The drawing process of view should be as detailed as possible and comprehensive, the better.
Because of the previous interview experience of Byte, I talked a lot about view here.

Probably starting from ActivityThread, to the
internal implementation of Window, WindowManager, ViewRootImpl, setContentView, LayoutInflater.

Send to requestLayout, checkThread, scheduleTraversals, synchronization barrier message
double buffering, vsync signal, and finally performSechdules...

This is really asking myself not only to write the interface, but also to learn the source code.
Many weird business problems are really solved by reading the source code.

3. Ask for network optimization, when the network bandwidth is large enough and the signal is good enough, how fast is it to download large files?

Open multiple links, wifi+4G at the same time, split.
At the protocol layer, go to udp and perform integrity verification locally. I remember doing this in the qq client.
The idea of ​​m3u8 goes down.

4. Apk security measures, when the apk has been cracked, how to deal with it?
I replied that with the help of the v1 signature idea, the local verification of the file md5 is done. Or with the help of v3, continuous signatures.

5. The difference between the two design patterns. I have forgotten which two.

6. Three algorithmic questions

The first topic is to write a code that is bound to deadlock. Talk about the way to solve the deadlock. The difference between the lock objects.

The first character to appear.

The elements in the array are combined to find the maximum value.

7. When is the thread in checkThread assigned?

8. Tell me what a digital certificate is.

9. Solve the actual case of memory jitter.

10. Actual cases of reducing bugs.

11. Design a plan for how to handle dirty data received by the app from the server.

12. Design a cloud photo album.

13. The principle of the classLoader mechanism.

14. The underlying implementation of hardware acceleration.

15. Operating system related issues.

16. How to deal with multilingual issues.

17. Jvm virtual machine related issues, specifically forgot.

18. Career planning related.

Finally, everyone is welcome to come to the goose factory, one thing is not bragging, the colleagues here are really good.

About the algorithm

To say a few more words, the client must learn the algorithm, not that the algorithm is useless, you know what tree traversal is, you can understand the viewTree parsing process.

And when everyone is at a different level, use algorithms to return to the same level to see who has strong logic and good coding style. This is good for interview screening.

Everyone would say, should I use high numbers for grocery shopping? But if you don't, it's a loss in the interview.

The topic, my algorithm brushes the way.

Get started with an offer: https://cyc2018.github.io/CS-Notes/#/README

There are a lot of questions in it. You can see various solutions in the Likou comment area. It is recommended to read more solutions to experience different ideas.

The way to brush the questions, you must write the code by yourself, debug, and run.

You can create a small library yourself and urge you to submit it.

By the way, I also reviewed common design patterns.

After almost finishing the basic sorting, traversal, greedy, and local optimal thinking, there will be a hundred questions.

At this time, facing the interview, I am familiar with it. I really don't recommend using a surprise approach, we should make a long-term plan for writing questions.

summarize

I took lock-related, thread-related, Handler mechanism and other Android-related knowledge, started with the topic, and made an index that I usually study in a progressive and divergent way.

Android Advanced Architect Seven Subject Learning Index

There are so many knowledge points in client development, and there are still so little things in the interview. Therefore, there are no other tricks for the interview, just to see how well you prepare for these knowledge points. So, when you go out for an interview, it is good to see which stage you have reached in your review.

System learning direction:

  • Essential skills for architects: in-depth Java generics + annotations in simple language + concurrent programming + data transmission and serialization + Java virtual machine principle + reflection and class loading + dynamic proxy + efficient IO
  • Android advanced UI and FrameWork source code: advanced UI promotion + Framework kernel analysis + Android component kernel + data persistence
  • 360° overall performance tuning: design ideas and code quality optimization + program performance optimization + development efficiency optimization
  • Interpretation of open source framework design ideas: hot repair design + plug-in framework interpretation + component framework design + image loading framework + network access framework design + RXJava responsive programming framework design + IOC architecture design + Android architecture component Jetpack
  • NDK module development: NDK basic knowledge system + underlying image processing + audio and video development
  • WeChat Mini Program: Mini Program Introduction + UI Development + API Operation + WeChat Docking
  • Hybrid development and Flutter: Html5 project combat + Flutter advanced

I also summarized an index of common data structures

Java Learning Index

The next step is to go deep into the app startup, rendering, AMS and other issues to do a centralized index.

Android framework learning index

My own Android source code reading

Android source code learning index

"Programming language is the way the programmer expresses, and the architecture is the programmer's perception of the world." Therefore, if programmers want to quickly understand and learn the architecture, reading the source code is essential. Reading the source code is to solve problems + understand things, and more importantly: see the ideas behind the source code; programmers say: read thousands of lines of source code, and practice thousands of ways.

Organized interview-oriented reading notes from third-party libraries

The content is detailed, covering various source code libraries related to Android development. It not only analyzes the source code in a simple way, but also records the problems encountered by the big guys when using it, and provides solutions.

It is divided into ten chapters, including detailed analysis of the source code of Glide, LeakCanary, ARouter, EventBus, and Retrofit, as well as their use, and some problems that are easy to encounter.

The above content is free to share with everyone, friends who need the full version, click here to see all the content .

Guess you like

Origin blog.csdn.net/weixin_44339238/article/details/112247188