Preface:

Android application development to today, has become a very mature technology direction, from the current situation, Android development is quite hot, but the senior Android development talent is relatively few, now mobile Internet developers also gradually began to pay attention to plug-in technology, performance optimization, industry new technology, Advanced technology such as system architecture. It also created an like now, android developers feel the industry is now should environment, technology is not comprehensive, still stay in low – and the technical level, worked so hard to write code, in order to increase by 2000 dollars a year’s salary, crazy to work overtime, must be cut, also worried about layoffs, and senior developers is a business object, At the same time, middle and low-end developers are competing for one position while middle and senior developers are competing for multiple positions.

So how can you, as an Android developer, break out of the status quo and become one of the architects?

background

I met the position of Android leader in Shanghai. I had a round of interview on Sunday, and I felt that my answers were all good.

And then you get an email and the interview is over and you say, “We were very impressed with your excellent knowledge and ability! After careful evaluation of your comprehensive situation and careful matching and balancing with the job needs, we are very sorry that we did not reach cooperation with you this time. But your information is already in the company’s talent pool.” It just means to hang up.

Later, I called HR and asked, but she didn’t tell me the reason. Then during the interview, there was something strange. Before the interview, the interviewer told me that I was in a strange position, and he didn’t tell me that it was strange.

The interview process

Here are some questions that interviewers ask:

Interviewer: Click on an icon to go through the startup process of the application.

Answer:

After clicking the icon, call the activity to AMS remotely through startActivity. Ams pushes the newly started activity into the activity stack as activityRecord structure, and calls back to the original process by remote binder, making the original process enter pause state. When the original process is paused, ams is notified that I am paused. Ams then determines whether a new process needs to be started based on whether the flag in the intent of the activity to start contains the “new_task” label. The function startProcessXXX is used to start the new process. After the new process is started, the main function of ActivityThread is called by reflection. Looper. prepar and lopper.loop are called from main to start the message queue loop mechanism.

Finally, AMS was told remotely that I was up. Ams calls the handleLauncherAcitivyt to load the activity. In handlerLauncherActivity, the onCreate of the Application and the onCreate of the activity are called by reflection, and the onResume of the activity is called by reflection in handleResumeActivity. An application is launched.

Interviewer: Retrofit.

Answer:

It is primarily through dynamic proxies that interfaces are directly transformed into proxy objects. Dynamic proxies are different from static proxies. Dynamic proxies build bytecode objects directly at the virtual machine level.

Interviewer: View custom process, which methods to achieve.

Answer:

OnMeasure, onLayout,onDraw.

Continue to ask “What methods will be used in onMeasure?” (I think this question may not be very good, I wanted to answer in detail, but before the result was reached, he said, continue to the next question, I don’t know whether you agree or think my answer is too long, if you think too long can put forward ah…)

Two int values are passed in the onMeasure. The first two bits represent the mode and the last 30 bits represent the width and height. This is the limit that the outer container imposes on the inner view.

One mode is to give you whatever value the container gives you (match_parent), and the other mode is to give the inner view as much space as it wants. The third option is how much space the container should give the child view, and how much space the child view should take up, and choose the smaller one (wrap_content). At this point I was going to say that onMeasure will call measureChildwithmargin, and he said yes, and then on to the next problem.

Interviewer: How did you design the app?

Answer:

Basically MVC architecture. There was a project that used MVP. There were some other overall design questions, very piecemeal, but they all answered pretty well.

Interviewer :(the last question is the algorithm question, the interviewer’s expression is not very clear, so I did not understand his meaning at the beginning, I summarize the question)

I have 1,3,7 notes, and now I want n dollars. How to get the fewest number. 1 * a+3 * b+7 * c=n

Of course, I summed it up myself, and his description at the beginning made me want to cry.

Answer:

At the beginning of my brain, I did it as a logic problem. I thought for 5 minutes before I realized that it was a programming problem. Traversal, the value range of A (0 n), the value range of B (0 N /3), and the value range of C (0 to n/7) traversal is the minimum value. Of course, this situation is not efficient. I also told the interviewer at that time that I didn’t think much about efficiency. If necessary, I can change it again. I feel like he agrees. You just have to be right. I don’t remember any other bits and pieces, but that’s the main thing.

I think you should have seen a lot of experience sharing interview success, but according to the theory of survivor bias, there are also a lot of people to see where others failed in the interview, such as my failed interview, you can compare, find some of their answers will be more helpful to their own interview later.

The end of the

If you want to be a good Android developer, focus and do deep research on the basics and things that matter.

For many junior and intermediate Android engineers, if they want to improve their skills, they often have to explore their own growth, and the learning effect is not systematic, inefficient, long and helpless. The focus of this article is on whether you have gained and grown, the rest is not important, I hope readers can keep this in mind.

Here, THE author shares a video and data sharing from the perspective of architecture philosophy to sort out many years of architecture experience. The latest video recorded in the preparation of nearly 6 months will bring you different inspiration and harvest.

Android Advanced Learning database

A total of ten topics, including Android advanced all learning materials, Android advanced video, Flutter, Java foundation, Kotlin, NDK module, computer networks, data structures and algorithms, micro channel small program, interview questions analysis, framework source!

Big factory interview real question

PS: Before because autumn recruit set of twenty sets of first and second line Internet companies Android interview real questions (including BAT, Xiaomi, Huawei, Meituan and Didi) and I sorted out Android review notes (including Android basic knowledge, Android extension knowledge, Android source code analysis, design mode summary, Gradle knowledge, common algorithm problems summary).

Bytedance Android Interview 2019 — 2021

  • Download direct collection link: [Tencent document】
  • The above advanced BATJ factory learning materials can be shared with you free of charge, need a complete version of friends,You can see it all here】.