Bytedance interview in March

insert image description here

I graduated with two majors, and I have been working for four years, and I have been working on Android.

All of them are second-tier companies, not first-tier companies. Jumped three companies in four years. Resting at home for several months,

Interviews started in March this year.

Due to too much job hopping and it is already the reason for the Android market. My byte buddy who pushed me inside, pushed me in after pushing I don’t know how many departments.

Here I still advise everyone not to change jobs as often as I do, alas. And if you want to enter a big factory, it is recommended to find someone to recommend. This is my first interview with Byte, and it is also my first interview this year. It is my first experience of various meanings.

Share the interview questions here

Organize the complete interview questions in the middle and advanced interviews of Android

img

1. Android interview related

1.Activity

​ ● Talk about the Activity life cycle

​ ● What methods will be called when Activity A starts another Activity B? What if B is a transparent theme or a DialogActivity

​ ● Tell me about the function of the onSaveInstanceState() method? When will it be called?

​ ● Activity startup process

​ ● onSaveInstanceState(), onRestoreInstanceState drop timing

​ ● activity startup mode and usage scenarios

​ ● Activity A jumps to Activity B, and then presses the return key, the order of life cycle execution

​ ● Switch between horizontal and vertical screens, press the home button, press the back button, lock and unlock the screen, jump to the transparent Activity interface, start an Activity whose theme is Dialog, and the life cycle of the Activity when the Dialog pops up

​ ● The difference between onStart and onResume, onPause and onStop

​ ● Is there a limit to the size of Intent, the method of transferring data between activities? If the amount of data transferred is too large, what are the solutions?

​ ● When will the Activity's onNewIntent() method be executed?

​ ● Explicit start and implicit start

​ ● scheme usage scenarios, protocol format, how to use

​ ● Four scenarios of ANR

​ ● The difference between onCreate and onRestoreInstance when restoring data

​ ● The way to transfer data between activty

​ ● Ways to start Activities across Apps, precautions

​ ● What is the Activity task stack

​ ● What are the flags commonly used by activities?

​ ● How the data of the Activity is saved, and how to restore the saved data after the process is killed

img

2.Service

​ ● The life cycle of service, the difference between the two startup methods

​ ● What are the two ways to start the Service? where is the difference

​ ● How to ensure that the Service is not killed?

​ ● How to communicate between Service and Activity

​ ● What is IntentService, the principle of IntentService, application scenarios and its difference from Service

​ ● How many return values ​​does the onStartCommand method of Service have? What do they mean?

​ ● The mixed life cycle of bindService and startService and how to close it

​ ● Which system services have you used?

​ ● Do you know about ActivityManagerService? what role does it play

img

3.BroadcastReceiver

​ ● Classification and usage scenarios of broadcasting

​ ● The difference between the two registration methods of broadcasting

​ ● The principle of broadcast sending and receiving

​ ● The difference between local broadcast and global broadcast

img

4.ContentProvider

​ ● What is ContentProvider and its use

​ ● ContentProvider permission management

​ ● The relationship between ContentProvider, ContentResolver, and ContentObserver

​ ● Implementation Principle of ContentProvider

​ ● Advantages of ContentProvider

​ ● What are Uri?

5.Handler

​ ● The implementation principle of Handler

​ ● Can a new Handler be directly created in the sub-thread? Why can the main thread’s Looper call the loop method for the first time? When and which class

​ ● Causes of memory leaks caused by Handler and their solutions

​ ● A thread can have several Handlers, several Loopers, and several MessageQueue objects

​ ● What are the differences between the methods of creating Message objects?

​ ● How does Message.obtain() maintain the Handler of the message pool? What are the methods for sending messages?

​ ● Differences and application scenarios between post and sendMessage of Handler

​ ● What happens to the message queue after the handler postDealy, assuming postDelay 10s first, then postDelay 1s, how to deal with these two messages

​ ● What is the data structure of MessageQueue

​ ● How does the Handler make a thread correspond to a Looper, and how to ensure that there is only one MessageQueue ThreadLocal in the Handler mechanism?

​ ● What is HandlerThread & Benefits & Principles & Usage Scenarios

​ ● IdleHandler and its usage scenarios

​ ● Message barrier, synchronization barrier mechanism

​ ● Can sub-threads update the UI?

​ ● Why the Android system does not recommend sub-threads to access the UI

​ ● Why does the main thread in Android not get stuck because of the infinite loop in Looper.loop()

​ ● MessageQueue#next will block when there is no message, how to recover?

​ ● In the Handler message mechanism, how does a looper distinguish multiple Handlers

​ ● When an Activity has multiple Handlers, how to distinguish which Handler handles the current message

​ ● When processing a message, how do you know which callback to process?

​ ● The difference between Looper.quit/quitSafely

​ ● How to implement thread switching through Handler

​ ● How Handler is associated with Looper

​ ● How Looper is associated with Thread

​ ● Looper.loop() source code

​ ● How does the enqueueMessage() method of MessageQueue perform thread synchronization

​ ● The internal principle of the next() method of MessageQueue

​ ● Whether the MainLooper can be used to create a Handler in the sub-thread, whether the Looper and the Handler must be in the same thread

​ ● The connection between ANR and Handler

Due to the large content of the article and the limited space, the information has been organized into PDF documents. If you need to know the complete document for Android intermediate and advanced interviews, you can add WeChat to get it for free! (Promise: 100% free)

Guess you like

Origin blog.csdn.net/Android_XG/article/details/130720606