I have no intention of striving for spring, but I will be jealous forever! After reading this summary of the 2020 Android interview with major manufacturers, I will take off directly!

Preface

The color of grass is green and willow color is yellow, and the fragrance of peach blossoms and plum blossoms. After a happy Spring Festival, spring is here in a blink of an eye. Gold three silver four bronze five, this year's interview situation is grim, don't hug the Buddha's feet temporarily. The blogger believes that the best learning method for Android interviews and advanced learning is to brush questions + blog + books + summary. The first three bloggers will use this blog article vividly. As for the summary lies in the individual, the more it is actually Later, you will find that the interview is not difficult. The second is whether you think about it during the process of reviewing the questions. The second is the review of the questions. This is another level. I will not mention it here for the time being.

In fact, there are so many knowledge points in Android development, and there are still a few things to ask in interviews. Therefore, there are no other tricks for the interview, just look at how well you prepare for these knowledge points. So, when you go out for an interview, it is good to see which stage you have reached in your review.

Let's start to enter the text below. The following are the high-frequency interview questions of Tencent, Toutiao, Ali, Meituan, ByteDance and other companies that I have accumulated over the years of advanced learning. I hope it will be helpful to you.

1. Computer network

1. What is the difference between Tcp and Udp?
2. Realization of TCP reliable transmission principle (sliding window).
3. Describe the process and meaning of the TCP three-way handshake and four waved hands.
4. What is the relationship between Http and Https?
5. The difference between Http1.1 and Http1.0 and 2.0.
6. The message structure of Http.
7. How does HTTPS prevent man-in-the-middle attacks?
8. Http request method.
9. Https encryption principle.
10. Web request cache processing, how does okhttp handle network caching.
11. Authority management system (how is the underlying authority granted)?
12. The role and principle of Cookie and Session.
13. How does the client determine that the message sent by the client was received by the server?
14. What happened when the browser entered the address to the feedback result?

2. About data structure and algorithm

Algorithms can be said to be the necessary knowledge reserve for job hunting, depending on the company's business. Based on my interview experience, in general, I don’t ask much, and some companies don’t ask about algorithms.

But if you go to interview Byte, NetEase, Kuaishou, a company that must ask algorithms every round, it would be a pity that you can't get an offer for the algorithm questions.

Algorithmic questions are like the silent writing of ancient poems in the college entrance examination Chinese. There are not many points, but it is a pity to lose it.

It is mainly the accumulation of brushing questions in daily life.

Most of the company’s business involves not many algorithms, but interviewers from major companies like to ask about algorithms. In fact, they want to test/judge whether the interviewer is smart, hardworking, logical, and has little training potential. (Wide knowledge, and see a lot of open source library source code)

Brushing skills

1. Use more questions. Write all questions by yourself, not by looking at the code, but by yourself without looking at the code.

2. More summary, focusing on the following two aspects: Multiple algorithms for written test: array, linked list, queue, stack, sort, search, string, graph (graphics are more difficult, not many questions), multiple algorithms for binary tree interview questions : Hashmap, LinkedList, ArrayList

Dachang classic algorithm problem

Array

How to find the missing number in an array of integers from 1 to 100? (Google, Tencent)

Linked list

Comparison of the efficiency of an array insertion and deletion search and a linked list? If an array has to be inserted and deleted repeatedly, how can optimize and reduce the time complexity? (Tencent)

How to reverse a singly linked list without using recursion? (Xiaomi, Kuaishou)

Queue & stack

In a gift-giving scene, each gift has its own weight and attribute. How to process the gift according to the weight, and then queue for distribution, and how to design the data structure (Himalaya, Meituan) when one gift is taken at a time

Binary tree

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}, and his binary tree is How is it (58 in the same city)

Sort

top-k sorting (heap sorting, bitmap method) Meituan

Find

Design an algorithm to know the day of the week in a certain year, month and day, and find the day of the week corresponding to another year, month and day (Huawei)

string

Write a function to find the longest common prefix in a string array

Hashmap frequently asked

1. The underlying principle of HashMap? Is it thread safe? (Baidu)
2. How is put in HashMap implemented? (Didi)
3. Tell me about when expansion is needed in HashMap and how is the expansion resize() achieved? (Ali)
4. What is hash collision? How to solve it (
Meituan ) 5. The difference between HashMap and HashTable (Xiaomi)
6. The principle of hashmap concurrenthashmap (
Meituan ) 7. The difference between ArrayList and hashmap, why is the number faster?

The above real questions are excerpted from "Top 70 Interview Data Structures and Algorithms of Major Internet Companies". Those who need it can be downloaded and obtained for free on my GitHub

Quick start channel: Click here to pick it up for free!

Three, Java interview questions

Java basics

