Golden nine silver ten is coming? Don’t panic, swipe these Android BAT advanced interview questions

Golden nine silver ten is coming?  Don’t panic, swipe these Android BAT advanced interview questions

It's mid-September, and almost many programmers are ready to change jobs or find jobs at this time. . .

If you want to become excellent, then look at what those excellent people are learning and what they do, and do everything possible to communicate with them; go out and see the world more, and then force yourself to learn to the death.

This guide is a summary of my experience in interviewing and interviewing others for seven or eight years in development work. Most of them are frequently asked interview questions for large companies. You can check this to fill up the vacancies. Of course, the list here is definitely not able to cover all the methods. I hope it will be helpful for everyone to find a job in the future!

1. Performance optimization

App stability optimization

  • What stability optimizations have you made?
  • How does performance stability do
  • How to ensure business stability?
  • If an abnormal situation occurs, how to quickly stop the loss?

App startup speed optimization

  • How is startup optimization done?
  • How is it asynchronous? Have you encountered any problems with asynchronous?
  • What are the points of attention that are easy to overlook when starting optimization?
  • Is there a good solution to the slow startup caused by version iteration?
  • Open question: If you increase the startup speed, design a method of delay loading framework or SDK and the problem to pay attention to

App memory optimization

  • What is the process of your memory optimization project?
  • What is your biggest feeling about memory optimization?
  • How to detect all unreasonable places?

App drawing optimization

  • What tools did you use in the process of layout optimization?
  • Why did the layout cause lag, and how did you optimize it?
  • What are the results after layout optimization?
  • How did you do lagging optimization?
  • How do you automatically obtain lagging information?
  • How does Caton's complete solution work?
  • What is the time-consuming reason of TextView setText, and understanding of the source code of TextView drawing layer?
  • Open issues: optimize the opening speed and fluency of a list page

App slim
network optimization

  • Several points of optimization for mobile terminal to obtain network data
  • Client network security implementation
  • Design a network optimization plan for the weak mobile network environment

App battery optimization
Android security optimization

  • How to improve app security?
  • How to do Android app reinforcement?
  • What is the obfuscation principle of Android?
  • Talk about your understanding of Android signatures

Why is WebView slow to load?
How to optimize the custom View
FC (Force Close) when will it appear?
How to solve the performance problems caused by Java multi-threading, how to solve
the implementation principle of TraceView, analyze the source of data error, have
you used SysTrace, understand the principle?
mmap + native log optimization?

Two, Android Framework related

Android system architecture

  • application
  • Java API framework
  • System runtime
  • Hardware Abstraction Layer (HAL)
  • Linux kernel

View event distribution mechanism? How to resolve sliding conflicts?

  • Understand the composition of Activity
  • Type of touch event
  • Event distribution process
  • When will ACTION_CANCEL be triggered? Will the click event be triggered when the button is touched and then swiped to the outside to lift it, and will it be swiped back and lifted?
  • How to resolve event conflicts in View? Give an example encountered in development?

View drawing process?

  • Understand the overall process of drawing
  • 理解MeasureSpec
  • How to implement a custom ViewGroup with waterfall flow based on MeasureSpec?
  • Layout of View drawing process
  • View drawing process of Draw
  • What is the difference and connection between Requestlayout, onlayout, onDraw, DrawChild?

Cross-process communication

  • The relationship between process and thread in Android? the difference?
  • How to start multi-process? Can the application start N processes?
  • Why do we need IPC? Possible problems with multi-process communication?
  • The advantages and disadvantages of the IPC method and various methods in Android
  • Talk about AIDL? How to optimize the use of AIDL for multiple modules?
  • Why choose Binder?
  • The role and principle of the Binder mechanism?
  • What is the role of ServiceManager in the Binder framework?
  • Full definition of Binder
  • Handwritten implementation simplified version of AMS (AIDL implementation)
  • Briefly talk about binder driver?
  • How to transfer large memory data across processes?

