A summary of 50w words + Android technical social recruitment interview questions (with answers + test sites)

I. Introduction

The following is not an Android learning path, but just a summary of the social recruitment Android client development interview test sites (because there are also written test test sites, which will be combined to give everyone a learning path). The follow-up will update the Android school recruitment interview question bank with 10w+ words for everyone. There are related question banks and materials for other positions. You can leave a message for any position you want~

This article summarizes the big data of the questions asked in the interviews of each company, and will update the proportion of the interviews in the interview. Of course, this article only includes the technical aspects, not the hr aspect or some other life ideals.

Two, Android interview knowledge framework

Android interview knowledge framework

Three, Java basic click

3.1 Data structure and algorithm

3.1.1 What are the commonly used data structures?
3.1.2 Array
(1). How to find the missing number in an integer array from 1 to 100?
(2). How to find the duplicate number in a given integer array? Xiaomi
(3). How to find the maximum and minimum values ​​in an unsorted integer array? Byte jitter
(4). How to delete multiple copies from a given array in Java?
(5). Add large numbers (today headlines) )
3.1.3 Linked list
(1). What about the first query and the second to last query? (This is different. The first one is directly given to the head node. The second to last one needs to be queried from the first to last, and two steps are taken.) Tencent
(2). The underlying principle of arrayList is bit beating
(3) How to find the median value of a single linked list in one traversal? China Ping An
(4). How to prove whether a given linked list contains cycles? How to find the head node of the cycle? Youku
(5). Two singly linked lists with crosses, ask Intersection Huawei
(6). How to get the length of the singly linked list? 360
(7). How to reverse the singly linked list without using recursion? Xiaomi/Meituan
(8). How to judge that the list has a ring? Didi
3.1.4 Queue & Stack
(1). How to use stack to realize the function of queue? (Guangzhou Lychee FM)
(2). Two stacks to achieve a queue Mogujie
(3). Two queues to achieve a stack Tencent
(4). Compare queues and stacks, and their bottom to achieve Tencent
3.1.5 Binary Tree
(1) How to perform a pre-order traversal in a given binary tree? Baidu
(2). How to implement the post-order traversal algorithm? Baidu
(3). How to perform a binary search in a given array? Suning
(4). It is known that the pre-order traversal is {1,2,4,7,3,5 ,6,8}, the middle order traversal is {4,7,2,1,5,3,8,6}, what is its binary tree like? 58
(5). Input two binary trees A and B, and judge whether B is a substructure of A. IQiyi
(6). Please implement two functions, which are used to serialize and deserialize binary trees. YY
(7). The difference between a balanced binary tree and a red-black tree? Byte bounce
(8). What is a balanced binary tree, and what are its characteristics ? Meituan
(9). B tree, B+ tree
3.1.6 HashMap
(1). What is the underlying principle of HashMap ? Is it thread safe? Baidu
Meituan (2). How is put in HashMap implemented? Didi
(3). Talk about when the hashMap needs to be expanded, and how is the expansion resize() achieved?
(4). What is hash collision? How to solve it? Didi
Meituan (5). The difference between HashMap and HashTable. Xiaomi
(6). When does HashMap need to be expanded? How is the expansion resize() implemented? Didi
(7).hashmap concurrenthashmap principle Meituan
(8). The difference between arraylist and hashmap, why is the number fetching fast? Byte bounce
3.1.7 Figure
 (1). Rotation output matrix

(2). Given a matrix int matrixA [m] [n], each row and each column are in increasing order, and an algorithm is implemented to find an element in the matrix. Sogou