1. Introduce the GC recovery mechanism and generational recovery strategy.
2. If you were asked to write a piece of stack overflow code, what would you write, how big a stack might be, and why? Does each thread have a stack of this size?
3. There are several reference relationships in Java, what is the difference between them?
4. Under what circumstances will stack memory overflow occur?
5. What is a complete GC process in the JVM, and how can the objects be promoted to the old age?
6, Jvm memory structure to talk about.
7. What are the GC collection algorithms ? What are their characteristics?
8. Describe the GC mechanism. Will the Class be recycled? How to recycle unused Class? (Oriental headlines)
9, how to determine whether an object is recovered, which GC algorithm , the actual virtual machine uses the most is what GC algorithm ?
10. The difference between JVM DVM ART (360)
11. Please describe the process of a new object.
12. What is the difference between StackOverFlow and OOM? When did they happen, what is stored in the JVM stack, and what is stored in the heap?
13. What is the difference between String, Stringbuffer and StringBuilder? (Oriental headlines)
14. What is the difference between the Java virtual machine and the Dalvik virtual machine?
15. Will Java objects be allocated on the stack?
16. The difference between abstract classes and interfaces.
17. Why is String immutable?
18. What is passing by value and passing by reference, and is Java passing by value or by reference?
19. The difference between final, finally, and finalize.
20. The difference between overloading and rewriting ( JD )
21. try-catch-finally, there is return in try, is finally executed?
22. String s = new String(""); How many objects have been created?
23. The difference between Static class and non static class.
24. The difference between equals and == in java.
25. The difference between Execption and Error.
26. Describe the JVM class loading process.
27. What is the difference between PathClassLoader and DexClassLoader?
28. How to initialize the dynamic proxy method?
29. What is the parental delegation mechanism, and why is the parental delegation mechanism needed?
30. What is a dynamic agent? How to achieve?

Concurrent programming

1. What is HandlerThread?
2. AQS principle ( Xiaomi Jingdong )
3. What does the volatile keyword do? (What is instruction rearrangement)
4. The principle of Synchronized and the difference with ReentrantLock. (360)
5. What optimizations have Synchronized made after JDK1.8
6. What is a daemon thread? How do you exit a thread?
7. Realize non-blocking producer and consumer
8. Are tasks in AsyncTask serial or parallel?
9. What is the principle of AyncTask.
10. There are three threads T1, T2, T3, how to ensure that they are executed in order?
11. How to start a thread, what are the problems with opening a large number of threads, and how to optimize?
12. What is the difference between volatile and synchronize?
13. The difference between sleep, wait and yield, how does the thread of wait wake it up?
14. The realization principle of ReentrantLock.
15. If there is only one cpu, single core, multi-thread still useful?
16. The difference and scope of Synchronized static and non-static locks.
17. What are the ways to operate multithreading in Android?
18. How to get whether the current thread is the main thread.
19. What is HandlerThread?
20. How to communicate between threads?
21. The principle of RxJava thread switching, what are the differences between RxJava1 and RxJava2?

Four, Android related

Android basics

1. What is the life cycle of Acitvity?
2. The four startup modes of Activity, and the issues that need to be paid attention to in development, such as the call of onNewIntent();
3. Intent display jump and implicit jump, how to use?
4. Activity A jumps to B, B jumps to C, A can't jump to C directly, how does A send messages to C?
5. How does Activity save state?
6. The difference between Fragment add and replace has an impact on the life cycle of Fragment respectively.
7. Why doesn't the constructor of Fragment allow parameters to be passed? (Station B)
8. What is the life cycle of Fragment?
9. What is the difference between the context in Application, Activity and Service? Can you start an activity and dialog?
10. What is an orderly broadcast?
11. Please describe the startup process of Activity, starting from clicking the icon. (Station B)
12. What is the life cycle of Service?
13. Under what circumstances would you use Service?
14. What is the difference between startServer and bindServier?
15. What is the difference between Service and Thread?
16. Can threads be opened in onReceive? What are the problems?
17. Classification and working principle of broadcasting
18. What is the difference between static registration and dynamic registration of BroadcastReciver?
19. How to customize ContentProvider and what is the usage scenario?
20. The difference between IntentService and Service?

view related