What is the Android system startup process? (Hint: init process -> Zygote process -> SystemServer process -> various system services -> application process)

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

To start a program, you can click the icon on the main interface to enter, or you can jump from a program. What is the difference between the two?
Explanation of important terms in the AMS family
App startup process (cold start process of
Activity ) The working principle of ActivityThread
describes the startup process of the four major components, and how the four major components are started and destroyed.
Do you understand the principles of broadcast transmission and reception?
How does AMS manage Activity?
Understand how Window and WindowManager
WMS manage Window?
In general, what happens when an application is installed on the phone?
Android packaging process? (That is, describe what happens after clicking the build button of Android Studio?) What is in the apk? The principle of the signature algorithm?

  • apk packaging process
  • apk composition
  • Why sign?
  • What is a signature?
  • The main process of signing and verification
  • Keystore and certificate format
  • The difference between jarsigner and apksigner
  • When signing, in addition to specifying the keystore file and password, the alias and key password must also be specified. Why?
  • Android Apk V1 signature principle

Tell me about the principle and difference between Android virtual machine and java virtual machine? (The principle and difference of JVM, Davilk, ART)

  • The difference between JVM and Dalvik virtual machine
  • The difference between Android 2 virtual machines (one before 5.0, one after 5.0)
  • What is the difference between garbage collection in ART and Davlik?

Android uses an automatic garbage collection mechanism, please tell me the principle of Android memory management?

  • Open question: How to design garbage collection algorithm?

How are apps sandboxed in Android, and why do you want to do this?
How to find a picture after calling R.id in the app?
JNI

  • Java calls C++
  • C++ calls Java
  • How to register native functions in jni, there are several ways to register?
  • What is the loading process of so and what is its life cycle?
    Please introduce NDK?

Golden nine silver ten is coming?  Don’t panic, swipe these Android BAT advanced interview questions

Three, Android excellent tripartite library source code

Which open source libraries are used in your project? Talk about its realization principle?

  • The underlying network framework: OkHttp implementation principle
    • What is this library used for?
    • Why use this library in the project?
    • What are the uses of this library? What kind of usage scenario does it correspond to?
    • What are the advantages and disadvantages of this library, compared with the same type of library?
    • What is the core implementation principle of this library? If you are asked to implement certain core functions of this library, how would you consider how to implement it?
    • What valuable or useful design ideas have you learned from this library?
    • What optimizations does OKhttp have for the network layer?
    • Network request caching, how does okhttp handle network caching?
    • What is the relationship between HttpUrlConnection and okhttp?
    • Comparison of Volley and OkHttp
    • How to design the network request framework by yourself?
    • Load a 10M picture from the network, what are the precautions?
    • How does http know whether the file is too large or not?
    • Talk about your understanding of WebSocket?
    • The difference between WebSocket and socket?
  • Network packaging framework: Retrofit implementation principle
    • What is this library used for?
    • Why use this library in the project?
    • What are the uses of this library? What kind of usage scenario does it correspond to?
    • What are the advantages and disadvantages of this library, compared with the same type of library?
    • What is the core implementation principle of this library? If you are asked to implement certain core functions of this library, how would you consider how to implement it?
    • What valuable or useful design ideas have you learned from this library?
    • Android: Comparison of open source libraries for mainstream network requests (Android-Async-Http, Volley, OkHttp, Retrofit)
  • Responsive programming framework: RxJava implementation principle
    • RxJava transformation operator map flatMap concatMap buffer?
    • What do you think is the difference between Rxjava's thread pool and your own task management framework?
  • Picture loading framework: Glide implementation principle
    • What is this library used for?
    • Why use this library in the project?
    • What are the uses of this library? What kind of usage scenario does it correspond to?
    • What are the advantages and disadvantages of this library, compared with the same type of library?
    • What is the core implementation principle of this library? If you are asked to implement certain core functions of this library, how would you consider how to implement it?
    • The core idea of ​​Glide source code mechanism
    • What valuable or useful design ideas have you learned from this library?
    • How does Glide determine that the image is loaded?
    • What cache does Glide use?
    • How to control the size of Glide memory cache?
    • Calculate the size of a picture
    • Loading bitmap process (how to ensure no memory overflow)
    • How to realize the memory cache and disk cache in Android
    • LruCache principle
    • Core logic of LruCache put method
    • LruCache get method core logic
    • LinkedHashMap principle
    • DisLruCache principle
    • Bitmap compression strategy
    • Bitmap processing
    • Implement an ImageLoader process
    • How to reuse the memory applied for when Bitmap decodes and when to release
    • Picture library comparison
    • Comparison of Fresco and Glide
    • How does Bitmap handle large images, such as a 30M large image, and how to prevent OOM?
    • Understanding of Bitmap objects.
    • Understanding of inBitmap.
    • How to implement the picture library by yourself? (For extension development, closed to modification, while maintaining independence, just refer to the Android source code design pattern to analyze the actual picture loading library case)
    • Write a picture browser, tell your thoughts?
  • Event bus framework: EventBus implementation principle
  • Memory leak detection framework: LeakCanary implementation principle
    • What is this library for?
    • Why use this library in the project?
    • What are the uses of this library? What kind of usage scenario does it correspond to?
    • What are the advantages and disadvantages of this library, compared with the same type of library?
    • What is the core implementation principle of this library? If you are asked to implement certain core functions of this library, how would you consider how to implement it?
    • What valuable or useful design ideas have you learned from this library?
    • How to judge whether an object has been recycled in leakCannary? How to trigger manual gc? C-layer implementation?
  • Dependency injection framework: ButterKnife implementation principle
  • Rely on the global management framework: Dagger2 implementation principle
  • Database framework: GreenDao realization principle
    • Database framework comparison?
    • Database optimization
    • Database data migration issues
    • Data structure of database index
    • Balanced binary tree
    • B-Tree
    • B+Tree
    • B*Tree

