Alibaba Java programmer who has worked for 5 years, sharing his experience summary and interview notes (with the latest interview questions from major companies in 2020)

In the first year of work, it is often a year full of freshness, learning everything, and full of enthusiasm; knowledge in the WEB industry is updated very quickly, a new version of a framework today will be another new framework tomorrow, sometimes according to the project I need to keep learning new things; all, many times I feel that there are so many things I have used! But there are not many things that have been studied in depth. Interview is the first question that needs to be faced after job-hopping; and different companies have different interview focuses; but there is one thing in common: Java foundation is a must.

In the first year of work, you may be asked about your understanding of String object creation, what is the commonly used framework, etc.;
in the third year of work, you may be asked what is the Java memory allocation mechanism, how classes are loaded, etc.;
in the fifth year of work, Just ask what are your commonly used design patterns, what role do you play in your work, how to complete a module independently, etc.; it
can be seen that this is the growth process of a typical programmer:

Some interview questions collected in the latest 2020 (all organized into documents), there are many dry goods, covering the real Java interview questions of Alibaba, Tencent, ByteDance, JD, Huawei and other major manufacturers, whether you want to interview a major manufacturer or ordinary For Internet companies, these interview questions are definitely helpful to you. After all, big companies must be the benchmark for the development of the industry. The interviewers of many companies will also study the interview questions of big companies. There are also detailed learning plans,

To get the interview information, just: click here to get it!!! Password: CSDN.

Java basics

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

2. Can the String class be inherited and why.

3. If the hashCode() of two objects is the same, equals() must also be true, right?

4. Is String a basic data type?

5. What are the classes for manipulating strings in Java? What is the difference between them?

6. How many types of IO streams are in Java?

7. What is the difference between BIO, NIO and AIO?

8. Which Map classes have been used, are there any differences, is HashMap thread safe, what is the Map used concurrently, and what are their internal principles, such as storage method, hashcode, capacity expansion, default capacity, etc.

9. How to reverse the string?

10. Does an abstract class have to have abstract methods?

11. What are the differences between ordinary classes and abstract classes?

12. Can abstract classes use final modification?

13. What is the difference between ArrayList and LinkedList?

14. The data structure of ConcurrentHashMap (required)

15. Volatile role (required)

16. How to ensure atomicity of the Atomic class (CAS operation) (required)

17. Why use thread pool (required)

image

Redis

  • Application scenarios of Redis
  • Data types supported by Redis (required)
  • The data structure of zset jump table (required)
  • Redis data expiration strategy (required)
  • The specific implementation of Redis's LRU expiration strategy
  • How to solve Redis cache avalanche and cache penetration problems
  • Redis's persistence mechanism (required)
  • Why is Redis single-threaded?
  • What is cache penetration? How to deal with it?
  • How many ways are Redis persistence?
  • Why is Redis so fast? (Required)
  • How does Redis implement distributed locks?
  • How does Redis optimize memory?
  • What are the Redis elimination strategies?
  • What are the common performance problems of Redis? How to solve it?
  • What should I pay attention to when using Redis?

image

ZooKeeper

  • CAP theorem
  • ZAB agreement
  • Leader election algorithm and process
  • What is zookeeper?
  • How many deployment modes does zookeeper have?
  • How does zookeeper ensure the synchronization of the master and slave nodes?

image

Mysql

  • The basic elements of business
  • Transaction isolation level (required)
  • How to solve the problem of transaction concurrency (dirty reading, phantom reading) (required)
  • MVCC multi-version concurrency control (required)
  • What are binlog, redolog and undolog, and what are their functions
  • InnoDB row lock/table lock
  • The difference between myisam and innodb, when to choose myisam
  • Why choose B+ tree as index structure (required)
  • What things can be stored in the leaf nodes of the index B+ tree (required)
  • When the query will not go (expected) index (required)
  • How to optimize sql
  • explain how to parse sql
  • Principle of order by

image

JVM

  • Runtime data area (memory model) (required)
  • Garbage collection mechanism (required)
  • Garbage collection algorithm (required)
  • Minor GC and Full GC trigger conditions
  • GC中Stop the world(STW)
  • The characteristics and differences of each garbage collector
  • Parental Delegation Model
  • The relationship between JDBC and the parent delegation model
  • What is a complete GC process in the JVM, how the object is promoted to the old age, and talk about the main JVM parameters you know

image

