In the cold winter of 2020, an Android programmer's interview experience, where is the future?

Recalling my experience during this time, in September, the company notified the layoffs. I hurried out to meet a few, but in the end did not get an offer, I feel a bit cold this winter. By December, the company began the second wave of layoffs, and I decided to take the compensation and leave. In the follow-up interview process, I made some preparations, basically I can go to the hr face, and later I also successfully received the offer, I will share with you my job search experience, I hope to give you some reference.

The general Android interview is divided into two parts: the Java part and the Android part. Let me talk about some specific topics and some related knowledge points encountered during the interview.

One JAVA related

1) JAVA foundation

  1. What are the basic data types of java, int, long occupy a few bytes
  2. == What is the difference between equals
  3. The role of hashcode and equals
  4. new String creates several objects
  5. Some calculations of bitwise operators
  6. java unboxing
  7. The difference between compareable and compartor

List one or two problems encountered below

基本数据类型,int大小,一个字节占几位, int的取值区间。
Integer a = 123456
Integer b = 123456
return a==b 如果a = a b = 1 结果呢
int a = 2;
int rusult = a++ + 4<<2

求 result的值
public static String fun(String s) {
        return s.length() < 0 ? (fun(s.substring(1) + s.charAt(0))) : "";
    }

System.out.println("result = " + fun("Smart"));

它的打印结果是什么。

There are many questions like this, which examine the solidity of basic knowledge. So you need to consolidate the foundation.

2) Data structure and algorithm

Common data structures are: arrays, stacks, queues, collections, maps, linked lists, heaps, binary search trees, and red-black trees. Of course, there are other data structures such as AVL balanced trees.

All we have to do is understand their implementation principles and their respective advantages and disadvantages.

The most encountered data structure interviews are:

  1. The difference, advantages and disadvantages of ArrayList and LinkedList
  2. Hashmap implementation, how to do expansion, how to deal with hash conflicts, hashcode algorithm, etc.
  3. The linked list needs to be known. LinkedHashMap usually asks when asking LRU
  4. The characteristics and principles of the binary search tree. Write one of them in the order of traversal before, after, and when asked about the shortcomings of the binary search tree, you need to propose a red-black tree based on the binary search tree and state its characteristics.
  5. The realization of the heap, maximum heap, minimum heap, priority queue principle.

Algorithm Algorithm is actually some of our usual sorting: selection sorting, insertion sorting, bubble sorting, Hill sorting, merge sorting, quick sorting. And some calculation methods associated with the data structure to solve some problems.

Some problems encountered in the algorithm interview:

  1. Handwriting quick sort, insert sort, bubble sort
  2. Flip a number
  3. Flip a linked list
  4. O (n) complexity find the index of two numbers whose sum is 9 in the array
  5. Write one of the binary search tree traversal
  6. Implement a queue and record the largest number in the queue.

This part of the algorithm is recommended for practice. Go to Leetcode to brush up questions and develop thinking. The algorithm does not necessarily require you to write it, mainly to examine your ideas and how to optimize your algorithm.

3) JVM virtual machine

JVM virtual machine we need to know their internal composition: heap, virtual machine stack, local method stack, method area, counter. What is stored in each block, and which blocks are mainly collected during garbage collection. Where did the GC-ROOT chain start, garbage collection algorithm (rarely encountered questions).

Class loading ClassLoader has a parent delegation mechanism, the process of class loading, and in which blocks of the JVM the class loading information corresponds.

List an interview question for class loading encountered:

public class TestClassLoader {
    static class Father {
        public static final String TAG = "Father";

        static {
            System.out.println("static Father");
        }

        {
            System.out.println("unStatic Father");
        }

        public Father() {
            System.out.println("constract Father");
            method();
        }

        public void method() {
            System.out.println("method Father");
        }

        @Override
        public String toString() {
            return "toString Father";
        }
    }

    static class Son extends Father {
        public static Son instance = new Son();

        static {
            System.out.println("static Son");
        }

        {
            System.out.println("unStatic Son");
        }

        public Son() {
            System.out.println("constract Son");
            method();
        }

        public void method() {
            System.out.println("method Son");
        }

        @Override
        public String toString() {
            return "toString Son";
        }
    }

    public static void main(String[] args) {
        System.out.println("1.---------------------");
        System.out.println(Son.TAG);
        Son[] sons = new Son[10];
        System.out.println(sons);
        System.out.println("2.---------------------");
        System.out.println(Son.instance);
        System.out.println("3.---------------------");
        Son son = new Son();
        Father father = son;
        father.method();
        System.out.println(son);
    }
}

Write out the printout.

