Android engineer interviews have been rejected repeatedly: What’s more terrifying than poor hair loss is that you don’t know these high-frequency interview questions

Preface

If job hunting is a hurdle in life, then the interview is the most difficult brick to overcome.

After you have experienced interviews of all sizes, you will find that different companies and different interviewers ask similar questions, because companies have some common requirements for selecting talents, as long as they are in advance according to high-frequency questions before the interview Prepare, the hit rate is almost equal to 100%!

However, why are there so many skilled and experienced job seekers who are repeatedly rejected in the interview process and have not been able to get the high-paying offer from the big factory they like?

As a curious baby, I went to ask colleagues who have interviewer experience in Dachang , and then I learned why these job seekers were not favored by hr:

First of all, some students' resumes seem to have comprehensive skills and rich project experience . But some basic principles are difficult to answer . It is really difficult for the interviewer to trust some of his project experience and technical level.

Secondly, although some students have realized their shortcomings, they just searched the Internet for interview questions and found the same answers . Although they can answer fluently with a little memory, it is difficult to stand out .

Not knowing how to show one's strengths in the interview has become the biggest stumbling block in the job search.

Next, I will sort out the real questions of the high-frequency interviews with Android manufacturers in recent years, and then take this opportunity to talk about the things that need to be paid attention to in the interview.

One, Java related

1) JAVA foundation

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

List one or two problems encountered below

2) Data structure and algorithm

Common data structures are: array, stack, queue, collection, mapping, linked list, heap, binary search tree, red-black tree. Of course, there are other data structures, such as AVL balanced trees.

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

The most frequently encountered interviews in the data structure part are:

  1. 1. The difference between ArrayList and LinkedList, advantages and disadvantages
  2. Hashmap implementation, how to expand, how to deal with hash conflicts, hashcode algorithm, etc.
  3. Linked lists need to be known. LinkedHashMap usually asks when asking LRU again
  4. The characteristics and principles of binary search trees. First, middle and post-order traversal write one of them. 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 tell its characteristics.
  5. The realization of the heap, the largest heap, the smallest heap, and the principle of priority queues.

algorithm

Algorithms are actually some of our usual sorts: selection sort, insertion sort, bubble sort, hill sort, merge sort, and quick sort. And some calculation methods related to the data structure to solve some problems.

Some questions encountered in the algorithm interview:

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

The algorithm part is recommended for practice. Go to Leetcode to brush up questions and open up your thinking. Algorithms do not necessarily require that you can write them. It mainly examines your ideas and how you have optimized your algorithms.

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 does the GC-ROOT chain start? The garbage collection algorithm (which is rarely asked).

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

List a class loading interview questions 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.

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, there is no need to perform additional synchronization, or perform any other coordination operations on the caller to call the behavior of this object Can get the correct result, we think this object is thread-safe.

Thread safety is some multi-threaded 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 also need to be understood.

Common questions are about the advantages of handwritten singletons and double-lock singletons. The other is to let you implement a multi-threaded download by yourself, depending on how you design it.

5) Programming ideas

Encapsulation, inheritance, polymorphism, abstraction, reflection, annotation, design patterns, principles of design patterns.

During the interview, you will generally ask:

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

The above things mainly examine your code design ability.

6) Network protocol

  1. The realization of the Internet is mainly divided into several layers, where are http, ftp, tcp, and ip located
  2. The difference between http and https
  3. Why does tcp need to shake hands three times and wave four times
  4. Do you know about socket?

Generally, there are more questions about http and https, but also about symmetric encryption and asymmetric encryption. Tcp and socket occasionally meet and ask.

Java part summary

The Java part can be roughly divided into these 6 blocks. Thinking about a set of code, it is actually classes and combinations of these classes. How to combine is actually a design pattern. The class actually contains basic data types and some data institutions to store these basic data types or classes, and then how to load these classes by the JVM.

I recommend a few books for the above parts:

"Java Programming Thought"
"In-depth understanding of the second edition of the JAVA virtual machine"
"Big Talk Design Pattern"
"HeadFirst Design Pattern"
"Data Structure and Algorithm"
"Graphic HTTP"

Due to a lot of text here, I have summarized the frequently asked questions and frequently asked interview questions involved in the Android interview to share with you for free, and I will receive it at the end of the article!

Three, Android related

