Ah inside 9 times, Tencent face 5 times, but the bytes are entered? The most authentic record of 25 interviews with major manufacturers in three years of Android programming dog development

As of July this year, I have been working for 3 years! I remember that in the summer of 2017, I took off my university degree uniform and bid farewell to my entire student days. When I found my first official job, I had already declared that I was an official office worker! That vigorous era is also an era of youth . Now the aftertaste is very long.

Forgive me for being hypocritical for a while, now I get to the point. I want to know why I have been in the job 9 times and Tencent interviewed me 5 times. Judge, please continue to look down.

Reasons for 25 big factory interviews

I believe that every graduate of software development dreams of entering a major factory like BAT, and you all want to enter. Of course I am no exception. Who would call us "comrades in the same way"!

Let me talk about me first, although I don't like others to praise me, but you still have a little pride in me. Shuangfei graduated from a single book. Although I can’t say how good it is, it’s okay. Let alone graduate school, I really don’t like to read. Don’t you feel annoying to memorize English words every day in graduate school? I prefer logical things, because in the subsequent interviews with major factories, the algorithm questions are basically answered correctly.

Me, I got in touch with programming relatively early. In the first year of high school, because my brother brought me a self-study C language book, I began to indulge in the sea of ​​programming and fell into a slump. I haven't thrown away the book so far. I will read it when I have time, but now it seems that there are too few knowledge points in it, and it is suitable for novices who are just starting out. By the way, this book is called "C primer plus" . Amway.

Because I have loved programming for three years in high school, I can only apply for the computer as a volunteer after the college entrance examination. Others say that college life is rich and colorful. I also believed in the high school teacher's nonsense, saying what you don’t want in high school for three years. Play, study hard, wait until you go to university and play as you like, the teacher will not take care of you. So that I still don’t have a girlfriend, so I'm so angry...

In the four years of university, I taught myself Java, Andorid, and C++ . Later , I also had a certain understanding of the hot GO language and AI , but because of a passage from my university teacher, I embarked on the road of APP development, because of the explosion of Douyin. Fire, countless short video apps turned out, he said: In the future, Android programmers will be particularly popular. It will be three years after hearing the old man’s words.

Although it’s pretty good now, it can reach 34K after tax in the byte, but I still think that what programmers need is not the market industry, but the strength and technology. As long as you have hard power, no matter what the market situation is, you will go wherever you go. Companies accept you. Isn't interpolation a good example?

Nine aspects of Ali, five aspects of Tencent's mental journey

Ali, Tencent and Byte have always been my goals. In fact, before graduation, I didn’t find a job that I wanted. I just found a small Internet company to do Android development (Of course, after I interviewed Tencent and Ali, I understood that I was Lack of own strength ).

But we can’t give up. Once we can’t do it, there will be a second time, and we can’t do it twice and there are countless times. At least I have to enter their R&D department to see how good their big cows are to get into such a big factory?

So, I started my three-year interview with a big factory;

For three years, I got stuck under countless interview questions, which frustrated me and made me

The best thing about me as a person is that I will summarize in failure. I will write down questions that I will not encounter in the interview. After the interview, I will find the answers online and record them in my own study notes.

For example, like Android audio and video, UI thread, view distribution reverse control method, Future and microtask execution order, Java object lock and class lock, producer consumer (non-blocking) I will write down. This also paved the way for me to successfully join Bytedance.

Ali 9 times face sutra

One side (2017 school recruitment)

  1. Four characteristics of the database, the isolation level of the database?
  2. What is the difference between HTTP and HTTPS?
  3. What are the three paradigms often mentioned in database design?
  4. Talk about reversal linked list?
  5. What is the difference between static proxy and dynamic proxy, in what scenarios?
  6. What kinds of work queues are available in thread pools?
  7. Can two processes require writing or reading at the same time? How to prevent process synchronization? 
  8. What is ANR and how to avoid it?
  9. What is the stability of APP performance?
  10. What is your biggest feeling about memory optimization?
  11. What are the differences between Kotlin features and Java?
  12. How much do you know about react native? Tell me about the principle.

