Simply outrageous! Byte face 5 rounds, 4 rounds let me analyze the source code of the Android Framework layer

Speaking of ByteDance's interview experience, it really makes me feel a chill on my back now, and it is simply too uncomfortable to be tortured by the interviewer. Although I have been working for seven years, I am only writing business, and I don’t have a deep understanding of the bottom layer. The interview experience directly made me feel the gap between me and those first-line manufacturers. To be honest, it is really uncomfortable.

Let’s not say much, let’s review my interview experience in ByteDance. There are 5 rounds of interviews in total. As for the reason why I interviewed 5 rounds, maybe the interviewer still wants to try my skill level;

Although I didn't get the offer in the end, the interview experience made me more intuitively understand the gap between me and the big Android development company, which is quite profitable.

Byte Feishu client side

  • Talk about the Android boot process

I talked a lot, among them, the ServiceManager process is used to manage system services. The interviewer said you are sure? Isn't it the SystemServer process to manage system services? After some discussions, the interviewer was stunned, mentioned SystemUI service, mentioned the desktop process, and asked how to replace the boot-up animation?

  • How does the system help us start and find desktop applications

I said through intent, he said how to find which intent? I said that PMS will parse the AndroidManifest.xml of all apk. If it is parsed, it will be stored in package.xml and will not be parsed repeatedly. PMS can find it with it.

  • Talk about the loading of the dynamic status page, why do you do this?

I said that in order to reduce the time for xml parsing and reflection to create objects, and to avoid creating multiple unusable objects at the same time, I wrote a framework to dynamically add them with code. At this time, the interviewer misunderstood what I meant, thinking that all the interfaces were written in code. That would be too much trouble, and I explained it clearly later.

  • Talking about the page refresh mechanism, what do the color values ​​of the GPU debugging tool represent?

Speaking of the underlying management of Surface is actually IBPQ, the origin of the asynchronous signal is that SurfaceFlinger is sent by the hardware and software mechanism, and how the content drawn on our app interface is submitted and passed to SurfaceFlinger. The meaning of the several colors of the GPU debugging tool is also discussed.

  • Why does the transfer of objects between activities need to be serialized?

  • Do you know how okhttp reuses connections?

This is a network optimization problem. The same ip and the same port can multiplex a connection. Later, I asked about the multiplexing of http 2.0. I said that a tcp can have multiple requests. The principle? I said I don't know. Let me talk about https later.

  • Fast sorting and recursion (algorithm problems)

Generally speaking, on the one hand, the answer was good. Perhaps the interviewer thought I was underestimated. I seemed to be severely beaten in the next four rounds of interviews.

Two Sides of Byte Feishu Client

  • Talk about dynamic registration and static registration

Static registration is to find the method through the package name and function name, and dynamic registration is through the registration method table, which is also asked which function is called to register the method table.

  • What is the loading process of so and what is the life cycle?

This requires looking at the source code analysis from the java layer, which is loaded from the PathList of the ClassLoader to find the target path, and so is loaded and mapped to the virtual space through mmap. The JNI_OnLoad and JNI_OnUnload() methods are called when the library is loaded and unloaded during the life cycle.

  • How does the native layer detect memory leaks

I said that it is reasonable to hook the function, and the number of times of memory creation and memory release should be the same. If they are different, memory leaks can be suspected. The interviewer then asked if there are any third-party tools or libraries that can be tested? I said that I actually didn't write much in the company. I don't know what framework the engine group integrates. I am mainly good at application layer development.

  • Please briefly describe the startup process of Zygote

  • Please analyze the role of the init process

  • Please analyze the source code of Zygote

  • The principle of eakcanary, which objects can be used as gc-root

Okay, you said that you are mainly good at application layer development. How do you detect memory leaks in the Java layer? Let me talk about the principle of the leakcanary we use. After the principle, I asked me whether all object leaks can be detected by leakcanary. How is his citation chain managed? Later, I asked that you just said that weak reference objects will be released during gc. When will they not be released? I was confused at this time. In fact, it will not be released when there is a memory leak. My brain was short-circuited and I didn't react.

Three sides of Byte Feishu client

  • Service running thread
    (all life cycle methods are in the main thread)

  • On which thread does the callback method in ServiceConnection run?

  • Briefly describe the mechanism of process keep alive

  • Are you familiar with plug-inization? Talk about the idea of ​​implementing a plug-in framework

  • Talk about the drawbacks of the Bander mechanism

  • Handwriting a simple hot fix framework

  • Could you please analyze how AMS and PMS communicate?

  • Shredded algorithm

Four Sides of Byte Feishu Client

  • What are the advantages of Jetpack development?

  • Source code analysis of LiveData and Databinding

  • Single-phase bonding and two-way bonding

  • The design idea of ​​Recycleview recycling pool

  • Source code analysis of HandlerThread

  • Multiple Handlers add data to the MessageQueue. How to ensure the thread is safe internally?

  • Final Algorithm Problem

Five Sides of Byte Feishu Client

  • Why is the maximum data transfer between activities 4M?

  • Briefly describe Looper's transaction swap?

  • A simple question? Then you talk about the drawing process of ViewGroup?

  • Kotlin和Flutter

  • Final Algorithm Problem

Okay, the overall interview situation feels good; almost, Byte has asked these, and there are some questions I did not put in the article, but I have compiled the summary of my Byte Beat interview into PDF, I want Friends who are interviewed by major companies for reference can privately write to me [Interview] , which is a gift to you;

Friends who need a high-definition PDF version can get it for free at "Scan the QR code below"

Guess you like

Origin blog.csdn.net/qq_39477770/article/details/112992081