3.1.8 What are the sorting algorithms?
(1). Top-k sorting (heap sorting, bitmap method)
Meituan
( 2). Handwriting Huajie Aimi for bubble sorting (3). Handwriting Huajie Aimi for heap sorting algorithm
(4). Oval There are two races in the venue, which can provide two horses at the same time. After the two horses are competing, you can know which horse is running fast, but there is no timing tool. The question, how to use the optimal algorithm (least number of matches) to know the fastest three horses among the 10 horses Ali
(5). Input an integer unordered array, and the method of sorting the heap makes the array ordered Ali
(6 ). How to use quick sort algorithm to sort an integer array? CVTE
3.1.9 Search algorithm
(1). Binary search algorithm for ordered array Baidu
3.1.10 String
(1). Given a string, please find out which The length of the longest substring without repeated characters. Byte jitter
(2). Given a string s, find the longest palindrome substring in s. You can assume that the maximum length of s is 1000.
3.1.11 Please write down the time complexity of the following algorithm:
Bubble sort, Insert sort, Heap sort, Binary tree sort
3.1.12 Other algorithms
(1). What are the common symmetric encryption algorithms? Byte jitter
(2). How to find whether there is a combination of two numbers that is the target in an unordered (with negative numbers) array, twoSum(); Byte
3.2 Java basics
(1). Under what circumstances stack memory will happen overflow?
(2). What would you write if you were asked to write a piece of stack overflow code? How big is a stack and why? Does each thread have a stack of this size? (Meituan)
(3). What is a complete GC process in JVM, and how can objects be promoted to the old age?
(4). Introduce the GC recovery mechanism and generational recovery strategy.
(5). There are several reference relations in Java, what is the difference between them?
(6) What are the GC collection algorithms? What are their characteristics?
(7). How to judge whether an object is reclaimed, what GC algorithms are there, and what GC algorithm is the most used by actual virtual machines? (
Meituan ) (8). Jvm memory structure to talk about.
a. Describe the JVM memory model. (Oriental headlines)
(9) The difference between JVM DVM ART (360)
(10). Describe the GC mechanism. Will the Class be recycled? How to recycle unused Class? (Dongfang
Toutiao ) (11). The difference between StackOverFlow and OOM? When did they happen, what is stored in the JVM stack, and what is stored in the heap? (
Meituan ) (12). The difference between the Java virtual machine and the Dalvik virtual machine?
(13). Please describe the process of new object.
(14). Will Java objects be allocated on the stack?
(15) What is the difference between String, Stringbuffer and StringBuilder? (Eastern headlines)
a.String StringBuffer StringBuilder's efficiency in string manipulation; here we mainly examine how String is created in memory. (Byte beating)
(16) Why is String immutable? (Byte beating) a
. Why is String designed to be final?
(17). The difference between final, finally and finalize.
(18). The difference between abstract classes and interfaces.
(19). The difference between overloading and rewriting (Jingdong)
(20). What is value passing and reference passing, and is Java passing by value or by reference?
(21).String s = new String(""); How many objects are created?
(22) The difference between equals and == in java.
(23). try-catch-finally, there is return in try, is finally executed?
(24) The difference between Execption and Error.
(25) The difference between Static class and non static class.
(26) What is the difference between PathClassLoader and DexClassLoader?
(27). What is a parental delegation mechanism, and why is a parental delegation mechanism needed?
(28). Describe the JVM class loading process.
(29). What is a dynamic proxy? How to achieve?
(30). How to initialize the dynamic proxy method? (Byte beating)
(31). CGLIB dynamic proxy (byte beating)
(32). Talk about the application scenarios of reflection, which frameworks and principles?
(33). The characteristics, advantages and disadvantages of Java generics, what's the matter with generic erasure?
(34). Whether List can be converted to List.
(35). The difference between generic super and extends.
a. Statement 2: Java's generics, the difference between <? super T> and <? extends T>.
(36). Why is IO a time-consuming operation?

3.3 Concurrent programming

(1). If there is only one cpu, single core, and multithreading, is it still useful? (美团)
(2) What is the difference between the .sychronied modification method and the static method? What is visibility?
(3). What are the types of locks?
(4) The principle of CAS lock-free programming. (Byte beating)
(5). The realization principle of ReentrantLock.
(6) Principle of AQS (Xiaomi Jingdong)
(7) Principle of Synchronized and the difference with ReentrantLock. (360)
(8). What optimizations did Synchronized make after JDK1.8 (JD)
(9). The difference and scope of Synchronized static and non-static locks (Xiaomi)
(10) What does the volatile keyword do? (What is instruction rearrangement) (Byte beating)
(11) Can volatile ensure thread safety? What is the role in DCL?
(12) What is the difference between volatile and synchronize? (Xiaomi Jingdong Station B)
(13). How about using different objects for two threads? (Byte beating)
(14). What is a daemon thread? How do you exit a thread?
(15) The difference between sleep, wait and yield, how does the thread of wait wake it up? (Dongfang
Toutiao , Byte Beat) (16). Is sleep interruptible? (Xiaomi)
(17). Realize non-blocking producer consumer (byte beating)
(18). How to open a thread, what are the problems with opening a large number of threads, how to optimize? (Meituan)
(19). Thread life cycle.
(20) What is ThreadLocal?
(21) The principle of AyncTask.
(22). Are the tasks in AsyncTask serial or parallel?
(23). Thread pool management thread principle.
(24). Thread pool related parameters, what types of thread pools are there, how to schedule thread pool tasks, is the task queue just a first-in-first-out queue, what should I do if tasks have priority, do you know priority inversion? (美团)
(25). There are three threads T1, T2, T3, how to ensure that they are executed in order?
(26). What are the ways to operate multithreading in Android?
(27). How to get whether the current thread is the main thread (byte beating)
(28). What is HandlerThread?
(29). How to communicate between threads?
(30). The principle of RxJava thread switching, what are the differences between RxJava1 and RxJava2?

