It’s better to give it a try. The first offer I received after a few years: ByteDance Android R&D post

With three golds and four silvers, it's the annual job-hopping season. Perhaps many Android programmers are starting to gear up. Combining my own experience in the past, today I will summarize the Android interview questions for everyone, I hope it helps.

1: Activity life cycle?

This is almost a problem that is suitable for all ages and will never become obsolete, and it is most likely the first problem. Of course there is nothing to talk about about this question, rote memorization is useless, the key is to understand. I have encountered a variant of this problem. I asked onStart(), what is the difference between onResume()? If the interviewer raises this question, is it a bit caught off guard? Today I heard that some classmates encountered a more perverted problem: under what circumstances Activity went onCreat() instead of onStart(), this is simply a brain teaser.

2: Service life cycle?

Note here that there are two ways to start the service, startService() and bindService()

3: How to understand the relationship between Activity, View and Window?

This question is really difficult to answer. So here is a more appropriate metaphor to describe their relationship. Activity is like a craftsman (control unit), Window is like a window (carrying model), View is like a window grill (display view), LayoutInflater is like a scissors, and Xml configuration is like a window grill drawing.
1: A Window will be initialized when the Activity is constructed, to be precise, PhoneWindow.
2: This PhoneWindow has a "ViewRoot", this "ViewRoot" is a View or ViewGroup, which is the initial root view.
3: "ViewRoot" adds Views one by one through the addView method. For example, TextView, Button, etc.
4: The event monitoring of these Views is received by WindowManagerService and the Activity function is called back. Such as onClickListener, onKeyDown, etc.

4: Several LaunchMode and usage scenarios of Activity

