Summary of 2020 Autumn Recruitment Interviews of Big Companies such as Ali, Tencent, Baidu, and Answers

Foreword
I believe that most Java development programmers have more or less experienced interviews with Alibaba. I also know that Alibaba's Java interviews are difficult. The author has gone through many interviews with Alibaba. Some are satisfied and some have suffered. Therefore, the author wants to summarize his many interview experiences. It is at the time of the golden nine and silver ten. I hope it will be helpful to everyone.

In addition, I have collected more than 20 years of company interview knowledge points, and various Java core knowledge points are free to share with you. I think it is very useful for interviews. Friends in need can click here! Get the secret code CSDN by yourself

Insert picture description here

Ali interview questions

Due to time constraints, I won’t write the answers (mainly lazy), and they will be summarized as notes.
Insert picture description here

Interviewing in Ali is still very comfortable. If the interviewer finds it difficult, it will be enough. It will not make you feel embarrassed because of the difficulty, and the knowledge of one side is not difficult.

one side

1. HashMap data structure-lead to the difference between Java7 and Java8

2. Under what circumstances will a linked list be converted to a red-black tree?

3. In addition to the data structure, what are the differences between Java 8 and Java 7 in HashMap

4. The expansion process, under what circumstances will the expansion

5. Why is the initial value of capacity in the expansion mechanism 16? Can it be customized to 15? Why must it be a power of 2?

6. Briefly introduce the hash algorithm, its core performance, or what is the index to judge the quality of a hash algorithm, the implementation of the indexFor() function

7. What problem does HashMap solve? -Lead to hash collision

8. Introduce the data structure of ConcurrentHashMap

9. How many concurrent threads can ConcurrentHashMap support?

10. ConcurrentHashMap belongs to a class under JOC, understanding of the JOC package

11. Have you ever used synchronized, have you encountered concurrency problems before, and how to deal with them

12. In terms of the Java technology stack, are there any points that are better or in-depth understanding? Have you seen something from the source code?

  1. The principle of Netty is introduced.

  2. Know NIO, BIO, AIO? Introduce the similarities and differences, how to use in the code?

  3. Have you used distributed locks? What function is used? What use scenario?

  4. Can you introduce the garbage collection mechanism?

  5. The data structure of redis is introduced. Which ones have been used in the project? What scene

18 What is idempotence? How to protect?

  1. How to guarantee data consistency in the trading system?

database

1. How much do you know about MySQL-lead to the knowledge points that must be asked (emphasis added!!! Transactions and indexes)

2. What is the isolation level used by MySQL, and what problems will occur under this isolation level-lead to database concurrency problems

3. How does MySQL solve the problem of phantom reading when using this isolation level (extension, understand the principle of solving other concurrency problems)

4. MySQL tuning mechanism, which aspects are mainly tuned-lead to index

5. Under MySQL's InnoDB storage engine, the two concepts of clustered index (or clustered index) and non-clustered index

6. What data structure is used to store the index in MySQL-here should lead to the B+ tree

7. Why is the query speed faster through the index-here should lead to the binary tree algorithm

Two sides

Self introduction

What is the usage scenario of mongoDB in the project? How is it deployed? How to ensure high availability?

Can you introduce the memory structure of JVM?

What are the advantages and disadvantages of CMS and G1? When does FULL GC happen? When to stop the world!

What kind of object can be the root node?

One class, two functions, one read and the other write, write function plus synchronized, read function still need to add? What does the voliate keyword do?

When designing the database, how to set the primary key? Is it better to be self-incremented or not? Why?

Introduction to mysql lock types

How to check if the online CPU is 100%?

Write an algorithm, give a number, a monotonic array, the method returns the first subscript in the array greater than the given number, if not, return -1.

Three sides

To be honest, the third round is a more in-depth question. They talk about their own program thoughts in combination with the business. If there is no certain technology and development experience, this is an incomplete answer, and I have fallen at this level.

How to achieve an efficient reverse output of a singly linked list?

It is known that sqrt(2) is approximately equal to 1.414, and it is not required to use a math library. Please find sqrt(2) accurate to 10 digits after the decimal point

Given a binary search tree (BST), find the Kth smallest node in the tree

LRU caching mechanism

Regarding the difference between epoll and select, which of the following statements are correct

From the analysis of the index structure of InnoDB, why the key length of the index cannot be too long

Given a linked list, delete the Nth node from the bottom of the linked list, and return the head node of the linked list

If you are asked to design a universal system that supports second-level backup and recovery of various databases, how would you design

If you were asked to design a data flow and processing system that supports the real-time flow of data between databases, NOSQL and big data, what issues would you consider? How to design?

Given an integer array and an integer, return the indexes of the two arrays. The sum of the numbers pointed to by these two indexes is equal to the specified integer. Need the best algorithm, analyze the space and time complexity of the algorithm

If you are given a new product, from what aspects will you guarantee its quality?

Please evaluate the execution result of the program?

Tencent interview questions