The Android part is listed directly, but each item listed is often asked in interviews and will be extended to ask, so in-depth research is needed.

  1. What are the four major components, tell us your role and understanding of them in the Android system.
  2. Activity life cycle, how does the life cycle of the two pages of A start and B run, why this is so, why the life cycle is designed like this, have you ever understood?
  3. Four startup modes, what is the internal stack, and how you use it in your work.
  4. The startup process of Activity, I strongly recommend that every Android developer should know clearly, and follow the source code, the role of several core classes. You will have a better understanding of Android.
  5. The event distribution process, how to deal with sliding conflicts. Example: Long press an Item of ListView and it turns gray. Sliding at this time. The item is restored to its original state, what is the event delivery inside them at this time. There are many ways to ask, so you have to figure it out.
  6. Customize View, View drawing process. What are the functions of onMeasure, onLayout, and onDraw. How the ViewGroup distributes the drawing. You need to know how to draw in onDraw, Canvas, Path, Paint. And cooperate with ValueAnimtor or Scroller to realize animation. Sometimes the interviewer will suddenly ask you that ViewGroup is a tree structure. I want to know the depth of the tree and how do you calculate it. It suddenly becomes a data structure and algorithm question.
  7. Bitmap and Drawable
  8. Animation and Animator
  9. LinearLayout, RelativeLayout, FrameLayout three commonly used layout characteristics, how does it calculate when layout. How efficient. CoordinatorLayout cooperates with AppbarLayout and customizes Behavior. Use of ConstraintLayout. Used to reduce the hierarchy.
  10. Handler message mechanism, it is recommended to look at Looper's source code
  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, and calculate the size of a picture. 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, and how to do it.
  16. Comparison of listView and RecycleView, and caching strategy.
  17. JNI (rarely asked)
  18. MVC,MVP,MVVM
  19. Open source framework Okhttp, Glide, EventBus, Rxjava, etc., as well as the open source libraries under JetPack, if you want to know how to use it, but also say something, I recommend Retrofit, Okhttp, Glide, EventBus and look at the source code.
  20. The four major parts of RecyclerView, what effect can be achieved, and how to achieve it, we must know in mind
  21. DecorView, Window, WindowManager, PhoneWindow relationship, and individual responsibilities.

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

Four, Android related summary

The related 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 look at the source code implementation.

I recommend a few books for Android:

"Android Development Art Exploration" is highly recommended, it is recommended to read carefully, if you are careless, it is recommended to read it two or three times, and read it in a targeted manner.
"Android Advanced Light"
"Advanced Android Development Strengthening Actual Combat"
"Android Componentized Architecture"
"Android Hot Fix Technology Principle"
"Android Plug-in Development Guide"

Five, interview matters needing attention

  • The preparation must be sufficient , the knowledge must be as broad as possible, and the depth must be sufficient.

  • In the interview arrangement, if you are not in a hurry, try to give yourself as much time as possible, one family for two days, and timely summary and supplements .

  • Attitude should be calm . As a technical exchange, the interview depends on part of the luck and some eyeballs. Some interviewers can feel that your interview is over with a mouth. The company you want to go to is not good enough for an interview. Don't get discouraged and continue to prepare.

  • 简历投递方面,尽量选择多个平台投递,拉勾、BOSS或者其他平台,多展示就多机会。

  • 写简历一定要体现自己的优势,最好能体现类似于,用到了什么技术,解决了什么问题。简历上写到的一定要胸有成竹。

  • 类似于你的优势是什么,你觉得你项目中做的比较好的地方有哪些,你能给公司带来什么,这种问题心里要先想一些,免得临场发挥容易紧张说不好。

  • 通常面试,技术面最少是两轮。如果一轮后让你走了,而你还自我感觉良好,回去之后再回顾一下面试内容,并一条一条找找该问题的相关内容,大部分问题就在于你没有答到点子上,可能是深度不够,也可能是扩展不够,继续加油。

  • 现在外面面试问的的确比较多,要求也挺高的,行情不好,薪资也不好要,所以心态一定要放好,找好自己的定位,心态一定要好

  • 面试之后要尽量做到总结,之前从我最开始没什么准备就出去面试,被打击一通之后,总结了七八家面试题,会发现面试问到的都是那些知识点,可能角度不一样,但是你只要深度够,他怎么问,你基于原理来回答,基本上都不会差的。

六、总结

在写这篇文章之前,我专门看了下我之前收藏的别的公号上发的面试题,很全,我都有点不想写这篇文章了。

但是想了下最近面试季应该会有朋友跳槽或者找工作吧,还是想分享一下自己的总结和建议,想告诉大家,面试别慌,做自己该做的,其他自己决定不了的,先放一放,心里列一个123,一条一条来。

可以看到我在上面推荐了很多书籍,是因为当我看到很多面试题,针对题来的时候,题会很多,而且有时候你会觉得你的题都会了,但是面试的时候还是面不好,说明你的知识并不扎实。

Or you just learned this question and didn’t understand it well, so I will describe it in large chunks in the Java part, and for each piece, I recommend a related book. You may not need to read it all, you can read it in a targeted manner. .

The Android part is a detailed knowledge point, I hope these knowledge points can be studied in depth. As for the recommended books, there are some related knowledge points in the books, and you can also choose to watch them. Of course, forums and blogs are sources of knowledge. You only need to make a base for the depth and breadth of knowledge points.

Finally, although many layoffs are saying that Android is going to decline, don't panic, make your own plans, learn your own habits, competition is everywhere, every industry is like this.

I agree to share with you the content of your Android learning PDF + architecture video + interview document + source code notes , as well as advanced architecture technology advanced mind map, Android development interview special materials, and advanced advanced architecture materials .

I believe it will bring you a lot of gains. If you need it, you can click to get it !

Guess you like

Origin blog.csdn.net/ajsliu1233/article/details/108536955