Two Sides (2017 Autumn Recruitment)

  1. How to get whether the current thread is the main thread
  2. How to detect if the function execution is stuck
  3. Commonly used symmetric encryption algorithms, what are the same
  4. View distribution method of reverse restriction
  5. The interview was not resumed in time, so I almost forgot the interview questions in the second half hour. The interviewer was more serious this time, which made me a little nervous, so I ended up hanging up, and then there was a new round of interviews.

Three sides (2018 spring recruitment)

  1. Is dart passed by value or by reference
  2. The relationship between Widget and element and RenderObject
  3. widget's root node
  4. The relationship between mixin extends implement
  5. jvm memory model
  6. Future and microtask execution order
  7. await for
  8. Usage of .. in dart

Four sides (Spring recruitment in April 2018)

  1. Future and microtask execution order
  2. What is in dart
  3. await for use
  4. If the startup mode of singleinstance does not specify the stack name, how is it allocated?
  5. The difference between wait and sleep
  6. What are the private jvm threads
  7. How to initialize the dynamic proxy method

Five Faces (Autumn Recruitment in October 2018)

  1. Brief introduction to the project
  2. Know which data structure
  3. Know which sorting algorithm
  4. Heap sort
  5. LinkedList and ArrayList; HashMap expansion ConcurrentHashMap
  6. TCP and UDP, the difference and application scenarios
  7. Does http use TCP or UDP
  8. The difference between http and https
  9. JVM memory model (where is the Static method)
  10. Activity life cycle, Activity startup mode, Handler source code
  11. Rotate the array

Six sides (Spring recruitment in March 2019)

  1. The difference between final, finally, and finalize
  2. Inheritance of member variables and member methods of abstract classes
  3. The difference between union and union all
  4. Implementation of MySQL index
  5. B+ tree search time complexity, data structure
  6. What happened after typing the URL in the browser and hitting enter
  7. Three handshake
  8. https encryption process
  9. Principles of symmetric encryption and asymmetric encryption (RSA, AES)
  10. Hand tear DCL single case
  11. Know what design patterns

Seven Faces (Spring Recruitment in April 2019)

  1. How to initialize the dynamic proxy method
  2. cglib dynamic proxy
  3. Three threads wait, what is the wake-up situation
  4. In the end, who owns the activity, the handler memory leaks (the memory leak is really very lucky, I just found it in the video)
  5. The difference between handler's sendmessage and postdelay
  6. The difference between arraylist and hashmap, why is it fetching fast
  7. Almost repetitive and fuzzy

Eight sides (Autumn Recruitment in September 2019)

  1. The difference between stringbuilder and stringbuffer
  2. The principle of lock and syncrognized is different, and what scenarios are suitable for.
  3. Realize producer, consumer
  4. The handler principle, how to achieve delay.
  5. An activity starts the life cycle of another activity.
  6. Reverse linked list
  7. Merge sort
  8. Quick sort