3.4 Network programming
(1). Describe the process and meaning of TCP three-way handshake and four-time wave.
a. TCP's three-way handshake process? Why is the three-way handshake used? Is it possible to use the two-way handshake?
b. Why is the three-way handshake not twice once, five times and six times (
Meituan ) (2). What is the difference between TCP and UDP? (Tencent)
(3). What is the relationship between Http and Https?
(4). SSL handshake process.
(5) What is the difference between Http post and get request?
(6). What happens when I enter a URL into the browser? (Meituan)

Fourth, the Android system

(1). What is the life cycle of Acitvity?

a. How to destroy an Activity in the life cycle of Acitvity? (美团)

(2). The four startup modes of Activity, and issues that need attention in development, such as the call of onNewIntent();

a. Activity start mode, difference (Meituan)

b. If singleInstance does not specify the stack name, how is it allocated? (Byte beating)

(3). How to use Intent display jump and implicit jump? (Meituan)

(4). Activity A jumps to B, B jumps to C, A can't jump to C directly, how does A send messages to C? (Meituan)

(5). How does Activity save state?

(6). Please describe the startup process of Activity, starting from clicking the icon. (Station B)

a. How does the APP start?

b. Start an Activity process analysis

(7). What is the life cycle of Service?

a. Service two life cycles and differences

(8). Under what circumstances would you use Service?

(9). The difference between startServer and bindServier? (Meituan)

(10). The difference between Service and Thread?

(11). The difference between IntentService and Service?

(12). How to customize ContentProvider and what is the usage scenario?

(13). The difference between the static registration and dynamic registration of BroadcastReciver?

(14). Classification and working principle of broadcasting

(15). Can threads be opened in onReceive? What are the problems?

(16). What is orderly broadcasting?

(17). What is the difference between Application, Activity and Service context? Can you start an activity, dialog?

(18). What is the life cycle of Fragment? (Meituan)

(19). Why doesn't the Fragment constructor let you pass parameters? (Station B)

(20). The difference between Fragment add and replace, respectively affect the life cycle of Fragment (Meituan)

Five, View System

