This July, I will have been working for 3 years! I remember in the summer of 2017, I took off my academic gown and bid farewell to my entire student life. When I found my first formal job, I had been declared an official office worker! That vigorous era is also an era of youth. Now the aftertaste, very long.
Forgive me for a moment, but let’s get down to business. Do you want to know why I joined Bytedance after meeting with Alibaba 9 times and Tencent 5 times? Look officer, please continue to look down.
25 interviews with big companies
I believe that every graduate of software development dreams of entering a first-line big factory like BAT. You all want to enter, of course, I am no exception. We are all in the same boat!
Let’s start with me. I don’t like compliments but I’m a little proud of them. Double non a graduation, although there is no such thing as how fierce but also go, don’t say read grind I really don’t like to read, read grind every day to back English words don’t you feel bored? I prefer logical things, because in this way in the big factory interview algorithm questions basically answer right.
For me, I got into programming relatively early. When I was in senior one, because my brother brought me a book on SELF-learning C language, I began to indulge in the sea of programming and fell flat after a fall. Up to now THAT book I have not thrown away, now when I have time will have a look, but now it seems that there are too few knowledge points, suitable for beginners to learn. By the way, it’s called ** C Primer Plus **, amway.
Because the high school three years love programming, so I after the college entrance examination for the volunteer can only be computer this direction, others say that college life is rich and colorful, I also believe the high school teacher’s nonsense, said what high school three years do not play, good study until the university casually you play, the teacher does not take the tube of you. So that I still don’t have a girlfriend, really pissed me off…
During the four years in college, I learned Java, android and C++ by myself. Later, I had a certain understanding of the popular GO language and AI. However, I started to develop APP because of the words of my college teacher, who said: In the future, Android programmers must be especially popular, listen to the old man’s words into the pit is three years.
Although it is also very good now, in the word energy saving to 34K after tax, but I still feel that programmers need is not the market industry, the need is strength and technology, as long as you have hard strength, no matter how the market, where the company will accept you. Isn’t extrapolation a good example?
9 face Ali, 5 face Tencent heart course
Ali, Tencent and Byte have always been my goals. In fact, BEFORE graduation, I did not find the job I wanted, but found a small Internet company to do Android development (of course, IT was only after interviewing Tencent and Ali that I realized my own weakness).
But we can’t give up, not once and a second time, not twice and countless times. The least I can do is go into their R&D department and see how good their brains are at getting into a factory like that?
So, I began my three years of interviewing big factories;
For three years, I was stuck with countless interview questions that frustrated me and made me
The best advantage of me is that I can summarize in failure. I will write down the questions I can’t find in the interview, and then find the answers online after the interview, and record them in my own study notes.
Things like Android audio and video, **UI threads, view distribution reverse constraint methods, Future and MicroTask execution order, Java object locking and class locking, producer consumer (non-blocking) ** I’ll take note. This paved the way for me to successfully join Bytedance.
Ali’s 9 interviews
One side (2017 Enrollment)
- What are the four characteristics of the database, the isolation level of the database?
- What is the difference between HTTP and HTTPS?
- What are the three paradigms in database design?
- What about reverse linked lists?
- What is the difference between static proxy and dynamic proxy?
- What kinds of work queues do thread pools have?
- Can two processes require both write and read at the same time? How do I prevent process synchronization?
- What is ANR and how can you avoid it?
- How does APP performance stability work?
- What are your biggest feelings about memory optimization?
- How is the Kotlin feature different from Java?
- React Native? Let’s talk about the principle.
Second Interview (Autumn recruitment in 2017)
- How do I find out if the current thread is the main thread
- How do I detect if a function is stalling
- Commonly used symmetric encryption algorithm, what is the same
- View distributes the method of reverse restriction
I remember the interviewer was quite serious, which made me a little nervous and I hung up. Here’s a reminder that no matter what the interviewer asks you when you go into an interview, don’t panic.
Three Sides (2018 Spring Recruitment)
- Dart is passed by value or by reference
- The relationship between widgets and Elements and RenderObjects
- The root node of the widget
- The relationship between mixin extends Implement
- JVM memory model
- Future and MicroTask execution order
- await for
- The dart in.. The use of the
Four Faces (Spring Recruitment in April 2018)
- Future and MicroTask execution order
- The dart in.. What is the
- Await for use
- How is the startup mode of singleInstance assigned if the stack name is not specified
- The difference between ‘wait’ and ‘sleep
- What JVM threads are private
- How is the dynamic proxy method initialized
Five Faces (Autumn recruitment in October 2018)
- Brief introduction to the project
- Know which data structures
- Know which sorting algorithms
- Heap sort
- LinkedList and ArrayList; A HashMap expansion ConcurrentHashMap
- TCP and UDP: differences and application scenarios
- HTTP is TCP or UDP
- Differences between HTTP and HTTPS
- JVM memory model (where Static methods are located)
- Activity lifecycle, Activity start mode, Handler source code
- Rotate the array
Six Faces (March 2019 Spring Recruitment)
- The difference between final, finally and Finalize
- Inheritance of an abstract class’s member variables from its member methods
- A union is a union all
- MySQL index implementation
- B+ tree lookup time complexity, data structure
- What happened when you typed the url into your browser and hit Enter
- Three-way handshake
- HTTPS encryption process
- Principles of Symmetric and Asymmetric Encryption (RSA, AES)
- Single case of DCL torn by hand
- What other design patterns do you know
Seven faces (Spring Recruitment in April 2019)
- How is the dynamic proxy method initialized
- Cglib dynamic proxy
- What happens when three threads wait to wake up
- In the end, who is holding the activity? The handler leaks memory.
- Handler sendMessage and Postdelay differences
- The difference between an ArrayList and a HashMap
- Almost repetitive and vague
Eight faces (Autumn recruitment in September 2019)
- Stringbuilder is different from StringBuffer
- Lock is different from syncrognized, which applies to different scenarios.
- Realize the producer, the consumer
- Handler principle, how to implement delay.
- An activity starts the life cycle of another activity.
- Reverse a linked list
- Merge sort
- Quick sort
Nine Faces (Spring Recruitment in May 2020)
- Abstract classes and interfaces.
- Talk about the loading mechanism of classes.
- JVM memory reclamation mechanism, then you know which memory reclamation algorithm. The algorithm that the main one uses.
- The difference between abstract classes and interfaces.
- What startup modes does the Activity have
- The Fragment lifecycle is different from that of an Activity. (This answer is a bit confusing, can only say roughly the same thing)
- Explain the difference between threads and services.
- Explain event distribution mechanism, the view of a onFilterTouchEventForSecurity or what, the little brother is a unique method in the view, do you understand? (English level is not good enough, did not hear what is the method, say not clear.)
- How to encapsulate the recharge module
- The handler mechanism is explained.
- Template method to explain (head whiz, can’t remember)
- How to ensure application security and what to do.
- I understand the principle of reinforcement.
Tencent 5 aspects of the classics
One side
- Mmap + Native log optimization?
It describes two performance problems of traditional log printing, one is repeatedly operating the file descriptor table, one is repeatedly entering the kernel state, and then describes the principle and mechanism of MMAP.
- What’s the difference between broadcast and EventBus?
The implementation principle of EventBus is based on reflection, and it manages two tables, and the correlation between the code is not very easy to maintain. EventBus does not support cross-process communication. I said the source code I looked at was not supported and the interviewer said ok.
- What common design patterns do you know?
I started to talk about a lot of things, including the decoration design mode, which was interrupted by the interviewer. Please tell me more about the decoration design mode.
- What is cross-process communication?
Pipes, signals, semaphores, files, local sockets, shared memory, Binder drivers
- Binder drivers?
From the Java layer just like accessing the local interface, the client is based on BinderProxy server based on IBinder object, and from the native layer the client is based on BpBinder to ICPThreadState to binder driver, The server side wakes up IPCThreadSate to BbBinder by binder driver. Then I covered virtual memory, physical memory, and memory mapping. The principles of cross-process communication are kernel-based. When I talked about binder_open, binder_mmap, and binder_ioctl, I was interrupted by the interviewer in case I went on too long.
- How to pass large memory data across processes?
Binder is definitely not an option because the maximum memory size is only 1m-8K and can be in the form of binders plus anonymous shared memory, such as transferring large bitmaps across processes that require the underlying ashmem mechanism to be turned on.
- So how does ConcurrentHashMap work? What’s the initial size?
Is thread-safe, implementation principle is the use of piecewise lock, the initial size is 16, must be a power of 2.
- Startup optimization how to optimize?
I mentioned the key optimization of Application, but was interrupted by the interviewer, who said that you should stop talking about the things 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 that the optimization of package size can optimize the startup speed, and the optimization of DEX subcontracting can optimize the startup speed. Can refer to the latest Huawei ark compiler and so on.
- How do you implement rxPay and rxLogin?
Generally, we need to listen onActivityResult method when integrating third-party login and third-party payment SDK. I added transparent Activity by referring to the implementation scheme of RxPermission.
- Kotlin + Fullter
Second interview
- How can static inner classes be thread-safe?
- Basic implementation principle of synchronized, ReentrantLock fair lock and unfair lock.
- How can the main thread wait for all threads to complete and then execute a particular task? Principle and source code read?
- Customizing the general process of view, what to pay attention to how to optimize, click events and long press time are respectively how to achieve?
- How does the four startup modes work in source code analysis?
- How did you optimize the bindService process?
- What design patterns did you use in your development? Tell me exactly what happened. Why do you use method factory? What about the other two?
- RxJava in the process of using some unfriendly error general how to resolve? How to solve the problem of memory leak? Have you ever encountered the problem of system service memory leak?
- You use okhttp? Have you done any network optimization? Such as weak network environment.
- I’ll give you a number of ones, like 1000011 how many ones are there?
- Do you understand? What’s the worst that can happen? How do you optimize if you have a lot of duplicate data?
On three sides
- What is the underlying implementation of handler?
That simple? NativePollOnce handles delayed messages. In 6.0 or above, ePoll is used to monitor file descriptors. Then he asked why he used this method. What are its advantages over poll and SELECT? How does it listen have you seen how it works inside? It feels bad anyway.
- Tell me about some logging optimization you did?
Taking the first round of interviews a step further, you write the current size at the end of each file. Have you ever thought about what would happen if the file was destroyed? How to deal with this abnormal situation? Encryption and compression are also asked. Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver: Memory mapping with Binder driver Let me just write it down.
- What optimizations have you made in the company?
Memory optimization, startup optimization, network optimization, packet volume optimization, specifically about packet volume optimization. I mentioned that package volume optimization not only optimizes the package size, too large package size from the moment of installation, our application may be slow, because PMS will copy, decompress and parse our APK installation file, optimize our dex and so on, too large package size will affect our startup speed. Why does obfuscating resources reduce package size? What was it like when you optimized it and how much was it reduced?
- Some of the most difficult problems encountered during development?
Do you know how to fix class? How do you fix resources? If we register other attributes in the androidmanifest.xml of the plugin, what should we do about the resources?
All around
- Talk about your project first
Remote database to transfer the picture to app end, we then converted the picture into Base64 stored in the database, and then transmitted to app end, APP parse Base64 to obtain bitmap, directly display and then the interviewer crazy diss why to transfer the picture into Base64 and then pass (the second side also diss this, Ask if you can directly upload the picture address)
- Let’s talk about the framework of HTTP connections
- Retrofit principle
- What is dynamic proxy
- The custom view
- Inherit a viewGroup
- The activity life cycle
- Understanding the Handler mechanism
Five surface
- Java Exception Classification
- What is a compile-time exception
- What are the methods of object
- Why can a virtual machine make a class file recognizable to the machine
- What other formats do the client and server communicate in addition to JSON
I mentioned XML,hashmap, but I don’t seem to be very satisfied with it. Later I checked the data and found protobuf
- How does looper’s while loop determine scheduling in the source code, for example when MQ is empty?
- Dispatching events
Bytedance interview questions
One side
- The Jvm virtual machine
- MessageQueue will block the UI thread
- Object and class locks
- Zigzag print tree
- I can’t remember anything else, but I was so impressed by the second interview
Second interview
- Dart is passed by value or by reference.
- The relationship between widgets and Elements and RenderObjects
- The root node of the widget
- The relationship between mixin extends Implement
- JVM memory model
- Future and MicroTask execution order
- The dart in the… The use of the
- await for
On three sides
- Linux Network Model
- B + tree
- Blocking queue
- Differences between Redis and MongoDB. A few conceptual comparisons, and the underlying implementation.
- Algorithm: MergeksortedList, how about time complexity?
- What happens if a HashMap keeps putting elements? How about hashcode all the same? How about equals all the same?
I have compiled all the interview questions and answers into PDF, which also provides a guarantee for me to join Bytedance. If you need to interview recently, you need to refer to the interview questions(To be collected here)PDF data
speech
This blog is almost over. Finally, I hope all my friends can have a good end-result, find a well-paid job and get their own satisfactory offer.
Work together towards dachang, mutual encouragement! If you like, you can take out your little hand and give it a thumbs-up.