Spring

  • Implementation of Spring's IOC/AOP (required)
  • Realization of dynamic agent (required)
  • How does Spring solve circular dependencies (three-level cache) (required)
  • Spring's post processor
  • How to implement Spring @Transactional (required)
  • Spring's transaction propagation level
  • The connection and difference between BeanFactory and ApplicationContext

image

other

  • How to Realize Current Limitation of High Concurrency System
  • The design of high concurrency spike system
  • How to design load balancing

Operating system

  • The difference between process and thread
  • Several ways of process synchronization
  • Synchronization between threads
  • What is a buffer overflow. What is the harm, and what is the reason
  • What kinds of states are there in the process
  • What is the difference between paging and segmentation

image

Multi-threaded articles

  • Several implementations of multithreading, what is thread safety
  • The principle and function of volatile, can it replace locks?
  • The difference between sleep and wait
  • The meaning of sleep(0)
  • The difference between Lock and Synchronized
  • What is the principle of synchronized and where is it generally used (for example, the difference between loading a static method and a non-static method)

image

Reasonable career planning

What is a career plan-is your short-term or long-term career plan! If you don't talk about major principles, let's keep it simple. Let me ask you a few questions first:

a. You have been working for several years, would you like to be a simple programmer just like a newbie?
b. Are you willing to write code all the time without caring about other things?
c. The pre-requirements, design, post-deployment and maintenance of a project, the leader finds you, you say we can’t figure it out, okay?
Programmers are not machines for typing codes. There are too many things you don’t understand in the first year. You can follow the boss’s arrangements, type on the code, look at the database, and test your own and other people’s code; but in the second year, are you still like this? Impossible, you can enter the industry after one year of experience. It's time to learn how to conduct requirements analysis, how to design a database, how to write various documents, and how to write better code? This is a requirement of advanced programmers!

What is a senior programmer?

A programmer who has the ability to analyze and design, can carry out technical research, and has a deep background in a certain industry!

All, after the establishment of a project, you must actively participate in the preliminary design, think and analyze the problems with the old comrades, and learn from the experience! OK, you will grow up!

Don't think that programmers just write code! ! !

Moreover, through the development of a project, you need to be able to roughly calculate the development time of a function; for example, a module has 20 small function points, you have developed 80 hours, and each small function point averages 2 hours-at this time The workload can be assessed in the early stage. Of course, each person’s efficiency and work quality are different and vary from person to person, but the approximate workload should be statistic and used to count the work cycle of a project;

Today I will share with you the Java interview outline compiled during this job-hopping. Most of them are interview questions during the interview process. You can check this to fill in the vacancies. Of course, the list here is definitely not able to cover all the methods.

Okay, now enter the body of the interview question.

Java basics

1. The difference between List and Set
2. How does HashSet guarantee non-repetition
3. Is HashMap thread-safe, why not thread-safe (it is better to draw a picture to illustrate that it is not safe in a multi-threaded environment)?
4. HashMap expansion process
5 、The difference between HashMap 1.7 and 1.8, explain what optimizations have been made in 1.8 and how to optimize them?
6, final finally finalize
7, strong reference, soft reference, weak reference, phantom reference
8, Java reflection
9, Arrays.sort realization principle and Collection realization principle
10, LinkedHashMap application
11, cloneable interface realization principle
12, exception classification and handling Mechanism
13, the difference between wait and sleep
14, how to allocate the array in memory

Java concurrency

1. The realization principle of synchronized and lock optimization?
2. The realization principle of volatile?
3. Java's semaphore?
4. What is the difference between synchronized in static method and ordinary method?
5. How to realize that all threads wait for an event to occur before executing?
6. CAS? What are the shortcomings of CAS and how to solve it?
7. What is the difference between synchronized and lock?
8. How is Hashtable locked?
9. What is the concurrency problem of HashMap?
10. What is ConcurrenHashMap? Why use red-black trees in 1.8?
11. AQS
12. How to detect deadlock? How to prevent deadlock?
13. Java memory model?
14. How to ensure the correct result of i++ under multithreading?
15. Types, differences and usage scenarios of thread pools?
16. Analyze the realization principle of thread pool and thread scheduling process?
17. How to tune the thread pool and how to confirm the maximum number?
18. ThreadLocal principle, what should I pay attention to when using it?
19. The usage of CountDownLatch and CyclicBarrier, and the difference between them?
20. LockSupport tool
21. Condition interface and its implementation principle
22. Understanding of Fork/Join framework
23. The principle of segmented lock and the thinking of reducing lock strength
24 , Eight kinds of blocking queues and the characteristics of each blocking queue

