Following is the basic knowledge of Android summarized in the recent Android development (recruitment) interview, has got the ideal offer, feedback to the students, thank other big guys for sharing.
Android big factory interview attaches great importance to the investigation of basic knowledge, before the interview not only to be familiar with these knowledge points, but also to recite appropriately, to ensure that the face of the interviewer can calmly clear expression. I strongly recommend “Android Development Art Exploration”, school recruitment agency recruitment is very helpful to me; “Java Concurrent Programming Combat” to help understand multithreaded security; Understanding the Java Virtual Machine in Depth helps you understand the JVM. After understanding the following questions, it is best to write them down with a pen to help you organize your language, deepen your impression and help you review.
Regular Interview questions
Android interview questions
- How is ListView cached?
- RecyclerView Contacts list how to achieve A-Z fast location
- The difference between broadcast and EventBus
- Why does the main thread Looper loop have no card main thread? nativePollOnce
- SharedPreference thread safety, process safety, how to cross process
- Threads, Handler, AsyncTask, IntentService
- How to implement multi-process in Android
- Custom View process: measure, layout, draw
- What does the attrachToParent true of LayoutInflater#inflate mean
- What’s the difference between theme and style
- What are the methods of interprocess communication
- View rendering process
- Principles and advantages of Binder
- What is the use of oneway in AIDL, and what do the direction tags in, out, and inout mean
- What animations are available in Android
- Difference between Serializable and Parcelable
- What do you know about Layout, ConstraintLayout
- What are the mobile developer options, and what are not reserved activities
- What are the basic data types?
- What is the difference between String, StringBuilder, and StringBuffer?
- What is Fragment, usage scenario, and lifecycle
- A little bit about Context and memory leaks
- Thread creation method?
- What is the startup mode and application scenario of the Activity?
- Have you used ViewPager? Then it’s associated with fragments;
Memory leak and memory overflow
Memory leak: refers to a program that cannot release the requested memory space after allocating memory. A memory leak does not seem to have a big impact, but the result of the accumulation of memory leaks is memory overflow.
(2) Out of memory: When the program requests memory, there is not enough memory for the applicant, or you are given a block of memory to store data of int type, but you store data of long type, then the result is out of memory, in this case, the error OOM is reported, that is, out of memory.
Causes and solutions of memory overflow
(1) Causes of memory overflow:
(1) The amount of data loaded in memory is too large, such as taking out too much data from the database;
② There is a reference to the object in the collection class, which is not cleared after use, so that the JVM can not recycle;
③ There is an infinite loop in the code or the loop produces too many repeated object entities;
④ Bugs in third-party software;
⑤ The memory value of the startup parameter is set too small
(2) Memory overflow solution:
First step, modify the JVM startup parameters, directly add memory. (Don’t forget to add the -xms and -xmx parameters.)
Step 2 Check the error log to see if there are other exceptions or errors before the OutOfMemory error.
③ The third step is to check and analyze the code to find out the possible locations of memory overflow.
What about the garbage collection mechanism?
Four major components
- How do I restart a Service that is killed when memory is running out
- How does the Android system consider the process priority when killing processes?
- How does the Fragment ViewModel access the Activity’s ViewModel data
- Activity Four startup modes, each startup mode suitable for the application scenario
- The Activity task stack is a-B-C from bottom to top. After killing the process in low memory, click again. Which one is displayed? How to restore C if there is Fragment in C?
- How to Pass an Activity to a Fragment? Why use setArgument to pass parameters instead of using a constructor with parameters?
- The relationship between window, View and Activity
- What are the appropriate activities for each Fragment life cycle
- How does the Activity end up onDestroy after calling the Finish method
The picture
- Glide cache features
- What memory optimization did Glide do for us
- How does Glide load giFs
- ListView image mismatch causes, solutions
- How does bitmap handle large images, and how does 30M large images prevent OOM?
network
- How does OKHttp implement caching
- OKHttp timeout, with DNS timeout codes taken into account
- OKHttp thread pool, connection pool
- What are all interceptors for OKHttp? If the request fails, try again 1 or 2 times
- Retrofit implementation mechanism
- How do Room annotations generate class files at compile time
- Shakehand the difference between HTTP and HTTPS
- What are the status codes 400, 401,3 xx
- What is cyber hijacking and what should be done about it
- TCP three times handshake, handshake in the network packet each flag bit is how many, four times wave say once
- What is the TCP send window?
- Hybrid development h5 to learn more
- The process of accessing a web address in a browser window
- What’s the difference between POST and GET
To optimize the
- Memory leak analysis, the principle of LeakCanary, how does the leak object find the reference chain
- APK thin body
- Start the optimization
- Caton analysis!!
- ANR analysis!!
- Why do more layers in a layout file mean worse performance
- What application performance optimization experience you have to ask
- How do you write ProGuard
Java
Int == hashCode; int = String; StringBuilder 6, The difference between Serializable and Parcelable 7, how string can be converted to INTEGER and how it works 8, Under what circumstances can objects be garbage collected? 9. What are strong references, soft references, weak references and virtual references? What is dependency injection? Can you name a few dependency injection libraries? 11. What is the difference between static proxy and dynamic proxy? HashMap (HashMap) {HashMap (HashMap) {HashMap (HashMap) {HashMap (HashMap)}} What is the difference between garbage collection and system.gc ()? Talk about how threads are created in Java and how thread pools work.
Kotlin
- Why can Kotlin coroutines write asynchronous logic in synchronous code?
- How the suspend function works
- If a local variable is defined on a coroutine, why is it accessible to coroutines in other threads?
- Two scenarios for by, implementation of by Lazy
- Object singleton implementation
algorithm
- Various sorting algorithms (bubble, select, quicksort, merge…) The time complexity of various search algorithms (sequential search, binary search…) Time complexity of
- The LRU implementation (146) refers to three methods of the LinkedHashMap implementation
- LFU cache (460) The same frequency using LRU NodeList, outside a layer {freq to NodeList}, NodeList with double linked list implementation
- Add two numbers (445)
- Find the missing number (268) notice the medium in similar questions
- Two queue implementation stack (225)
- Delete subfolders (1233)
- Helical Matrix Printing (54)
- Using the method of generating random numbers 1-5 (1, 2, 3, 4, 5), get a method that can generate random numbers (1-7)
- 54 cards, divided into 3 piles, the probability of the king in the same pile (permutation and combination arithmetic)
Android third-party library source code
1, Network layer framework: OkHttp implementation principle 2, OkHttp for network layer optimization? 3. How does OKHTTP handle network caching? 4. Load a 10M image from the network. 5, network packaging framework: Retrofit implementation principle 6, responsive programming framework: RxJava implementation principle 7, picture loading framework: Glide implementation principle 8, Glide how to determine the picture loading is completed? How to control the size of Glide memory cache? The process of loading bitmap (how to ensure no memory overflow) 11. The application scenario of soft reference and weak reference in Android How does Bitmap handle large images, such as a 30M large image, and how to prevent OOM? LeakCanary Memory leak detection framework: LeakCanary Memory leak detection framework: LeakCanary Dependency injection framework: ButterKnife implementation principle 19. Dependency global management framework: Dagger2 implementation principle 20. Database framework: GreenDao implementation principle
Performance optimization
This is mainly combined with the project you have done, the general interviewer will ask you what aspects of the project to do optimization, the common ask method is: what is the idea of optimization with what technology encountered what difficulties (problems) how to solve what experience is mainly combined with their own project answer. Remember not to dig a hole for yourself, such as did not do this aspect of optimization, you in order to show yourself, said to do, the results of the interviewer down to ask the answer can not come out, this is about the integrity of the problem, you understand ~
Abstract problem
- Tell me about the projects you worked on and the highlights
- What are your strengths and what can you bring to the team
- Technical planning, how to develop
Design problem
- If you were to design a music player, what interfaces would you implement
- Design an image download library: Dig Glide, if the image has no expiry date, how do you ensure the cache is updated?
Here are some real interview questions from companies
(I) Tyco electronic interview questions recruited by senior Android Engineers Society
1. Access management of ContentProvider (Solution: Read-write separation, access control – down to table level, URL control)
2. How to intercept and abort a SHORT message through broadcast?
3. Can the broadcast request network?
4. What is the time limit for anR caused by broadcast?
Calculate the nesting level of a view
6. The Activity stack
7. Is there a cap on Android threads?
8. Is there an upper limit to the thread pool?
9. What does ListView reuse?
10. Why did Android introduce Parcelable?
11. Have you tried to simplify the use of Parcelable?
12. Four components and usage
13. Network request
14. Differences between GET/POST requests
15. XML/JSON differences and parsing methods
16. Talk about Handler
17. Startup mode of service
18. Screen adaptation
19.ArrayList differs from LinkedList
20. The difference between Application and Activity Context objects
21.Android properties animation features
22. How do I import an external database?
23. The features and comparison of LinearLayout, RelativeLayout, and FrameLayout are introduced.
24. Talk about interfaces and callbacks
25. How callback works
26. Write a callback demo
27. Introduce SurfView
The use of 28 RecycleView
29. Dynamic permission adaptation scheme, concept of permission group
30. Why does Android design ContentProvider?
31. Does the drop-down status bar affect the activity life cycle
32. Talk about the relationship between ContentProvider, ContentResolver, and ContentObserver
33. What is the meaning of BroadcastReceiver
34. Classification of broadcasts
35. The role of serialization, and the differences between Android and serialization
The difference between PID and UID in Android
37.Binder understanding and why Binder, interprocess communication
38. Attention points of frame construction and selection
39. Third-party SDK applications
40.MVC and MVP design mode
41. Differences between TCP and UDP
42.Dalvik VIRTUAL machine
43. Implementation principle of EventBus
44. Understanding of custom View
45. Describe in detail the projects you have worked on that have shown you the greatest growth. Which has gained the most?
46. What do you think is the most important trait of an Android engineer? What do you ultimately value in your work? How do you keep learning on the job?
(2) SchoO Technology Android Engineers club recruitment interview technical questions
1. Usage scenarios and advantages and disadvantages of MVC and MVP
2. Implementation principle of Hashmap
3. Performance optimization (be sure to specify many solutions, such as memory, power, flow and other specific solutions)
4. The writing method of singleton mode and the advantages and disadvantages of various writing methods
5. Use and principle of okHttp, Volley, RetroFIT and other network frameworks
6. The use and principle of the four picture loading frameworks
7. How to think about architectural design
8. Customize View, draw process and step,
9. Event interception and distribution mechanisms
10. Communication between processes
11. Application creation and startup process
12.. How does Handler cause a memory leak
13. Understand design patterns and ask a lot,
14. Binder
15. If a network request is made during onStop, how can it be resumed during onResume?
16. What should I pay attention to when using Bitmap?
17. The Bitmap recycler ()
18. Main steps of enabling the camera in Android
19. How to set ViewPager to initialize only the current Fragment each time?
20. Click event is blocked, but want to upload to the following View, how to operate?
21. Implementation of wechat home page
22. The principle of red dots on wechat messages
23. How to optimize a custom View
24. How does a lower version SDK implement a higher version API?
Describe the flow of a network request
26.HttpUrlConnection and OKHTTP relation
27. Understanding of Bitmap objects
28. Which architecture
29. The life cycle of pressing the Home button when the Activity has a Dialog on it
30. What methods must be executed when two activities jump between?
31. The foreground switches to the background, and then back to the foreground, the Activity lifecycle callback method. Pop-up Dialog, lifecycle callback method.
32. How ActivityThread, AMS, WMS works
33. How to consider model adaptation for custom View
34. Custom View events
35. What is the difference between AstncTask and AsyncHttpClient?
36 What is the difference between onTouch and onTouchEvent in event distribution and how to use them?
(3) Interview experience of Tencent Recruiting an Zhuo Gang (cool)
1, The difference between the two and their scenarios
2. Dynamic permission adaptation scheme and the concept of permission group
3. Network request cache processing, okHTTP how to handle network cache; How does bitmap handle large images, such as a 30M large image, and how does it prevent OOM
4, process survival
5, ListView image loading disorder principle and solution, ListView is how to do cache?
6, HTTPS related, how to verify the validity of the certificate, HTTPS used symmetric encryption, where used asymmetric encryption, the difference between the two?
7. Why does Android design ContentProvider, process sharing and thread safety issues
(1) Provide a way of cross-process data sharing:
The system manages the creation, lifecycle, and thread allocation of access to contentProviders, simplifying the way we share data (interprocess communication) between applications. We simply access the data interface suggested by the ContentProvider through the ContentResolver without worrying about whether its process is started or not.
(2) Better data access rights management:
ContentProvider can set permissions for developed data. Different URIs can have different permissions. Only components that meet permissions can access ContentProvider operations.
Wechat chat data are encrypted locally (to prevent root from being cracked), and a similar local data storage system is designed
8. Differences between JVM dependent and GC collection algorithms
9, Android related optimization (such as memory optimization, network optimization, layout optimization, battery optimization, business optimization)
10. Implementation principle of EventBus and application of observer mode in development?
11. How to use dynamic proxy mode?
12. How and why is App sandboxed?
(4) Didi Recruitment interview
One side
1. Ask questions related to the project;
2. Overview ****HashMap
A: HashMap is an asynchronous implementation of the Hash table-based Map interface. This implementation provides all optional mapping operations and allows null values and NULL keys. This class does not guarantee the order of the mapping, and in particular it does not guarantee that the order is constant.
3. The principle of HashMap;
4. When will HashMap be expanded?
A: Array expansion occurs when the number of elements in a HashMap exceeds the size of the array.
5. Talk about HTTPS related process;
6. Thread safety. Synchronized, lock various principles
7. How to ensure communication security?
8, how to implement list array?
Second interview
1. Introduction of project experience;
What are the values of content-type?
3. What are the common response codes?
(1) 200: If the request is successful, the browser will display the response body content (usually HTML) in the browser;
(2) 404: The requested resource is not found, indicating that the client incorrectly requested a non-existent resource;
(3) 500: The requested resource is found, but there is an error inside the server;
(4) 302: redirect. When the response code is 302, it means that the server asks the browser to send another request. The server will send a response header Location, which specifies the URL of the new request.
4. What are UNICODE and UTF-8, and how big are each Chinese characters in them?
5. How to publish in batches?
6. How to collect crash information when the application crashes?
7. How to judge if the application network is bad?
8. How to ensure communication security?
9. How does Android cache, picture cache, data cache, and cache mechanism? 支那
Js and Android coupling;
11, the react of native
12. Kotlin and Opinions;
13, flutter
14, algorithm: shuffling does not return to the original position;
Three aspects 1. The difference between thread locks;
2. Why is the efficiency of the same lock different?
3. Differences between polymorphism and overload;
(1) Polymorphism is built on the basis of rewriting bai, is the zhi relationship between classes and classes DU, occurs between dao of different classes, and subclasses rewrite the method of Zhuan parent class. Implement different subclasses, different implementations. There are three conditions for polymorphism: inheritance, overwriting, and superclass references to subclass objects
(2) Overloading is the difference in method configuration within a class, which occurs within the same class. The same function name, different parameters of multiple methods, to achieve the same type of function.
4, a Hashmap
5, the Jni
6. Design Mode: How to use observer mode?
7. Talk about your strengths and weaknesses;
What do you expect from a leader?
9. How much do you know about Didi? What’s your impression? Tell me what you think.
Follow the public account “programmer Meow” and share original knowledge from time to time