Fourth, hot repair, plug-in, modularization, componentization, Gradle, compile instrumentation technology

1. Hot repair and plug-in

  • Types & characteristics of ClassLoader in Android
  • How is the hot patching technology realized and what is the difference between it and plug-in?
  • Principle of hot repair
  • Why choose plug-in?
  • Plug-in ideas
  • Definition of plug-in
  • Advantages of plug-in
  • Comparison of plug-in frameworks
  • Plug-in principle

2. Modularization and componentization

  • The benefits of modularity
  • Analyze existing componentized solutions
  • Benefits of componentized development
  • Cross-component communication
  • Analysis of cross-component communication scheme
  • How to manage too many routing tables?
  • ARouter routing principle
  • In multi-module development, different persons in charge may introduce duplicate resources, the same string, the same icon, etc. but the file name is different, how to remove the duplication?

3、gradle

  • Are you familiar with gradle, do you know about automatic packaging?
  • How to speed up the compilation speed of Gradle?
  • Can Gradle's Flavor configure a sourceset?
  • Gradle life cycle

4. Compile instrumentation

  • Talk about your understanding of AOP technology?
  • Tell me about the compiler instrumentation technology you know?

Five, architecture design

  • MVC MVP MVVM principle and difference?
  • How to separate C and V of Activity in the case of MVC?
  • What are the benefits of defining Presenter as an interface in the MVP architecture;
  • How does MVP manage the life cycle of the Presenter and when will the network request be cancelled?
  • aop thought
  • How should Fragment be decoupled if used in Adapter?
  • Are there any Base class, BaseActivity and BaseFragment encapsulation problems in the project framework, and solutions?
  • Design a music playback interface, how would you implement it, those classes used, how to design, how to define the interface, how to interact with the background, how to cache and download, how to optimize (15 minutes)
  • How to design an App's overall architecture from 0?
  • Talk about an application that you think is currently popular and design it (for example: live streaming APP, P2P finance, small video, etc.)
  • To implement a library to complete the real-time reporting and delayed reporting of logs, which aspects should be considered?
  • How do you design and implement your best engineering design project; how to extend it into a platform-level product?

