Author: Lao Wang

The opening

First, I would like to explain that the owner of this building is a non-undergraduate student who has three apps on the store. As a junior student, he sent in his resume on April 1st, took the written test in the middle of April, received the interview invitation from Byte at the end of April, attended the first round of interview in early May, and attended the second interview in the middle of May. On May 27, I attended three offer mail on June 8


One side (60 mins)

15 minutes before

  1. Personal introduction, when did you contact android development, how long can you intern, introduce the project
  2. You said your software appeared in OOM, how did you solve it? What did you use to analyze online crash?
  3. Where do these programs come from? Where does all this stuff come from in the software? Do you know where the back end comes from? Did the back end climb down? How many uploads are there per day?

For the next 15 minutes

  1. What’s the difference between a process and a thread? Why define such a concept? What’s the use?
  2. What kind of data structure is a hash table? How do I avoid hash collisions? What are the characteristics of capacity?
  3. Do you know anything about the database? Index understand? How to achieve fast search? What was the quick search for?
  4. How does TCP ensure stable transmission?
  5. Talk about the startup mode of your Activity
  6. Does Handler understand? How does that work? MessageQueue uses CPU resources in a loop when there is no message.
  7. I see you’ve used some open source libraries like OKhttp, can you explain how it works? Okhttp provides the following InterceptorChain intercepts: What are these interceptors for?

And then 12 minutes

What do you think you’re good at that I haven’t asked?

  1. So why don’t I tell you how the screen draws a View
  2. Why is the performance of multiple measurements poor? How does Compose solve this problem?
  3. OnMeasure has a MeasureSpec. Can you tell me what MeasureSpec is

Final algorithm: Offer 38. String arrangement – LeetCode (leetcode-cn.com)


How to avoid collisions as much as possible

Second interview (45 minutes)

  1. Do you mainly use Java or Kotlin? (Me: Kotlin, Interviewer: Let me ask you something about Java.)
  2. How do I create a thread? The difference between start and run? What’s the difference between thread and process? Can a process have no threads?
  3. What is the main thread in Android? Can I refresh the UI in another thread? What are the special cases that you can put in other threads? How to pop a toast in a child thread? (Looper. Prepare in advance)
  4. Looper.prepareWhat did he do? Can you introduce meThreadLocalWhat about the internal implementation?
  5. In Java, we need to access a local file. What should we do? FileInputStream reads binary stream data. How do you read text? How do you tell if you’re at the end of the file?
  6. Do you have any difficult problems? (I: OOM my project often appears (I want the interviewer to ask me about the project, but he doesn’t ask me)) what scenario will generate OOM? What’s the reason? How did you solve it?
  7. Suppose a picture is big, what do you do with it? (I: Glide/BitmapFactory), how do you scale it exactly? Assuming the BitmapFactory inSampleSize is set to 2, how much will the image footprint be reduced? ARGB_8888 differs from RGB_565.
  8. Headers are common HTTP requests. What are the common status codes? What is 206? Have you ever used breakpoint continuation?
  9. Introduce the Jetpack componentViewModelandLiveDataHow does it work? Why can the ViewModel follow the Activity’s life cycle and retain data during rotation? (I mentioned MVVM architecture in ViewModel, I wanted him to ask, but he didn’t.)
  10. What’s the difference between heap memory and stack memory? The heap memory is the main area of gc, I want him to ask me gc, but he didn’t ask.
  11. In JavaClassLoderWhat is the loading mechanism? Should I load the parentClassLoder first or my own? What is the purpose of this?
  12. Java reflection? How about accessing some private methods and variables?

Algorithm: 230. The KTH smallest element in the binary search tree – Force button (LeetCode) (leetcode-cn.com)

At the beginning, you recurse the number of child nodes. The interviewer said that you will recurse the number of child nodes many times. Can you reduce the complexity? And then I used the middle order traversal

What do you do? You can’t limit how visitors use it. What do visitors do if they want to run the algorithm in multiple threads?


Some that maybe didn’t answer well at the time:

  1. What about shared memory between threads?

    Threads share memory, but why are they out of sync? (Multithreaded visibility) Because in addition to memory, data is cached in CPU registers and levels of caches, when changing a variable, it may be written to the cache first and then updated to memory later

  2. How does ThreadLocal work?

    The hashCode of hahsmap is based on the order in which threadLocal is fetched by the current thread. The hashCode is an atomicInteger that is incremented by a specified value each time using the nextHashCode method. Each thread then maintains a ThreadLocalHashMap, and ThreadLocal’s get and set methods are essentially ThreadLocalHashMap objects that operate on the current thread

Three sides (40 mins)

  1. Introduce the project
  2. Introduce LaunchMode
  3. What is the purpose of the activity process in the Manifest?
  4. Has been introducing projects…
  5. Q: How does the team support Kotlin? What about Jetpack? What about training new people?

Then the three sides passed, nothing difficult, ask the project that can be too simple, as long as you have enough confidence in your project should be no problem

conclusion

The feeling of this interview is to have a deep understanding of their own projects, no matter the advantages or disadvantages, how to optimize will achieve better results, so that in the interview can better answer the questions raised by the interviewer, from which to their own points. The second is to do a good job in advance before the interview preview some of the technical knowledge points learned and used before, this prevents the interviewer to ask some other technical questions can not answer, resulting in the interview failure, which is a big loss.

Finally, I would like to share some Android development related learning documents, interview questions, Android core notes and other documents collected by xiaobian before the online, hoping to help you learn and improve, if you need reference, you can directly go to my GitHub address: https://github.com/733gh/Android-T3 access to reference.