1. How to optimize custom View
2. Android attribute animation realization principle, tween animation realization principle
3. View drawing process and custom View attention points.
4. Can the width and height be measured in onResume
5. What is the process of the event distribution mechanism? (Dongfang Toutiao)
6. How does View distribute reverse control?
7. Customize Behavior, NestScroll, NestChild. (Dongfang
Toutiao ) 8. View.inflater process and asynchronous inflater (Dongfang Toutiao)
9. Why is .inflater slower than custom View? (Oriental headlines)
10. The execution order of onTouchListener onTouchEvent onClick.
11. The difference and connection between Requestlayout, onlayout, onDraw, and DrawChild.
12. When a ListView or a RecyclerView displays news data, the picture is misaligned. What are the possible reasons & how to solve it?
13. What problems usually occur when a RecycleView is nested under a ScrollView?
14. How to refresh ListView & RecycleView locally?
15. How to add more mechanisms for pull-to-refresh & pull-down loading to ListView & RecyclerView.
16. How to intercept the event onTouchEvent if it returns false. Will onClick be executed?
17. Event distribution mechanism, advantages and disadvantages of the chain of responsibility model
18. Classification and differences of
animation 19. What is the difference between attribute animation and ordinary animation?
20. The difference of interpolator estimator
21. Comparison of RecyclerView and ListView, caching strategy, advantages and disadvantages.
22. RecyclerView's recycling and reuse mechanism
23. What is RecyclerView? how to use? How to return a different Item
24, what is the token in WindowMangerService? What is the difference?
25. Why can't Dialog use Application Context?
26. How to add Window (code implementation) through WindowManager?
27. The relationship between DecorView, ViewRootImpl, and View. Will ViewGroup.add() add one more ViewrootImpl?
28. Custom View executes the invalidate() method, why sometimes it does not call back onDraw()
29. There are animations in Android Which? Animation takes up a lot of memory, how to optimize
30. Why should ViewHolder be declared as a static internal class
31. The reasons for ListView stuck and optimization strategies
32. How to realize the rapid dimming of the Activity window
33, Activity, Window, View three The connection and difference of the user
34. The drawing process of the View is executed from which life cycle method of the Activity
35. The difference between invalidate() and postInvalicate()
36. The sliding method of the View
37. The comparison between RecyclerView and ListView, caching strategy, excellent Disadvantages
...

Android Framework

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

Android third-party library source code

1. The underlying network framework: OkHttp implementation principle
2. What optimizations does OKhttp have for the network layer?
3. How does okhttp handle network caching for network request caching?
4. Load a 10M picture from the network, what are the precautions?
5. Network packaging framework: Retrofit realization principle
6. Responsive programming framework: RxJava realization principle
7. Picture loading framework: Glide realization principle
8. How does Glide determine that the picture is loaded?
9. How to control the size of Glide memory cache?
10. The process of loading bitmap (how to ensure that no memory overflow occurs)
11. The application scenarios of soft and weak references in Android.
12. LruCache principle
13. Comparison between Fresco and Glide:
14. How does Bitmap handle large images, such as a 30M large image, and how to prevent OOM?
15. Event bus framework EventBus implementation principle
16. Memory leak detection framework: LeakCanary implementation principle
17 、How to judge whether an object is recycled in leakCannary?
18. Dependency injection framework: ButterKnife realization principle
19. Dependence on global management framework: Dagger2 realization principle
20. Database framework: GreenDao realization principle
...

Android APP performance optimization

This is mainly done in conjunction with your project asked the interviewer will ask you general project to optimize what's done, a common question is asked is:
optimization of thinking is what is
used in which technical
difficulties encountered (question)
How to troubleshoot
have What experience is
mainly combined with my own project to answer. Remember not to dig pits for yourself. For example, if you haven’t done this optimization before, if you say you have done it in order to express yourself, the interviewer can’t answer the next question. This is about integrity, you know~

Interview review notes analysis

The length of the article is too long with the answer analysis, so the real questions and answers are organized into Tencent face-to-face real questions PDF+ analysis

The information has been uploaded on my GitHub . Quick start channel: Click here to pick it up for free! Free sharing download

This information will be published in various blogs and forums starting from the spring recruitment. Collect the high-quality intermediate and advanced interview questions for Android development on the website, and then find the best solution for the whole network. Every interview question is a 100% real question + the best answer. Package knowledge + many details.
Save everyone's time to search for information on the Internet to learn, and you can also share it with friends around you to learn together.
Leave a thumbs up for the article and you can receive it for free~

The complete list
of notes has a total of 771 pages of PDF, and the complete version of the information is quick to start: click here to pick it up for free!

End of sentence

I always think that a technical interview is not an exam. I recite the questions before the exam, send you an exam paper, and give you a notification after you finish the exam.

First of all, a technical interview is a process of getting to know yourself and the gap between yourself and the outside world.

More importantly, the technical interview is a two-way understanding process. Let the other party discover your shining points, and at the same time try to find the other’s shining points, because he may be your colleague or leader in the future, so the interviewer asks When you have any questions, don't say no, try to understand the content of his work and the atmosphere of the team.

Looking for a job is nothing more than looking at three points: who you are with, what you do, and how much you give, and you have to divide the three in your own mind.

Finally, I wish you all find your favorite destination in this unfriendly environment!

If the article is helpful to you, please give a like to support it, or share it with friends around me. This is very important to me, thank you!

Guess you like

Origin blog.csdn.net/Androiddddd/article/details/114080926