6. Other high-frequency interview questions

  • How to ensure that a background service is not killed? (The same question: How to ensure that the service is not killed in the background?) What is the more power-saving way?
  • Android animation framework implementation principle
  • What is the difference between Activity-Window-View?
  • How does the low version SDK implement the high version api?
  • Tell me about your understanding of Context?
  • Android's life cycle and startup mode
  • ListView and RecyclerView series
    • How to change the height of the listview?
    • What should be done when listview and recyclerview are pulled up and loaded?
    • How to implement the sliding deletion of RecyclerView by yourself?
    • The realization principle of ItemTouchHelper of RecyclerView
  • How to implement a push, message push principle? The push arrival rate problem?
  • Dynamic permission series
  • Custom View Series
    • What is the underlying mechanism of Canvas, drawing framework, hardware acceleration, and what is the buffer of canvas lock?
    • Two fingers to zoom and drag the big picture
    • How to make the current tab always be in the middle of the screen in TabLayout
    • How does TabLayout set the width of the indicator to wrap the content?
    • How does custom View consider model adaptation?
  • For Google's newly launched Room architecture.
  • How to locate without permission, the specific model fails to locate, how to solve?
  • What is the difference between Debug and Release APK?
  • Android file storage, the evolution of the permission control of each version storage location, external storage, internal storage
  • Is there any way to improve compilation speed?
  • Scroller principle.
  • Hybrid series
  • If Handler postdelayed two messages are used in the current thread, one is delayed for 5s and the other is delayed for 10s, and then the current thread sleeps for 5 seconds, how will the execution time of the above messages change?
  • In the allocation of process memory in Android, can I allocate a fixed amount of memory by myself?
  • Does the drop-down status bar affect the life cycle of the activity? If a network request is made during onStop, how to resume during onResume
  • Android long connection, how to deal with the heartbeat mechanism
  • CrashHandler implementation principle?
  • The most essential difference between SurfaceView and View?
  • Android program runtime permissions and file system permissions
  • Adaptation of curved screens.
  • The internal execution flow of TextView calling the setText method.
  • How to control the View display (RemoteView) of another process?
  • How to realize the right sliding finish activity?
  • How to achieve the rounded corner effect of the interface at the entire system level. (That is, all APP opening interfaces will be rounded corners)
  • Can non-UI threads update the UI?
    How to resolve git conflicts?
  • Have you done unit testing, talk about a familiar unit testing framework?
    Jenkins continuous integration.
  • Have you used or written any tools in your work? Scripts, plug-ins, etc.; for example: multi-person collaborative development may have a copy of some of the same resources. Is there a way to automatically detect this kind of duplication?
  • How to bypass the 9.0 restriction?
  • How to understand the file descriptor?
  • How to implement process to write files safely?

end

Learning technology is a slow, long and arduous road. You cannot rely on a moment of passion, nor can you learn well by staying up for a few days and nights. You must form the habit of studying hard. So: persistence!

Finally, I’m here to share some analysis of the real 2019-2020 BAT interview questions collected from friends and bosses during this period of time . There are a lot of content Android 基础、Java 基础、Android 源码相关分析、常见的一些原理性问题and system, including a lot of content: wait, it can help us deeply understand Android. Principles of relevant knowledge points and interview-related knowledge .

This document organizes the technical points that are often asked in interviews with large factories into PDF, including knowledge + many details; there is also advanced architecture technology advanced brain map to help you learn and advance, and it saves everyone searching for information on the Internet Time to learn, you can also share with friends around you to learn together.

The above content is placed in the open source project: My github has been included, which contains self-study Android routes in different directions, interview question collections/face sutras, and series of technical articles, etc. The resources are continuously updated...

Finally, I wish everyone who is about to change jobs and prepare to find a good job!

Guess you like

Origin blog.51cto.com/14894816/2533832