My recent situation

The project team has laid off staff, and I have not prepared for the interview for a year and a half. The previous change was also pushed internally. In this winter, we have experienced this, but also caught up with the layoff.

Mentality has already exploded, the environment is not good, you and dry and cherish…. Keep a record of your recent interview experiences and organize them to keep improving!

The right row

The company’s CEO is a former bytedance video director who created toutiao video APP. Company benefits are good, 15 salary in a small company is very good.

  • In the interview process, I felt that I failed. I did not fully prepare the algorithm, and because I had not been interviewed again for a year and a half, I was a little rusty. I did not answer many questions that should have been answered well
  • I am deeply impressed by the following questions: Lru algorithm, Binder mechanism, EventBus implementation and why not cross-process, how the Handler intercepts the previous message sent by handleMessage method, handwritten dichotomy search (not ready to get down to my hands), and then let me write bubbling, There are several ways to cross processes, AIDL, the handler mechanism, and ThreadLocal implementations. Each Thread object has a ThreadLocalMap. When a ThreadLocal is created, the ThreadLocal object is added to the Map, where the key is a ThreadLocal and the value can be of any type.

In this class, the most important methods are the set() and get() methods. When we call ThreadLocal’s get() method, we find the current thread’s ThreadLocalMap and then the corresponding value. The same goes for the set() method.)