Add a small episode: Is the above question hungry? The person who interviewed me said that he was a graduate student of Beihang University in 17 years. I said that I paid great attention to basics, and asked a lot of JAVA basics throughout the process, including the above class loading question. I am proud to say that this question was created by him. There are also subclasses under Collections, and what are the differences. But the level of Android related questions is very general, saying that this does not mean ridicule. What I want to say is that some interviews are doomed from the beginning, you may not be able to enter this company. Sometimes the interview also depends on the eyes. Don't be discouraged, find your shortcomings, fill it up, and move on. There is also the above question, which is indeed very good.

4) Thread safety

When multiple threads access an object, if you do not need to consider the scheduling and alternate execution of these threads in the runtime environment, you do not need to perform additional synchronization, or perform any other coordinated operation on the caller to call this object. Can get the correct result, we think that this object is thread-safe.

Thread safety is some multi-thread download, synchronization, lock, deadlock, thread pool. The characteristics of the volatile keyword, the atomicity of variables. And the classes under the java.util.concurrent package, you also need to know.

Generally, you will ask about the advantages of handwritten singletons and double lock singletons. There is also let you implement a multi-threaded download, depending on how you design.

5) Programming ideas

Principles of encapsulation, inheritance, polymorphism, abstraction, reflection, annotation, design patterns, design patterns.

During the interview, you will usually ask:

  1. What is the difference between abstraction and interface
  2. Design patterns commonly used in work, design patterns in some source code
  3. Specifically give you a design pattern to let you talk about your understanding of him, such as observers, factories.

These things mainly check your code design ability.

6) Network protocol

  1. The implementation of the Internet is mainly divided into several layers, where is http, ftp, tcp, ip located.
  2. The difference between http and https
  3. Why does tcp go through three handshake and four waves
  4. Have you learned about socket

Generally, http and https ask more, and symmetric encryption and asymmetric encryption also ask. tcp and socket occasionally met with questions.

Two JAVA part summary

I think the JAVA part can be roughly divided into these big blocks. Think about a set of code. In fact, it is a class and a combination of these classes. How to combine is actually a design pattern. The class contains the basic data types and some data mechanisms to store these basic data types or classes, and then how to load these classes. I recommend several books for the above parts: "JAVA Programming Thoughts", "In-depth Understanding of the Java Virtual Machine Second Edition", "Big Design Mode", "HeadFirst Design Mode", "Data Structures and Algorithms", "Illustrated HTTP"

Data structure and algorithm key recommendations: https://github.com/wangxp423/ExerciseJava and Liu Yubo (liuyubobobo) mentioned in the readme of his open source code and documentation He recorded four sets of videos on MOOC to explain the data structure and algorithms. The documentation is straightforward. Very suitable for beginners, and those who want to understand the system.

Three Android related

For the Android part, I don't divide it into a few big pieces. Enumerate directly, but each item listed is often asked and extended in interviews, so it is necessary to study in depth.

  1. What are the four major components, say your role and understanding of them in the Android system.
  2. Activity life cycle, how does A start B run the life cycle of two pages, why does this happen, and why is the life cycle so designed, have you understood it?
  3. Four startup modes, what is the internal stack, how to use it in your work.
  4. Activity startup process, I strongly recommend that every Android developer know clearly, and follow the source code, the role of several core classes. You will have a better understanding of Android.
  5. Event distribution process, how to deal with sliding conflicts. Example: Long press an item of ListView it becomes gray. At this time, sliding. Item returns to its original state, and what happens to their internal events at this time. There are many ways to ask questions, so you have to figure it out.
  6. Customize the drawing process of View and View. What are the functions of onMeasure, onLayout, onDraw. How ViewGroup distributes the drawing. How to draw in onDraw, you need to understand Canvas, Path, Paint. And cooperate with ValueAnimtor or Scroller to achieve animation. Sometimes the interview will suddenly ask you that ViewGroup is a tree structure. I want to know the depth of the tree, how do you calculate it, and suddenly it becomes a data structure and algorithm problem.
  7. Bitmap and Drawable
  8. Animation and Animator
  9. LinearLayout, RelativeLayout, FrameLayout three common layout characteristics, how he calculates the layout. How efficient. CoordinatorLayout cooperates with the use of AppbarLayout and custom Behavior. Use of ConstraintLayout. Used to reduce the level.
  10. Handler message mechanism, it is recommended to look at the source code of Looper
  11. Inter-process communication, Binder mechanism
  12. Take a look at the AsyncTask source code.
  13. Image compression processing, three-level cache, Lru algorithm
  14. Resolution and screen density, as well as calculating a picture size. The relationship and ratio of mdpi and hdpi.
  15. Optimization, memory optimization, layout optimization, startup optimization, performance optimization. Memory leak, memory overflow. How to optimize, what tools are used, how to do it.
  16. ListView and RecycleView comparison, and cache strategy.
  17. JNI (rarely ask)
  18. MVC,MVP,MVVM
  19. The open source frameworks Okhttp, Glide, EventBus, Rxjava, etc., as well as the open source libraries under JetPack, will be used, also say something, recommend Retrofit, Okhttp, Glide, EventBus. Take a look at the source code.
  20. RecyclerView four major blocks, what effect can be achieved, roughly how to achieve, I must know
  21. DecorView, Window, WindowManager, PhoneWindow relationship, and personal responsibilities.