Nine Faces (Spring Recruitment in May 2020)

  1. Explain abstract classes and interfaces.
  2. Talk about the loading mechanism of the class.
  3. The memory recovery mechanism of jvm, then you know which memory recovery algorithms. The main algorithm used.
  4. The difference between abstract classes and interfaces.
  5. What are the startup modes of Activity
  6. What is the difference between the life cycle of Fragment and Activity? Explain the order of execution. (This answer is a bit puzzled, I can only say that it's basically the same thing)
  7. Explain the difference between thread and service.
  8. Explain the event distribution mechanism. There is an onFilterTouchEventForSecurity in the view, or what, the little brother said that it is a unique method in the view, do you understand? (I don’t know the level of English, and I don’t know what the method is. I don’t know it clearly.)
  9. How to package the recharge module
  10. Explain the mechanism of the handler.
  11. Explain the template method (my head is pumped, I can’t remember)
  12. How to ensure the security of the application and what processing has been done.
  13. Well understand the principle of reinforcement.

Tencent 5 Faces

one side

  • mmap + native log optimization?

Two performance problems of traditional log printing are discussed. One is to repeatedly manipulate the file descriptor table, and the other is to repeatedly enter the kernel mode, and then the principle and mechanism of mmap are discussed.

  • What is the difference between broadcast and EventBus?

It is said that the implementation principle of EventBus is based on reflection, which manages two tables, and the correlation between the codes is not very easy to maintain. EventBus does not support cross-process communication. The interviewer asked you whether you are sure that cross-process communication is not supported? I said that the source code I looked at was not supported, and the interviewer said that's fine.

  • What do you know about common design patterns?

I started talking about a lot of Balabala, which talked about the decorative design pattern , which was interrupted by the interviewer, please talk about the decorative design pattern specifically.

  • What are the cross-process communications?

Pipe, signal, semaphore, file, local socket, shared memory, binder driver

  • Briefly talk about binder driver?

From the Java layer, it is like accessing the local interface. The client is based on the BinderProxy and the server is based on the IBinder object. From the native layer, the client is based on BpBinder to ICPThreadState to the binder driver, and the server is driven by the binder to wake up IPCThreadSate to BbBinder. Then I talked about virtual memory, physical memory, and memory mapping. The principle of cross-process communication is based on the kernel. When I talked about binder_open, binder_mmap and binder_ioctl, they were interrupted by the interviewer. I was probably afraid that I had been talking for too long.

  • How to transfer large memory data across processes?

I said that binder is definitely not good, because the maximum mapped memory is only 1M-8K, and the form of binder + anonymous shared memory can be used. For example, to transfer large bitmaps across processes, you need to open the ashmem mechanism at the bottom of the system.

  • Talk about the realization principle of ConcurrentHashMap, what is the initial size?

It is thread-safe. The implementation principle uses a segmented lock. The initialization size is 16 and must be a power of 2.

  • How to optimize startup optimization?

I talked about the key optimization of Application, but I was interrupted by the interviewer. Don’t say anything that everyone can think of. What I want to hear is whether you can do some optimization from the perspective of the system. I mentioned the optimization package size. The size can optimize the startup speed, and the optimized dex subcontracting can optimize the startup speed. You can refer to the latest Huawei Ark compiler and so on.

  • How do you implement the rxpay and rxlogin?

Generally, when we integrate third-party login and third-party payment SDK, we need to monitor the onActivityResult method. I added a transparent Activity by referring to the implementation of RxPermission.

  • kotlin + fullter aspect

Two sides

  1. Singleton design patterns are written, how do static inner classes ensure thread safety?

  2. Synchronized underlying implementation principle, ReentrantLock fair lock and unfair lock.

  3. How does the main thread wait for all threads to complete before performing a specific task? Have you seen the principle and source code?

  4. In the general process of customizing the view, what should be paid attention to and how to optimize, and how are the click events and the long press time realized respectively?

  5. What are the principles of the four startup modes in source code analysis?

  6. Talking about the process of bindService, how did you optimize the background service process?

  7. What design patterns have you used in development? Talk about the specific scene at that time. Why do you use method factories, the other two?

  8. RxJava encountered some unfriendly errors during use, how to solve it? I found out how to solve the problem of memory leak in general. Have you ever encountered the problem of system service memory leak?

  9. What okhttp do you use? Have you done some network optimization? For example, a weak network environment.

  10. Give you the number 1. For example, how many ones are there in 1000011?

  11. Quick queue, don’t you understand? What is the worst case? How to optimize if there is a lot of duplicate data?

Three sides

  1. Talk about the underlying implementation principle of the handler?
    So simple? When I asked about the bowl, I gradually said that the delayed message is processed by nativePollOnce. In 6.0 and above, the epoll method is used to monitor the file descriptor. Then I asked why this scheme is used? What are its advantages over poll and select? How does it monitor? Have you seen its internal implementation principle? It feels very uncomfortable anyway.

  2. Tell me about the logging optimization you did?
    Let’s talk about the first round of interviews again. You write the size of the current content at the end of each file. Have you ever wondered if the file is damaged? How to deal with this abnormal situation? Encryption and compression are also asked later.

  3. You have read the source code of the binder driver, talk about its memory mapping process, talk about the client waiting for the server to process the return process, if you want to transfer large memory data across processes, what would you do? Just write it down.

  4. What optimizations have been made in the company?
    Memory optimization, startup optimization, network optimization, package volume optimization, specifically, package volume optimization. I mentioned that the package size optimization is not just to optimize the size of the package. The package size is too large. From the moment of installation, our application may be slower, because pms will copy and decompress and parse our apk installation files. Optimize our dex and so on. The size of the package will also affect our startup speed. Then Barabala said how to do it, and asked why confusing resources can reduce the size of the package? How was the effect reduced when you optimized?

  5. Some of the most difficult problems encountered during the development process?
    Mentioned dynamic repair replace loading so, do you know how to repair class? How to repair resources? Later, I talked about plug-inization. It was mentioned that 360 uses borrowed corpses to resurrect. What if we register other attributes in the plug-in's Androidmanifest.xml, and how to deal with resources?

All sides

  1. Talk about your project first

The remote database transfers the picture to the app. We converted the picture to base64 and stored it in the database at the time, and then transferred it to the app. The app parsed the base64 to obtain the bitmap and displayed it directly. Then the interviewer was crazy diss. Also diss this, and ask if you can send the picture address directly)

  1. Talk about the framework of http connection
  2. retrofit principle
  3. What is a dynamic proxy
  4. Custom view
  5. Inheriting viewGroup
  6. activity life cycle
  7. Understanding of the handler mechanism