How does the system monitor ANR (he said there was a separate process in the androidframework layer). Later, I was asked how to locate and investigate the blockCanary, and he asked me about the source code and principle. My answer was not very good (the application was stuck, A time-consuming operation must have been performed in dispatchMessage. We set a Printer for the main thread Looper, and count the execution time of dispatchMessage method. If the value exceeds the threshold, it means that there is a delay, and then dump various information to provide developers to analyze performance bottlenecks.

Finally, I know that I must die today, but I still have a lot of harvest.

PS: Tomorrow wudaokou interview betta fish, I hope to grasp

bettas

Betta, who’s been on a hiring spree lately? I only went through two rounds of interviews, with a total of more than two hours of interviews, but I didn’t reach HR, so I guess I’m exhausted

  • Douyu has a pen test, or quite simple casually write on OK, one side of the question is quite detailed, ask is roughly to see the resume to write things asked, the rules. What I remember deeply are the questions about handlerThread principle,MVVM mode, implementation principle and overlapping of bullet screen (I haven’t done this, the answer is not very good, and I used the open source library of STATION B directly before), Kotlin coroutine (I haven’t used this, AND KT’s mastery is still at the beginning stage), Retrofit+Okhttp+Rxjava in Huawei many phones will OOM is caused by thread overflow how to solve? Heap memory, stack memory understanding, stack how to convert piles? Is the memory leak in heap memory or stack memory? Why is that? BlockCanary principles? (the second time was asked!! How to print a method name that specifies a blocking thread? LinkedHashMap differs from HashMap… String a= “a” and String a= new String (” a “); MutiDex the first ANR and the solution. I think most of the questions answered is good, one side asked the salary and then began the second interview
  • The most impressive thing is to design an elevator system based on object-oriented. The key point of the problem is that all the attributes are related to the elevator, and the number of floors is fixed and constant. I went off the rails, always thinking of people and then to design. There will be no HR noodles after the end. Keep up the good work…

Zenjoy

This company, recommended by headhunter, is located in Galaxy SohoA, with a good office environment and a product orientation for overseas projects. However, after nearly three hours of interview, I was really frustrated. I drank nearly three small bottles of Ippo water to make it to the end.

One face and two faces

One, two too many questions to remember, only a few impressive questions

  • What does hashcode () and equals () do? Since hashCode() is not completely reliable, and sometimes different objects generate hashCode as well (there may be problems with generating hash formulas), hashCode() is only reliable most of the time, but not absolutely reliable, so we can get: The hashCode() of two equal objects must be equal, so using equal() is absolutely reliable. 2. Two objects whose hashCode() is equal are not necessarily equal, so hashCode() is not infallible.
  • Handler, Looper, MessageQueue, Thread? A thread can have multiple Handler instances. Each thread corresponds to a Looper, and each Looper corresponds to only one MessageQueue. Each MessageQueue corresponds to multiple Messages and runnables. So a one-to-many correspondence is formed, one side: thread, Looper, MessageQueue; Multi-party: Handler, Message. You can also see another one-to-one relationship: one Message instance for one Handler instance.
  • How do services and activities interact, download tasks in the background, and display progress in the Activity?
  • How to encrypt data during HTTPS handshake? How can the client ensure security and implement dual certificate verification? Please design a login function, what security issues need to pay attention to?
  • Hashmap implementation principle and how to resolve hash collisions (must ask), Hashmap underlying why is not thread safe?
  • HandlerThread principle and comparison of single New Thread benefits, advantages and trial scenarios? Note that handlerThreads are single threads that are not suitable for performing NETWORK IO operations.
  • Implementation principle of EventBus
  • SurfaceView, TextureView? From a performance and security perspective, SurfaceView is preferred with the player. 1. On Android 7.0, surfaceView has better performance than TextureView. It supports simultaneous update of object content location and contained application content. Advantages and disadvantages: Can be drawn in a separate thread, does not affect the main thread, uses double buffering mechanism, video playback smoother screen disadvantages: The Surface is not in the hierachy of View, and its display is not controlled by View attributes, so it cannot be translated, scaled or placed in other viewgroups. 3.TextureView Advantages and disadvantages: Supports animations such as movement, rotation, and zooming. Supports screenshots. Must be used in hardware-accelerated Windows, take up more memory than SurfaceView, render in main thread before 5.0, separate render thread after 5.0.
  • Handler postDelay How is this delay implemented?
  • Application startup process?
  • How to measure application startup time? 1. You can drive piles by code to calculate the startup time. 2
 adb shell am start -W [packageName]/[packageName.launchActivity]

Copy the code

On three sides

According to previous information search, three sides is not technical related question, but I this is not the same, on three sides is director, first lived to write an algorithm that is easy, mean roughly: give you a disorderly array, and gave it to a target, if the array with two Numbers is equal to the sum of the target, please output corresponding index of two Numbers?

Arrays: Sort the array into ascending order and then double loop… For (int I =1; for(int I =1; i <=n; i++) //O(N); for(int j=1; j <=i; j++) //O(N^2);

And then the

  • Design patterns
  • We argued about Restful interface specifications for a long time
  • The principle of the observer model

As far as I can remember, the director probably pays more attention to the basics and thinks that the overall performance is generally good. There may be some flaws in one and three aspects, and there are some questions in the main two aspects that the interviewer asked back and did not give me corresponding explanations, such as the handler postDelay. It took about three hours, but finally HR came in and told me to go back and wait for news.

Lai city science and technology

One side

The interviewer was a young man, and his questions did not live up to my expectations, because all the products were made in the same way and the frame used was Agora, so it was easy to answer, but there were a lot of questions that were fresh and new to me

  • How to create tables and associate tables (one-to-one, one-to-many, many-to-many) with GreenDao?
  • How can a Java call to Kotlin be wrapped without a Companion Object {}? If all members of a class are static members, changing the class to Object eliminates the need to wrap each method in a Companion Object {} wrapper. But kotlin said it was said that the latest kotlin could add a note and not need the package?
  • Breakpoint continuation implementation
  • What is the difference between proxy mode and decorator mode?
  • Java IO decorator pattern. I was asked which bag I had used was in decorator mode, and I didn’t answer!
  • App startup speed optimization?
  • New features for Android 5.0-8.0
  • Is Dalvik different from ART?
  • Process survival? (false proposition) there is no real meaning of the process to live, are white single only OK
  • Retrofit CreateApi implementation principle

Second interview

Second interview mainly director interview, interspersed with some technology, but always suggests that I’m here I think of what I need to work overtime to make sure that the (of course I want you to money in place, what all is not a thing) but in that case, because I asked some matters of the company processes, his answer is product rapid iteration, itself might not need routing, only products made to test the waters, and then overturned, This time and again, the plan can’t keep up with the rapid changes, and the general way I want to work is not like this. There may be some differences, or maybe because the mentality of the three hours before was broken down, maybe the attitude did not follow him, So the second meeting failed, and the HR sister lost the commission for recruitment.

PS: : In fact, I really want to go, but because this kind of work process is not suitable for me before, I just jumped out of the pit, he may see my hesitation and concerns, so I passed the technology. But I don’t care about the Buddha.

ZCOOL

This company is to pull the hook, the interviewer seems to help other departments recruitment, should be doing an online education project, sounds like the name of “high master”? The interviewer gave a detailed explanation of the questions that were not well answered, and I felt that the harvest was great.

The specific problems probably include:

  • In the multipart/form-data file upload form, it processes the form’s data into a message, grouped by labels and separated by delimiters. You can upload both key-value pairs and files. When the uploaded field is a file, the content-Type is used to name the file Type. Content-disposition, which specifies some information about the field; Because of boundary isolation, multipart/form-data can upload both files and key-value pairs. Multipart /form-data uses key-value pairs, so it can upload multiple files.
  • Custom View attributes refer to attr. Can the name defined in styleable duplicate the existing name in the system? Of course not, the compiler will pre-check that the system already exists or has previously defined a duplicate
  • The three Mode UNSPECIFIED methods of the custom View OnMeasure method are UNSPECIFIED. The parent control is unbound to its child control, and its child elements can be of any size as desired. This Measure is generally determined by the characteristics of the parent control. For example, a ScrollView, whose child views can be set to any size, no matter how tall, can scroll, size usually doesn’t matter. EXACTLY, the parent control specifies the exact size of the child View and expects the child View to be EXACTLY the size it is. Similar to scenarios 1 and 2 above, when a child View is a child View, the parent control usually determines its own MeasureSpec and the child View’s layout parameters. In general, in this case size>0, there is a definite value. AT_MOST(at most), the parent control specifies the maximum reference size for the child element and expects the child View to be no larger than this size, similar to scenario 3 above. This mode is also determined by the parent control’s own MeasureSpec and the child View’s layout parameters, usually when the child View’s layout parameters are wrAP_content.
  • WebView intercepting Url and cookie related? Web pages need to set login status and other situations
  • Why doesn’t the main thread in Android get stuck because of the dead loop in looper.loop ()? The main thread of an Android application creates an internal Linux Pipe before entering the message loop. This Pipe enables the main thread of an Android application to enter the idle wait state when the message queue is empty. And causes the application’s main thread to wake up when there is a message to be processed in the application’s message queue.
  • Android multithreaded access to SQLite database deadlock problem? The solution to database is Locked is to keep sqLite connection singletons, a single instance of SqliteOpenHelper, and add the synchronized keyword to all database operations. That is, there is a synchronization problem when reading and writing the database, so the singleton + synchronization lock method is used, and the database is closed after each database operation
  • Android multi-process memory allocation? Wechat also seems to have split multiple processes to reduce the heapSize of a single process
  • How does Android implement large image loading?
  • WeakReference Usage scenario?
  • How to refresh UI in Service?
  • How does Handler postDelay not block UI threads? 1. PostDelay () a 1-second MyTask is queued, MessageQueue is blocked, Looper is blocked, mBlocked is true, and needWake = mBlocked in enqueueMessage if. 2. Then A new task is posted, the message is queued, the new task is inserted into the head of the message queue (before the MyTask task), and needWake (true) calls the nativeWake() method to wake up the thread. 3. After the messagequyue.next () method is woken up, the first message B is returned directly to Looper without delay. 4. After processing the message, Looper calls the next() method again. MessageQueue continues to read the message linked list. 5. Wait until the blocking time expires or the next Message enters the queue.

tips

This interview is still a relatively comprehensive interview, both depth and breadth of the question are very deep, after the interview harvest their own shortcomings, I feel that their performance is ok, maybe because this post is just recruited, the time cycle will be very long, I don’t know whether to offer… But gain is good ~

Review the reference template

I am going to work as an Android Leader in a film and television company. The interview is over for now. I hope my interview experience can help you

Gold nine silver ten, consider recently a friend has an interview plan, can refer to one of the following test abstract

The review brush questions template covers: JVM, Multithreading & Concurrency, Android Basics, Handler, Binder, Framework, UI Animation, Jetpack, Android Architecture, Android Performance Optimization, Data Structures and Algorithms, NDK, Gradle, Kotlin , Flutter. It’s fairly complete. Friends in need can refer to here