Insert picture description here

Java basics

1. What are the several basic data types in JAVA and how many bytes each occupy.

2. Can the String class be inherited and why.

3. The difference between String, Stringbuffer and StringBuilder.

4. What is the difference between ArrayList and LinkedList.

5. Talk about the instantiation order of the class, such as the parent class static data, constructor, field, subclass static data, constructor, field, when new, their execution order.

6. What are the differences between which Map classes have been used, is HashMap thread-safe, what Map is used concurrently, and what are their internal principles, such as storage method, hashcode, expansion, default capacity, etc.

7. Why did ConcurrentHashMap of JAVA8 give up the segment lock? Is there any problem? If you design it, how do you design it.

8. Is there an orderly Map implementation class, if so, how do they ensure ordering?

9. The difference between abstract class and interface, can a class inherit multiple classes, can an interface inherit multiple interfaces, and can a class implement multiple interfaces?

10. What is the difference between inheritance and aggregation.

11. What are the IO models, talk about nio you understand, what is the difference between him and bio, aio, talk about the reactor model.

12. The principle of reflection, what are the three ways that reflection creates a class instance.

13. In reflection, the difference between Class.forName and ClassLoader.

14. Describe several implementations of dynamic agents, and state their respective advantages and disadvantages.

15. The difference between dynamic proxy and cglib implementation.

16. Why the CGlib method can implement proxy for the interface.

17. The purpose of final.

18. Write three singleton mode implementations.

19. How does HashSet in Java work internally.

20. What is serialization, how to serialize, why serialization, what problems will be encountered in deserialization, and how to solve them.

JVM

21. Under what circumstances will stack memory overflow occur.

22. JVM memory structure, Eden and Survivor ratio.

23. Why should JVM memory be divided into new generation, old generation and persistent generation. Why is the new generation divided into Eden and Survivor.

24. What is a complete GC process in JVM, how to promote the object to the old age, and talk about the main JVM parameters you know.

25. Do you know which kinds of garbage collectors, their advantages and disadvantages, focus on cms and G1, including principles, processes, advantages and disadvantages.

26. The realization principle of garbage collection algorithm.

27. When there is a memory overflow, how do you troubleshoot?

28. Simply talk about the class loader you know, can it break parental delegation, and how to break it.

29. The difference between g1 and cms, throughput priority and response priority garbage collector selection.

30. How to print thread stack information.

Open source framework

31. Briefly talk about the structure of tomcat, its class loader process, thread model, etc.

32. How to tune tomcat and what parameters are involved.

33. Talk about the Spring loading process.

34. The realization principle of Spring AOP.

35. Talk about the propagation properties of Spring transactions.

36. How does Spring manage transactions.

37. Tell me about your understanding of Spring, the principle of non-singleton injection? Its life cycle? The principle of cyclic injection, the realization principle of aop, talk about several terms in aop, how do they work with each other.

38. The initialization process of DispatcherServlet in Springmvc.

39.netty's threading model, how netty is based on the reactor model.

What is the communication protocol of 40.netty?

41. The annotations used by springmvc, what are their functions, and their principles.

42. springboot startup mechanism

Baidu interview questions
Insert picture description here

1. Self introduction and project introduction

2. Do you understand spring-cloud? Spring-boot understands, talk about bean life cycle

3. Improvements after hashmap-1.8, why hashmap is not thread safe

4. How to achieve thread safety and how to implement concurrenthashmap

5. What design patterns are used

6. Have you used ThreadLocal?

7. Class loading mechanism

8. JVM-Memory Model

9, garbage collection

10. Have you read the redis source code?

  1. Introduce your project and its difficulties?

12. What is the role of reflection?

  1. Data warehouse, multithreading and concurrency tools, etc.?

  2. Private cloud, docker and k8s, etc.?

  3. Know which middleware, dubbo, rocketmq, mycat, etc.?

  4. How to realize the rpc in dubbo?

  5. What should I do to implement rpc by myself?

  6. Dubbo's service registration and discovery?

19. Give you an ordered array of integers. The numbers in the array can be positive, negative, or zero. Please implement a function that returns an integer: How many different values ​​are there in the square of all the numbers in the array.

Summary
The characteristics of talents that Internet giants prefer: enthusiasm for technology, strong technical foundation strength; initiative, good at teamwork, and good at summarizing and thinking. No matter which company it is, it attaches great importance to high-concurrency and high-availability technology and the foundation, so don't underestimate any knowledge. The interview is a two-way selection process. Don't go to the interview with a fearful attitude, which is not conducive to your own performance. At the same time, you should not only pay attention to salary, but also whether you really like this company and whether you can really get exercise. In fact, I have written so much, just my own summary, not necessarily applicable to everyone, I believe that after some interviews, everyone will have these feelings.

Finally,
I also collected more than 20 years of company interview knowledge points and various technical points. There are some screenshots below. Friends in need can click here! Get the secret code CSDN by yourself

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_47345084/article/details/111560764