Five sides

  1. java exception classification
  2. What is a compile-time exception
  3. What are the methods of object
  4. Why the virtual machine can let the class file be recognized by the machine
  5. In addition to json, what other formats for client and server communication

Speaking of xml, hashmap, but I don’t seem to be very satisfied. Later, I found protobuf on the Internet.

  1. How does the while loop of looper in the source code determine the scheduling, such as what to do when the MQ is empty?
  2. Event distribution

Byte Beat Interview Questions

one side

  1. Jvm virtual machine
  2. Will messageQueue block the UI thread
  3. Object lock and class lock
  4. Zigzag print tree
  5. There are other things I can’t remember, mainly because I am too impressed with Nimian

Two sides

  1. Is dart passed by value or by reference,
  2. The relationship between Widget and element and RenderObject
  3. widget's root node
  4. The relationship between mixin extends implement
  5. jvm memory model
  6. Future and microtask execution order
  7. The usage of... in dart
  8. await for

Three sides

  1. linux network model
  2. b+tree
  3. Blocking queue
  4. The difference between redis and MongoDB. Comparison of several concepts, as well as the underlying implementation.
  5. Algorithm question: mergeksortedlist, what is the time complexity?
  6. What happens if HashMap keeps putting elements? How about all hashcodes being the same? How about the equals methods are the same?

All the interview questions and answers are compiled into PDF by me, which also provides a guarantee for my entry bytebeat. If you need an interview in the near future, you need a small partner who needs to refer to the interview questions (get it here) PDF information

Testimonials

The blog is almost over when I write it here. In the end, I hope that all my friends can have a good home, find a high-paying job, and get a satisfactory offer. Work hard together towards Dachang and encourage each other! Friends you like can take out their little fingers to like (#^.^#)

Guess you like

Origin blog.csdn.net/qq_39477770/article/details/107736561