Bonus items: Kotlin, Gradle, Flutter, componentization, plug-inization, hot fix.

Four Android related summary

The relevant content of the above column seems to be a short sentence, but each item requires you to study in depth. To understand the principle, it is best to take a look at the source code implementation. Of course, there are still some that I did n’t write. It may be that I did n’t remember when I wrote them. It does n’t mean they are not important. You also need to pay attention to it. Another wave of recommendations: “Android Development Art Exploration” is highly recommended. If you are careless, it is recommended to read it two or three times, and read it targetedly. "Android Advanced Light", "Advanced Android Development and Intensive Combat", "Android Component Architecture", "Android Hot Repair Technology Principles", "Android Plug-in Development Guide"

Five interview experience

  1. The preparation should be adequate, the knowledge should be as wide as possible, and the depth should be sufficient.
  2. In the interview arrangement, if you are not in a hurry, try to save yourself as much time as you can, and make a summary in two days.
  3. You need to be calm. As a technical exchange, the interview depends on part of your luck, but also depends on some of the eyes. Some interviewers can feel that you are finished with this interview. The company you want to go to is not good for an interview, don't be discouraged, continue to refuel.
  4. In terms of resume delivery, there are many mismatches on the pull hook. It may be my academic qualifications (self-examination book). I have some self-confidence. If you feel the same, you may wish to change to BOSS or other platforms. Avoid hitting self-confidence.
  5. Writing a resume must reflect your own strengths, and it is best to reflect similar, what technology is used, and what problems are solved. Be sure to write down your resume.
  6. Similar to what your strengths are, what do you think are better in your project, and what can you bring to the company, this kind of problem needs to be thought about first, so that it is easy to be nervous and not good.
  7. The interview I have experienced is generally at least two rounds in technical terms. If after a round let you go, and you still feel good about yourself, then I think it is necessary for you to review the content of the next test and find the relevant content of the question one by one. Most of the problems are that you have not answered the idea. It may be that the depth is not enough, or it may not be enough. Continue to cheer.

Six chats

There are indeed quite a lot of questions in the interviews now, and the requirements are quite high. The market is not good and the salary is not good. Therefore, the mentality must be put on a good position. The mentality must be good.

After the interview, I should try my best to summarize it. From the beginning, I went out for an interview without any preparation. After I was hit, I summarized seven or eight interview questions. I will send new interviews to ask those knowledge points. The angle may be different, but As long as you have enough depth, how can he ask, you answer based on the principle, basically no difference, after signing the compensation agreement to come out for an interview, four consecutive companies have come to the HR, it can be said that the feeling of the interview has come up. The previous summary has not been in vain.

Before writing this article, I specifically read the interview questions posted by other public accounts that I have collected before. It is very complete. I do n’t want to write this article at all. But after thinking about it for the past three months, I heard about the layoffs to start the interview. When the first batch was not laid off, the second batch of layoffs was delayed. When the second batch came, the application was voluntarily cut. The mid-interview was hit and lost. When I saw the news, all of them were laying off staff. Now the overall interview feels pretty good. I still want to share my heart's journey. I want to tell you that don't panic when you lay off employees and do what you should do. If you can't decide for others, let them go first, and list 123 in your heart one by one.

It can be seen that I have recommended a lot of books on it, and the JAVA part comes in blocks. It is because when I see a lot of interview questions, when there are many questions, there will be many questions, and sometimes you will think that your questions will be all, but the interview is still not good, indicating that your knowledge is not solid. Or you know this question without understanding, so I will describe it in large parts in the JAVA part, and for each one, I recommend a related book. You may not need to read it all. You can look at it in a targeted way. . The Android part is a detailed knowledge point. I hope that these knowledge points can be studied in depth. The recommended books and some parts of the book have some relevant knowledge points. You can also choose to read them. Of course, forums and blogs are all sources of knowledge. You just need to make a basic class of knowledge depth and breadth.

Finally, although there are a lot of layoffs, it is said that Android is going to fall, but don't panic, make your own plans, learn your own habits, competition is everywhere, this is true in every industry. Good luck to everyone in 2020.

Guess you like

Origin blog.51cto.com/14775360/2487853