Double non-Master + CS professional cast face to Tencent Android post, wait for HR face a week later, now I have an offer

Yesterday, it was the seventh day I got the offer from Tencent. I always wanted to do an interview summary before, but I have been familiar with the environment since I joined the job, and I have never had time to do the project. Let’s do it today during my lunch break!

Self introduction

I graduated from a non-CS major in Central China in 18 years. I have been working for almost two years now. Before I came to Tencent, I had been doing client development in a state-owned enterprise in Shenzhen. Although state-owned enterprises are relatively stable, they are also consuming your enterprising spirit while being stable. Unwilling to be mediocre, I decided to fight for it! But I didn't resign naked. I chose to quit my last job after I got the letter of intent. ( PS: It is recommended that you do not speak in nakedness )

Tencent interview experience

That day happened to be the end of oppo's two sides in the afternoon (oppo asked too much, and I had no choice but to hang up). Tencent HR called at about 3 o'clock. I didn't pay much attention to it in the elevator and didn't receive the call. I kept looking forward to it in the afternoon. I just got down from work at about nine o’clock and the phone was inconvenient. Of course, I said it was convenient. I was on the side of the road for about 50 minutes. I thought it should have been hung up because the phone was always disconnected and the environment It was noisy again. I asked the headhunter the next day and said that after checking the same batch of interviews before leaving work, they were released. You should have passed it and only said you should have passed it. After a whole week, I arrived every Friday morning, and I received the second interview notice, about 10:30 every Wednesday morning. The second interviewer smiled from time to time, giving people a relaxed feeling. After the two sides, I asked me to wait for a while and then three sides. After the three sides, the interviewer asked me if I had anything else in the afternoon. We (should be the leader) have something to do. We can face the fourth side at around 4 o'clock in the afternoon. I didn't know who it was, and I dare not ask. I said that I would go back to work in the afternoon. I received an hr call in the afternoon for the morning one week later. A total of five rounds of interviews consist of hr and the duration is about one month.

Technical side

mmap + native log optimization?

Two performance problems of traditional log printing are discussed. One is to repeatedly manipulate the file descriptor table, and the other is to repeatedly enter the kernel mode, and then the principle and mechanism of mmap are discussed.

What is the difference between broadcast and EventBus?

It is said that the implementation principle of EventBus is based on reflection, which manages two tables, and the correlation between the codes is not very easy to maintain. EventBus does not support cross-process communication. The interviewer asked you whether you are sure that cross-process communication is not supported? I said that the source code I looked at was not supported, and the interviewer said that's fine.

What do you know about common design patterns?

I started talking about a lot of Balabala, which talked about the decorative design pattern, which was interrupted by the interviewer, please talk about the decorative design pattern specifically.

What are the cross-process communications?

Pipe, signal, semaphore, file, local socket, shared memory, binder driver

Briefly talk about the binder driver, right?

From the Java layer, it is like accessing the local interface. The client is based on the BinderProxy and the server is based on the IBinder object. From the native layer, the client is based on BpBinder to ICPThreadState to the binder driver, and the server is driven by the binder to wake up IPCThreadSate to BbBinder. Then I talked about virtual memory, physical memory, and memory mapping. The principle of cross-process communication is based on the kernel. When I talked about binder_open, binder_mmap and binder_ioctl, they were interrupted by the interviewer. I was probably afraid that I had been talking for too long.

How to transfer large memory data across processes?

I said that binder is definitely not good, because the maximum mapped memory is only 1M-8K, and the form of binder + anonymous shared memory can be used. For example, to transfer large bitmaps across processes, you need to open the ashmem mechanism at the bottom of the system.

Talk about the realization principle of ConcurrentHashMap, what is the initial size?

It is thread-safe. The implementation principle uses a segmented lock. The initialization size is 16 and must be a power of 2.

How to optimize startup optimization?

I talked about the key optimization of Application, but I was interrupted by the interviewer. Don’t say anything that everyone can think of. What I want to hear is whether you can do some optimization from the perspective of the system. I mentioned the optimization package size. The size can optimize the startup speed, and the optimized dex subcontracting can optimize the startup speed. You can refer to the latest Huawei Ark compiler and so on.

How do you implement the rxpay and rxlogin?

Generally, when we integrate third-party login and third-party payment SDK, we need to monitor the onActivityResult method. I added a transparent activity by referring to the implementation of RxPermission.

