Android Global exception handling
Doing it android During project development , We all know that if the program goes wrong , A pop-up box will pop up for forced exit , There's nothing wrong with this in itself , But this UI It's so ugly , Don't say users can't accept it , Even ourselves may not be able to accept it . Although we always go through careful testing when we release programs , But it's hard to avoid unexpected mistakes .
Today, I'll define how to deal with a program error , similar iphone Flash back of .( Although flash back is also something users don't want to see , But the user experience is much better than the native pop-up window )
Close the door and brush the questions
I used to find a technology blog on the Internet , The effect of unsystematic learning is really too low , Often because of too much information , There is also time delay due to inaccurate information , It's easy to get distracted .
In addition to learning from videos , Just keep brushing this 1307 page Android Interview full set of real problem analysis .
This information has really helped a lot , comprehensive , The coverage rate is relatively high , It saves a lot of time and energy .
interview
In front of the shell to find a room and Netease , All passed , Although we didn't talk well in the end , But with some confidence . Later, I asked my friends to help me push Tencent , Three sides successfully won offer, Salary is 28K, It's up... Compared with the last job 15K.
This is mainly for Tencent's facial classics
one side
0、 Talk about the projects you have done ( Almost including self introduction ) Tell me the point of my expression : What have I done AndroidQ The adaptation of ; I used new technology in the project :LiveData、BiometricPrompt; I used design patterns : factory 、 Simple factory 、 Single case ; I'm constantly optimizing my code ; I focus on Google Developer conference
1、 I asked a lot about the technical points in my last job , Then the latter questions are almost all from here .
2、EventBus Comparison with callback . Is there any other way to solve the coupling between classes . Said the Li
《Android Summary of learning notes + Latest mobile architecture video + Big Android interview questions + Project actual combat source code handout 》 Free open source Hui Xin search official account 【 Advanced programming 】
vaData, But it's almost . Honestly, I don't know …… Now think about , This topic seems to have been mentioned in the information , however …… I didn't remember !!!
3、ListView and RecyclerView Comparison ,ListView Is it useless ? Said to achieve the effect , Code 、 Cache 、ViewHolder The difference of , Let's talk about it RecyclerView In more than one Fragment It's the same in Item The advantages of .ListView I almost didn't laugh when I was asked this question …… I saw whether the wechat team should update the card package interface to RecyclerView An article from , It is recommended to recite the full text ……
4、Service and AsyncTask contrast . because AsyncTask Since anonymous inner classes are not used, memory leakage is likely to occur , So I don't use , It's basically a thread pool . Then the interviewer asked AsyncTask Bottom , I just said handler+ Thread pool . Now recall , There are so few points : Life cycle ; Messaging ; The underlying implementation .
5、 Thread communication mechanism .handler、 Semaphore 、 The mutex 、 Critical area management synchronized And so on. 、 Shared variables volatile.
6、Android Process communication mechanism .AIDL、Binder、 Shared files . The first two have nothing to say , Old specialty . Talk about shared files , I thought it was very low, But recent research SharedPreference When , Find out if APP If the signature is the same , You can use the same SharedPreference, So it means sharing files . I'm not trying to express that I use shared files as a means of process communication , I just want to say I know SharedPreference.
7、ArrayList and Vector contrast …… Can't Vector, that ArrayList and LinkedList contrast . Bottom , Array , Linked list . Capacity expansion , I have summarized that the expansion method of all collection classes is the loading factor + Current capacity + Capacity expansion required . I said thread safe List Yes CopyOnWriteArrayList, But the interviewer didn't ask .
8、 Why is capacity expansion twice in many cases ? This will not , However, in many cases, the expansion of the underlying code is carried out by shift operation . It may be related to query ?
9、HashMap and HashTable contrast ,ConcurrentHashMap.HashTable No Map,HashTable yes Dictionary, And the lock is the lock array , Concurrency is very granular .ConcurrentHashMap It uses a segmented lock and has a : Sentenced to empty + Judge equal +CAS+synchronized A lock process , So it's powerful .
10、CAS relevant .
11、 Do you know about priority inversion ? I do not know! …… Go back and study ……
12、TCP Three handshakes, four waves . The main idea is through SACK And full duplex .
13、 Code , How to judge whether two linked lists intersect . I first thought of finding the first intersection point , Then he said the idea , The interviewer said there was no better . Then directly judge whether the last node is equal . The interviewer said if there was a ring , That can only be used HashSet Save it .
14、 ask . I asked what the following business group is . be supposed to PCG platform , I feel like I should be PCG It's up . Then I asked some questions about the company .
summary
The overall answer was ok , Just thought it was 2 Call for an interview , result 3 spot 30 Just face , Maybe I remember the wrong time . The state is not adjusted to the best .
Two sides
0、 Self introduction. .1、hashCode and equals Method .2、HashMap,hash Conflict resolution , Red black tree related .3、String、StringBuilder. Interviewer asked String Addition of
String a = "a"+"b"+"c";
StringBuilder sb = new StringBuilder();
a = sb.append("a").append("b").append("c").toString();
The efficiency difference between the two , I said no difference , The first one is String The addition of is optimized into the second by the compiler , He doesn't believe me …… But also good , Finally, the interviewer reached a consensus and went to check after the interview . Now I think the interviewer should want to ask this situation :
String a ="";
a+="a";
a+="b";
a+="c";
I'm still right .
4、wait、notify. Ask if it can only be locked wait and notify.[ Picture upload failed ...(image-1692c4-1602502611210)]5、 Inter thread communication mode .handler That set .
6、 Fast platoon principle , Best case and worst case time complexity . The worst case is in reverse order n**2, In order, my algorithm is still nlogn, Asked the optimization idea .
7、 Algorithm problem ,
Did you use greed ac, The interviewer prompts you to line up , I don't understand ……
8、 Thinking questions , If I want to save a binary tree to a file , What kind of format storage can make the reading efficiency the highest . This is an open discussion topic , And the interviewer have been discussing how to do .
【 I thought I was cold , I didn't expect to receive the notice from three sides 】
On three sides
0、 Self introduction.
1、 The internship work is deep
2、RePlugin The principle is deep , Comparison with other plug-in frameworks
3、 Why choose RePlugin frame
4、 You think you're interested in Android To what extent
5、 See what source code
6、 Why do you want to see the source code
7、 Why do you blog
8、 Know which famous open source frameworks
9、 What is a process , Process scheduling algorithm
10、 What is thread
11、 What do you think is JVM
12、 What are the thread synchronization algorithms
13、 What is a deadlock , for instance
14、Object What are the methods
15、Java What are the anomalies ,Error and Exception difference
16、OSI Seven layer model ,TCP、UDP Which floor is it , What are the protocols in the application layer
17、 If you want to design a method to download a large number of pictures , How to determine the concurrency , What are the indicators .
18、APP Is it safe to send messages between ? What can I do to be safe ?
19、 How to classify radio
20、 Customize View What are the keys to rewriting ,onLayout and onMeasure difference
21、Android What are the animations ,MotionLayout Let's talk about .MotionLayout Use scenarios .
22、Activity Four startup modes ,SingleTask and SingleTop Usage scenarios of
23、 some Framework Layer problem , Not really, so I can't remember . At that time, I collected a B standing UP Main video , If necessary, you can go and have a look
24、 Why do you want to know Framework Layer knowledge .
25、 Algorithm problem .
26、 What you think of us Offer The attitude of
27、 gossip
At the end of the article
Anyway , Whatever the size of the interview , If you don't want to be abused by the interviewer, don't want to , Only brush and blast the surface of the test questions to make a comprehensive preparation , Of course, in addition to this, we need to lay a solid foundation in our daily life , In this way, no matter what kind of knowledge the interviewer has to chisel into the dead , You can deal with it
Xiaobian will himself 6 Years since
Interview experience and study notes
All sorted into one **937 page PDF,** And some quality video tutorials I have seen in the process of advanced learning .
In fact, I see many friends around me complaining about their low salary , Including the author , The reason is that I didn't give the interviewer a good answer during the interview . Therefore, the author will continue to update the problems encountered in the interview process , I also hope you can make progress with the author , Learning together .
原网站版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061144464112.html