The introduction
At the beginning of 2017, rumors of Android market saturation were rampant. In the economic cold wave of 2018, many large factories and Internet enterprises that used to be in the wind have to lay off employees to protect themselves, and achieve the original realization through small programs and front-end rendering.
In the face of the complexity of the outside world and the changing technology stack, we should clearly recognize the shortcomings of our own technology to consolidate knowledge. At present, a large number of mobile terminal Android junior and intermediate talents are pouring in, which is called more than enough to satisfy the insufficient graduates. However, the owner always believes that those who are willing to work hard can also stand firm in the cold winter as long as they have excellent breadth of knowledge and deep reserves.
Years ago, I took a wave of social recruitment to test the water, and finally got several offers after a fight. After aftertaste, I had to sigh that the technical talents from 985 and 211 are really strong. In order to practice socialist core values, I summarized my interview experience. Combined with reference to other recruitment interview summary sorted out this interview answer, thank you do not abandon, the knowledge points such as description error, but also hope to discuss correction.
I would like to thank the following bloggers, who have quoted some of the points in this article, and their articles have inspired me a lot
Android development official document Carson_Ho
Note: the answer is at the bottom, because the actual development and reference answers will be different, and afraid of misleading everyone’s understanding, so these interview answers or their own to understand! The interviewer will ask questions about the points mentioned in the resume, so don’t memorize the answers. Try to understand them.
Android article
Activity
- What about the Activity lifecycle?
- What methods does Activity B call when Activity A starts another Activity? What if B is a transparent theme or a DialogActivity?
- What does the onSaveInstanceState() method do? When will it be called?
- What are the four startup modes and application scenarios of the Activity?
- What Flags are commonly used for activities?
- What’s the relationship between an Activity and a window or a View?
- Activity life cycle changes for horizontal and vertical switching?
- How do I start an Activity for another application?
- How does the Activity start? (key)
Fragment
- What about the Fragment lifecycle? Different from the Activity lifecycle?
- What’s the difference between an Activity and a Fragment?
- The difference between add and replace in fragments
- The difference between getFragmentManager, getSupportFragmentManager, getChildFragmentManager?
- FragmentPagerAdapter and FragmentStatePagerAdapter difference and usage scenarios
Service
- How about the life cycle of a Service?
- What are the two ways to start a Service? What’s the difference?
- How can Service not be killed?
- Can Service start time-consuming operation? How to do?
- What system services have you used?
- Do you know ActivityManagerService? What role does it play (key points)
Broadcast Receiver
- How many forms of broadcasting are there? What are the features?
- Two ways to register a broadcast?
- Do you understand the principle of broadcast sending and receiving? (Binder mechanism, AMS)
ContentProvider
- What do you know about ContentProvider?
- ContentProvider permission management?
- How about the relationship between ContentProvider, ContentResolver, and ContentObserver?
Data is stored
- Describe how Android data persistence works?
- The application scenarios of SharedPreferences? What to note?
- What is the difference between apply and commit in SharedPrefrences?
- Do you know anything about transactions in SQLite? How is it done
- Is there a good way to do batch operations using SQLite?
- How do I delete individual fields of tables in SQLite?
- What optimizations do I get when I use SQLite?
IPC (Emphasis)
- What is the relationship between processes and threads in Android? The difference between them?
- How do I enable multiple processes? Can N processes be enabled for an application?
- Why is IPC needed? Possible problems with multi-process communication?
- Android IPC, advantages and disadvantages of various ways, why Binder?
- What and how does the Binder mechanism work?
- What is the role of ServiceManager in Binder framework?
- Why do Bundle delivery objects need to be serialized? The difference between Serialzable and Parcelable?
- Tell me about an AIDL? How does it work? How to optimize AIDL for multiple modules?
View
- What’s the process of drawing a View?
- What is a MotionEvent? How many events are involved? Under what conditions does it occur?
- Describe the View event delivery and distribution mechanism?
- How to resolve View event conflicts? What is an example from development?
- The difference between scrollTo() and scollBy()?
- How does Scroller achieve elastic sliding of View?
- How does invalidate() differ from postInvalidate()?
- What’s the difference between SurfaceView and View?
- How does custom View consider model adaptation?
Handler
- What about the message mechanism Handler? Role? What are the elements? What is the process?
- Can a thread create more than one Handler?
- The difference between soft and weak references
- Causes of memory leaks caused by handlers and the optimal solution
- Why does the system not recommend accessing the UI on child threads
- Why does Looper loop death not cause apps to freeze
- What happens to message queues when you use Handler’s postDealy?
- Can I just new a Handler on a child thread? How to do?
- How can messages be created? Which works better? Why is that?
Threads (emphasis)
- What are the benefits of thread pools? Several parameters of thread pool understanding, four kinds of thread pool usage scenarios
- What other classes do you know about in Android for thread switching?
- Explain how AsyncTask works
- What does IntentService do?
- The difference between creating a thread directly in an Activity versus creating a thread in a service
- How does ThreadPoolExecutor work?
- What is the difference between Handler, Thread, and HandlerThread?
- The principle of ThreadLocal
- Is multithreading always efficient (pros and cons)
- In multithreading, if you were to do a singleton, what would you do
- Is there any other way to wake up a thread besides notify
- What is ANR? When does ANR occur? How to avoid it? How can I quickly locate ANR problems without looking at the code?
Bitmap
- What are some issues to be aware of when using Bitmap?
- Will bitmap.recycle () be recycled immediately? When will it be recycled? If there’s nowhere to use this Bitmap, why isn’t garbage collection just collected?
- The memory occupied by a Bitmap and the calculation of the memory occupied
- Android cache update strategy?
- How does LRU work?
Performance optimization (emphasis)
- In the image level 3 cache, the image is loaded into memory, and if memory is about to burst, what happens? How to deal with it?
- If you load a 500*500 PNG hd image in memory. How much memory should it take up?
- WebView performance optimization?
- How does Bitmap handle large images, such as a 30M large image, and how does it prevent OOM
- Memory reclamation mechanism and GC algorithm (advantages and disadvantages of various algorithms and application scenarios); GC principles, timing, and GC objects
- What’s the difference between a memory leak and an overflow? What tools does AS have to detect memory leaks
- Performance optimization, how to ensure that the application startup does not lag? How to deal with black and white screen?
- Will strong references be reclaimed if they are set to NULL?
- RecyclerView and ListView
- What is the Adapter of the ListView?
- LinearLayout, FrameLayout, RelativeLayout performance comparison.
JNI
- Do you know about JNI
- How to load the NDK library? How to register Native functions in JNI?
- What functionality have you implemented with JNI? How do you do that? (Encryption, audio and video, graphics and image processing)
Design patterns
- What design patterns do you know?
- Talk about MVC, MVP, and MVVM. What’s good and what’s bad?
- After encapsulating the P layer, how to solve the problem if the p layer data is too large
- Can you give some examples from Android of what design patterns are used?
- What are the differences between decorator mode and proxy mode?
- How many ways are there to implement the singleton pattern? What is the purpose of double locking in the slacker style? What is the purpose of two short calls?
- Use of some open source framework, introduced a read source code, internal implementation process.
- How should fragments be decoupled if used in Adapter?
Android advanced extension points
- How do you unit test, how do you keep your App stable
- How to check the recycle status of an object in Android
- How is the size of APK compressed?
- How do I configure multichannel packages using Gradle?
- Analysis of plug-in principle
- Composition principle
- Cross component communication
- Realization of route and buried point in componentization
- Hook and pile insertion technology
- Android signature mechanism
- What is the difference between v3 signature key and V2 and V1
- Big changes between Android5.0 and 10.0?
- Say something about the Measurepec class
- Please give examples of common layout types on Android, and briefly describe their usage and typography efficiency
- Distinguish the use of Animation and Animator and outline their principles
- What image loading libraries have you used? What is subtle about Glide’s source code design?
- How do I get around the 9.0 limit?
- What network loading libraries have you used? OkHttp, Retrofit implementation principle?
- How does the application update piece work? (Grayscale, mandatory update, regional update)
- Can you use Kotlin, Fultter? Talk about your understanding
Answer paper
Because the knowledge involves a wide range, so the solution is divided into three, later on
Android article: 2019 Junior and intermediate Android development agency recruitment interview answers (part 1)
Android development Agency recruitment interview answer (middle)
Android article: 2019 Junior and intermediate Android development agency recruitment interview answers (next)