Standard mode
This is the default mode. Each time an Activity is activated, an Activity instance will be created and placed in the task stack. Use scenario: Most Activity.
In singleTop mode,
if there is an instance of the Activity on the top of the task stack, the instance is reused (onNewIntent() of the instance will be called), otherwise a new instance will be created and placed on the top of the stack, even if the Activity already exists in the stack An instance, as long as it is not on the top of the stack, a new instance will be created. Use scenarios such as news or reading content pages of apps.
singleTask mode
If there is already an instance of the Activity in the stack, it will be reused (onNewIntent() of the instance will be called). When reused, the instance will be returned to the top of the stack, so the instance above it will be removed from the stack. If the instance does not exist in the stack, a new instance will be created and placed on the stack. Use scenarios such as the main interface of a browser. No matter how many applications you start the browser from, it will only start the main interface once, and in other cases, it will go to onNewIntent and clear other pages on the main interface.
The singleInstance mode
creates an instance of the Activity in a new stack, and allows multiple applications to share the Activity instance in the stack. Once the Activity instance of this mode already exists in a certain stack, any application will reuse the instance in the stack when reactivating the Activity (it will call the instance's onNewIntent()). The effect is equivalent to multiple applications sharing an application, no matter who activates the Activity will enter the same application. Use scenarios such as alarm reminders to separate alarm reminders from alarm settings. Do not use singleInstance for the intermediate page. If it is used for the intermediate page, there will be problems with the jump, such as: A -> B (singleInstance) -> C. After completely exiting, start it here. The first to open is B.

5: View drawing process

measure process
layout process
draw process

6: The delivery mechanism of Touch events
publicbooleandispatchTouchEvent(MotionEventev);  //用来分派event
publicbooleanonInterceptTouchEvent(MotionEventev);//用来拦截event
publicbooleanonTouchEvent(MotionEventev);//用来处理event

Among them, the Activity and View controls (TextView) have methods for dispatching and processing events, and the View container (LinearLayout) has methods for dispatching, intercepting, and processing events. There is also an analogy here: the leader will assign tasks downwards. Once the people below do not do well, they will not give the follow-up tasks to the people below to do it. They can only do it themselves, if they do it themselves. No, I can only tell the superior that he can't complete the task, and the superior will repeat his process. In addition, leaders have the right to intercept the task, conceal the task from the subordinate, and do it directly by themselves. If it fails, they can only report to the superior that the task cannot be completed.

7: Several animations in Android

I have been asked about several kinds of animations in Android, and this question is too difficult to answer. There are 2 types before Android 3.0 and 3 types after 3.0.
FrameAnimation (frame-by-frame animation) : Combine multiple pictures for playback, similar to the working principle of early movies. Many App loading uses this method.
TweenAnimation : A series of animation operations on a View, including four modes: Alpha, Scale, Translate, and Rotate.
PropertyAnimation : Property animation is no longer just a visual effect, but a mechanism that continuously manipulates values ​​and assigns the value to the specified property of the specified object, which can be any property of any object .

8: There are several ways of cross-process communication in Android

1: Access the Activity of other applications,
such as calling the system call application

IntentcallIntent=newIntent(Intent.ACTION_CALL,Uri.parse("tel:12345678");
startActivity(callIntent);

2: Content Provider
such as accessing system photo album

3: Broadcast (Broadcast)
such as display system time

4: AIDL service

9: AIDL understanding
10: Principle of Handler
11: Binder mechanism principle
12: The principle of hot repair

1:JavaSisst
2:AspectJ
3:Xposef

13: Design a set of image asynchronous loading and caching scheme
14: Android memory leak and management
15: Activity and Fragment communication
16: Fragment's pits
16: Android UI adaptation
17: Layout optimization
18:Http Https
19: Network request optimization
20: Database optimization
21: Picture optimization
22: HybridJAVA and JS interaction
23: Singleton
24: Principles of Java GC
25:ANR
26:Volley
27: JAVA annotation reflection principle
28: Algorithm
29: Design Pattern
30 : RxJava

All interview questions and answers have been sorted into PDF documents, as shown in the following figure: study notes are shared with everyone for free, if you just need it , you can click here to pick it up for free .

Android advanced learning resource sharing

All in all, success is reserved for those who are ready .

In order to move to a big factory, I spent half a year compiling a collection of "Android Development 2020 Interview Real Questions" from big companies from all walks of life, and in-depth study of the underlying source code and architecture design. But I also brushed a lot of real interview questions from big factories. I also experienced that every effort is worth gaining.

The interview book not only includes the questions I encountered in the interview, but also includes questions collected from some friends. In the future work, I will continue to update and enrich the interview book. Of course, I also hope that everyone can contribute more high-quality interview questions.

It is divided into 6 parts in total:

  • Java basics (★★)
  • Java Advanced (★★)
  • Android basics (★★★)
  • Android Advanced (★★★)
  • Android project (★★★)
  • Frequently Asked Questions of Project Interview (★★★)

1. Java basics (★★)

Object-oriented thinking
, polymorphic
exception handling,
data type,
Java IO
collection,
Java multithreading

Java Advanced (★★)

Reflection in
Java Dynamic proxy in
Java Design pattern & recycling mechanism in
Java Class loader in Java

Android basics (★★★)

Basic knowledge of Android
Activity
Service
BroadCastReceiver
ContentProvider&Database

Layout
ListView in Android
JNI & NDK
Network Access
Intent Fragment in Android

Android Advanced (★★★)

Android performance optimization
Android screen adaptation
AIDL
custom control
event handling in
Android Android signature
animation
network protocol in Android
Other

Frequently Asked Questions of Project Interview (★★★)

  • Development cycle
  • Problems encountered in the project
  • The biggest gain in the project
  • How the project went live
  • How the project is profitable
  • Draw project architecture diagram
  • Project development process
  • Your role in the project
  • Which modules in the project are you responsible for
  • Talk about the specific implementation of the module you are responsible for
  • Which third-generation frameworks are used in the project
  • Have you ever written a framework by yourself
  • How do you improve yourself (learning) in your spare time
  • Do you have your own technical blog
  • Your career plan
  • Why leave
  • Why choose our company
  • Talk about the highlights and shortcomings of your project
  • How does your project maintain a consistent style
  • How is the project structure built
  • How to solve the screen adaptation
  • What source code have you seen
  • How is the project version upgraded
  • What version control tool to use
  • Can you develop independently
  • How the app interacts with the server
  • Have you written the requirements document?
  • Has the interface document been written?
  • Which cloud servers have been used
  • Which third-party platforms have used

Resume + social recruitment solution + classic HR interview analysis

The above is a summary of the real questions encountered in the Android intermediate and senior interviews. I hope it will be helpful to everyone. At the same time, many people often encounter many interview questions about resume production, career confusion, and HR classic interview questions. Similarly, I have also collected and compiled a full set of resume production, puzzles of recruitment by the Golden Three and Silver Four Clubs, and HR interviews. If you have any questions, I can provide professional answers.

For Android development friends, it should be the most comprehensive and complete interview information. In order to better organize each module, I refer to many high-quality blog posts and projects on the Internet, and strive not to miss every knowledge point. Many friends relied on these contents to review and got offers from big manufacturers such as BATJ. This information has also helped many Android developers, and I hope to help you too.

Due to space reasons, if you need the PDF of the above complete study notes, you can like + comment support, click here to pick it up for free !

Guess you like

Origin blog.csdn.net/m0_46657043/article/details/113995643