(1). View drawing process and custom View attention points. (Dongfang Toutiao, Meituan )
Every UI control in Android is integrated from View, and then these Views have the same drawing process, which must go through measure, layout and draw.
The drawing process of view is in the window adding process, ViewRootImpl The setView method of the class started
(2). Can the width and height be measured in onResume
(3). What is the process of the event distribution mechanism? (Dongfang Toutiao)
(4). How to resolve incident conflicts? (Dongfang
Toutiao ) (5). How does View distribute reverse control? (Byte beating)
(6). Customize Behavior, NestScroll, NestChild. (Dongfang
Toutiao ) (7) View.inflater process and asynchronous inflater (Dongfang Toutiao)
(8) Why is .inflater slower than custom View? (Eastern headlines)
(9). OnTouchListener onTouchEvent onClick execution order. (58 Jingdong)
(10). How to intercept the event onTouchEvent if it returns false, onClick will still be executed? (58 Jingdong)
(11). The distribution mechanism of events, the advantages and disadvantages of the chain of responsibility model (Meituan)
(12). Classification and difference of animation (car and home)
(13). What is the difference between attribute animation and ordinary animation ? (Car and home)
(14). The difference between the interpolator estimator (car and home)
(15). Comparison of RecyclerView and ListView, caching strategy, advantages and disadvantages. (Meituan)
(16) How does WebView do resource caching? (Byte beating)
(17). Several ways and interception methods of WebView and JS interaction. (Byte beating)
(18). The difference between custom view and viewgroup
(19). View drawing principle
(20). The execution order of onTouch, onTouchEvent and onClick in View
(21). View sliding method
(22). The difference between invalidate() and postInvalicate()
(23). View drawing process is executed from which life cycle method of Activity
(24). The connection and difference between
Activity , Window and View (25). How to implement the Activity window Fast dimming
(26). Reasons for ListView stuck and optimization strategies
(27). Why is ViewHolder declared as a static inner class
(28). What are the animations in Android? Animations take up a lot of memory, how to optimize
(29). Custom View executes the invalidate() method, why sometimes it does not call back onDraw()
(30). The relationship between DecorView, ViewRootImpl, View, will ViewGroup.add() add a ViewrootImpl
(31). How to pass WindowManager Add Window (code implementation)?
(32). Why can't Dialog use Application Context?
(33). What is the token in WindowMangerService? What is the difference
(34). What is RecyclerView? how to use? How to return a different Item
(35). RecyclerView's recycling and reuse mechanism
(36). How to add more pull-to-refresh & pull-down loading mechanisms to ListView & RecyclerView
(37). How to perform partial refresh of ListView & Recycler?
(38). What problems usually occur when a RecycleView is nested under ScrollView?
(39). When a ListView or a RecyclerView displays news data, the picture is misaligned. What are the possible reasons & how to solve it?
(40_.Requestlayout, onlayout, onDraw, DrawChild difference and connection
(41). How to optimize custom View
(42). Android property animation implementation principle, tween animation implementation principle

六、Android FrameWork

1. What are the ways of multi-process communication in Android?
a. Which process communication have you used? What is the principle? (Byte Bounce, Xiaomi)
2. Describe the principle of the Binder mechanism? (Oriental headlines)
3. What is the working process of the Binder thread pool? (Oriental headlines)
4. How does Handler perform thread communication, and what is the principle? (Eastern headlines)
5. If Handler has no message processing, is it blocking or non-blocking? (
ByteDance , Xiaomi) 6.handler.post(Runnable) How is runnable executed? (Byte Beat, Xiaomi)
7. Handler's Callback and handleessage both exist, but will the callback return true and handleMessage will still be executed? (Byte Beat, Xiaomi)
8. What is the difference between Handler's sendMessage and postDelay? (Byte beating)
9. What is IdleHandler? How to use and what problems can it solve?
10. Why does Looper.loop not block the main thread?
a. Looper infinite loop why there is no ANR (Station B)
11. How to create Looper in child thread? (Byte Beat, Xiaomi)
12. The relationship between Looper, handler, and threads. For example, how many Loopers can correspond to how many Handlers can a thread have? (ByteDance, Xiaomi)
13. How to update the UI, why can't the child thread update the UI? (美团)
14. The principle of ThreadLocal and how is it applied in Looper? (
ByteDance , Xiaomi) 15. What methods does Android store data?
16. SharedPreference principle, what is the difference between commit and apply? What kind of attention should be paid when using?
17. How to judge whether an APP is in the foreground or the background?
18. How to do app keep alive?
19. What is the size of a picture 100x100 in memory? (Byte beating)
20. Intent's principle and function, what types of parameters can be passed?
21. What if a large amount of data needs to be transferred between Activities?
22. Open multiple pages, how to achieve one-click exit?
23. How to monitor the life cycle of LiveData? (Station B)

Seven, performance optimization topics

1. App stability optimization
2. App startup speed optimization
3.3. App memory optimization
4. App drawing optimization
5. App slimming
6. Network optimization
7. App battery optimization
8. Android security optimization
9. Why is WebView slow to load?
10. How to optimize custom View
11. When will FC (Force Close) appear?
12. How to solve the performance problems caused by Java multithreading?
13. The realization principle of TraceView, analyze the source of data error.
14. Have you ever used SysTrace and understood the principle?
15.mmap + native log optimization?

Eight, three-party source code understanding

1. Glide: loading, caching, LRU algorithm (how to design a big picture loading framework by yourself) (LRUCache principle)
2.
EventBus
3. LeakCanary
4. ARouter 5. Plug-in (the principle and genre of different plug-in mechanisms, advantages and disadvantages. Limitations sex)
6. hot fix
7.RXJava (RxJava thread switching principle)
8.Retrofit (Retrofit package on what had been done OkHttp? dynamic and static proxy agents differences, is how to achieve)
9.OkHttp

Due to space reasons, this interview book has been sorted into a PDF document. If you need a complete set of the Android interview book, please like + comment [1] to get the information for free!

This article  has been included in the open source project: https://github.com/Android-Alvin/Android-LearningNotes , which contains self-learning programming routes in different directions, a collection of interview questions/faces, and a series of technical articles, etc. The resources are continuously being updated …

Guess you like

Origin blog.csdn.net/AndroidAlvin/article/details/108592430