kotlin + fullter aspect

Kotlin learned the grammar by myself, but it was useless in development projects. I learned the principle of implementation of fullter, but it was useless in development.

Technology

Singleton design patterns are written, how do static inner classes ensure thread safety?

Synchronized underlying implementation principle, ReentrantLock fair lock and unfair lock.

How does the main thread wait for all threads to complete before performing a specific task? Have you seen the principle and source code?

In the general process of customizing the view, what should be paid attention to and how to optimize, and how are the click events and the long press time realized respectively?

What are the principles of the four startup modes in source code analysis?

Talking about the process of bindService, how did you optimize the background service process?

What design patterns have you used in development? Talk about the specific scene at that time. Why do you use method factories, the other two?

RxJava encountered some unfriendly errors during use, how to solve it? I found out how to solve the problem of memory leak in general. Have you ever encountered the problem of system service memory leak?

What okhttp do you use? Have you done some network optimization? For example, a weak network environment.

Give you the number 1. For example, how many ones are there in 1000011?

Do you understand fast queue? What is the worst case? How to optimize if there is a lot of duplicate data?

Three aspects of technology

Talk about the underlying implementation principle of the handler?

So simple? When I asked about the bowl, I gradually said that the delayed message is processed by nativePollOnce. In 6.0 and above, the epoll method is used to monitor the file descriptor. Then I asked why this scheme is used? What are its advantages over poll and select? How does it monitor? Have you seen its internal implementation principle? It feels very uncomfortable anyway.

Tell me about the logging optimization you did?

Let’s talk about the first round of interviews again. You write the size of the current content at the end of each file. Have you ever wondered if the file is damaged? How to deal with this abnormal situation? Encryption and compression are also asked later.

Have you seen the source code of the binder driver, talked about its memory mapping process, talked about the client waiting for the server to process the return process, if you want to transfer large memory data across processes, what would you do? Just write it down.

What optimizations have been made in the company?

Memory optimization, startup optimization, network optimization, package volume optimization, specifically, package volume optimization. I mentioned that the package size optimization is not just to optimize the size of the package. The package size is too large. From the moment of installation, our application may be slower, because pms will copy and decompress and parse our apk installation files. Optimize our dex and so on. The size of the package will also affect our startup speed. Then Barabala said how to do it, and asked why confusing resources can reduce the size of the package? How was the effect reduced when you optimized?

Some of the most difficult problems encountered during the development process?

Mentioned dynamic repair replace loading so, do you know how to repair class? How to repair resources? Later, I talked about plug-inization. It was mentioned that 360 uses borrowed corpses to resurrect. What if we register other attributes in the plug-in's Androidmanifest.xml, and how to deal with resources?

What else can you ask me?

Personal experience

If I were to change it a few years ago, like everyone else, I feel that these interview questions may not be able to answer one of them, but it feels so normal when I look back today. When we were in elementary school, we felt that knowledge in junior high school was difficult, but when we were in high school, it was easy to look back and look back. Therefore, we don't need to care whether our own abilities are strong enough now, and one bite can't be fat, as long as today is better than yesterday, that's enough. But we all know the truth, but there are fewer students who can stick to it. Life depends on persistence!

Here are the interview questions that I brushed up during the interview before, and they have been converted into PDF, but because the short book mechanism does not show all of them, friends who need it can privately message me [Interview], which is a gift to you.                                                                         

The normal interview process cycle of a large factory is generally one to two months. Even if the salary is negotiated and the offer is finally approved, it may take one to two weeks. This period of time is more psychologically difficult, so it is recommended that you try not to say nothing. After the interview, it is usually revealed how long it will take to give a reply. If it is a headhunter who pushes to contact the headhunter, everyone should try their best to find out the latest developments.

Shuangfei University also has first-class majors, so it does not necessarily mean that first-line Internet companies are the best. Therefore, you must ask the department and project during the interview, and choose the company and project team according to your own situation. Under normal circumstances, the degree of difficulty of the interview can be used to judge the technical precipitation of the department. The situation that is easy to pass almost regardless of the technology is not necessarily a good phenomenon. It must be based on your own situation and future plans. Judgment, sometimes the choice may be greater than the effort.

Those who need high-definition PDF version can get it for free by scanning the QR code below

 

 

Guess you like

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