Spring

1. BeanFactory and FactoryBean?
2. What is the understanding of Spring IOC and its initialization process?
3. BeanFactory and ApplicationContext?
4. How is the life cycle of Spring Bean managed?
5. What is the loading process of Spring Bean?
6. If you want to implement Spring AOP, how do you implement it?
7. If you were to implement Spring IOC, what issues would you pay attention to?
8. How does Spring manage transactions and transaction management mechanisms?
9. What are the different transaction propagation behaviors of Spring and what are they used for?
10. What design patterns are used in Spring?
11. How does Spring MVC work?
12. The principle of Spring cyclic injection?
13. Understanding of Spring AOP, each terminology, how do they work with each other?
14. How does Spring ensure the security of Controller concurrency?

Netty

1. BIO, NIO and AIO
2. Netty's major components
3. Netty's threading model
4. TCP sticky/unpacking reasons and solutions
5. Which serialization protocols do you know? Including usage scenarios and how to choose
6, Netty's zero copy implementation
7, Netty's high-performance performance in what aspects

Distributed correlation

1. Dubbo's underlying implementation principle and mechanism
2. Describe the detailed process of a service from being published to being consumed
3. How the distributed system does service governance
4. The concept of interface idempotence
5. How message middleware solves the problem of message loss
6. How to deal with Dubbo's service request failure
7. Will the reconnection mechanism cause errors
8. Understanding of distributed transactions
9. How to achieve load balancing and what algorithms can be implemented?
10. What is the purpose of Zookeeper and the principle of election?
11. Vertical splitting of data and horizontal splitting.
12. Zookeeper principle and applicable scenarios
13. Zookeeper watch mechanism
14. How to deal with redis/zk node downtime.
15. How to achieve a unique serial number in a distributed cluster.
16. How to make a distributed lock.
17. Which MQs have been used and how? What are the advantages and disadvantages compared with other mq? Is the connection of MQ thread safe?
18. How to ensure that the data of the MQ system is not lost?
19. List the database sub-database sub-table strategies you can think of; after sub-database sub-table , How to solve the problem of full table query
20, zookeeper election strategy
21, global ID

database

1. What are the optimizations for mysql paging?
2. Pessimistic locking, optimistic locking
3. Combined index, the leftmost principle
4. MySQL table lock, row lock
5. MySQL performance optimization
6. MySQL index classification: B+, hash; in what situation What index
7, transaction characteristics and isolation level

Cache

1. What data data has been used by Redis, and how the bottom layer of Redis is realized
2. Redis cache penetration, cache avalanche
3. How to use Redis to implement distributed locks
4. How to solve the problem of concurrent competition
in Redis 5. Several types of Redis persistence Ways, what are the advantages and disadvantages, how to achieve
6. Redis cache invalidation strategy
7. Redis cluster, high availability, principle
8. Redis cache fragmentation
9, Redis data elimination strategy

JVM

1. Detailed jvm memory model
2. Tell me about the circumstances under which memory overflow or memory leak occurs?
3. Talk about the Java thread stack
4. What are the criteria for judging the promotion process from the young generation to the old generation of the JVM?
5. JVM appears fullGC very frequently, how can I troubleshoot the problem online?
6. Why use the parental delegation mode for class loading? Are there any scenarios that break this mode?
7. Class instantiation order
8. JVM garbage collection mechanism, when to trigger MinorGC and other operations
9. What is a complete GC process (from ygc to fgc) in JVM
10. Various collectors, their advantages and disadvantages, key points CMS, G1
11, various recovery algorithms
12, OOM error, stackoverflow error, permgen space error

Some interview questions collected in the latest 2020 (all organized into documents), there are a lot of dry goods, including detailed explanations of mysql, netty, spring, thread, spring cloud, etc., there are also detailed learning plans, interview questions, etc.

image
The latest interview information of major companies:Insert picture description here

If you need this full version of the interview notes, you only need to support me in this article.

A lot of support, you can get information for free-after three consecutive years (promise: 100% free)

Quick start channel: (click here) to download! Full of sincerity! ! !

It is not easy to organize, friends who feel helpful can help, like, share and support the editor~

Your support, my motivation; I wish you all a bright future and constant offers! ! !

Guess you like

Origin blog.csdn.net/m0_46657043/article/details/109457821