4 years of Java development, I got offers from Ali and Pinduoduo to share interview experience and summary

4 years of Java development, I got offers from Ali and Pinduoduo to share interview experience and summary

Preface

Due to personal development and changes in work, I came up with the idea to come up with opportunities. After a period of preparation, I began to come out for interviews in late May, and in early July, I got the offer of my favorite company as I wish. According to my own habits, record some of the experience summaries and experiences during the interview process, keep a record for myself, and hope that it can help some students.

Personal situation

Coordinate Magic City, graduated with a 15-year undergraduate degree from a regular one, worked for a traditional telecommunications company after graduation, and worked for Meituan Dianping 17 years later.

Interview situation

Compared to 2017, due to the background of Meituan, this year's resume level has gone a lot smoothly. I have to sigh that the background of Dachang is really fragrant.

In line with the reason of asking for leave as little as possible, there are fewer companies interviewing, only three companies: Ali, NetEase Koala, and Pinduoduo.

All three companies have gone through the interview process, and finally got offers from Ali and Pinduoduo. I am quite satisfied.

As for the reason why NetEase hangs up, the specific reason is not very clear. The interview is not bad. When the BOSS met me, it can be seen that I was quite satisfied with me, but in the end no offer was made.

What skills should be possessed by 4 years of experience

First of all, let’s briefly talk about the skills that I think a good Java programmer should possess for about 4 years of experience. According to the two parts of "professional skills" and "project", including but not limited to the following.

Professional skills

Foundation: Principles, source code, and usage scenarios of commonly used JDK classes.

Design patterns: several common principles, usage scenarios, singletons, dynamic agents, templates, chains of responsibility, etc.

Data structure: array, linked list, stack, queue, tree.

Network: TCP, HTTP, HTTPS, load balancing algorithm.

Framework: Spring IoC principle, Spring AOP principle and use, Spring commonly used extension points, MyBatis core process.

Middleware: The core principles and best practices of commonly used middleware, with in-depth learning of 1 or 2 of them, Redis, Kafka (RocketMQ, RabbitMQ), Dubbo, Zookeeper.

Database (MySQL): Index principle, isolation level, locking mechanism, sub-database and sub-table, slow SQL positioning and optimization, online problem solving.

Netty: NIO principle, core components, I/O multiplexing (epoll), zero copy.

JVM: runtime data area, garbage collection algorithm, garbage collector (CMS, G1), common configuration parameters, online problem location and resolution.

Stability guarantee: isolation, current limiting, fusing, degradation, etc.

Linux: Use basic commands, quickly locate and troubleshoot problems.

Distributed theory: CAP, BASE, 2PC, 3PC, TCC.

Project aspect

  • Able to independently complete the requirement analysis, scheme design and final implementation of a complex module.

  • Can keep thinking, looking for better designs and solutions, and actively optimize slow SQL and slow services.

  • Have the ability to troubleshoot problems, locate and repair online problems in time, such as: database deadlock, server downtime, frequent server Full GC, etc.

  • Have the ability to solve difficult problems, can continuously solve the challenges encountered by the project, and give technical guidance to junior engineers. * Initially have the ability to lead a team (about 1-3 people), can reasonably allocate requirements, and do a good job of progress control, risk assessment, and code review.

Strictly speaking, it is a bit difficult to do the above completely, and I don't have it myself, but we can regard it as a goal and continue to work hard.

Common forms of interviews

Dachang interviews are usually in the form of a "serial gun", for example:

Interviewer: Which Maps have been used

我:LinkedHashMap、ConcurrentHashMap、HashMap、TreeMap

Interviewer: The difference between these four types of maps

Me: ConcurrentHashMap is thread-safe, LinkedHashMap can record insertion order and access order, TreeMap can customize sorting, except for these scenarios, other scenarios can basically use HashMap

Interviewer: How does ConcurrentHashMap ensure thread safety

Me: Segmented lock was passed before JDK 1.8, and CAS + Synchronized after JDK 1.8

Interviewer: What is the difference between the locks of ConcurrentHashMap before and after JDK 1.8

Me: Before JDK 1.8 locks segmentation, after JDK 1.8 locks a single node, the lock granularity is reduced, and the concurrency becomes higher.

Interviewer: #%¥%……#%¥

Me: Meow meow~

The questioning method of this model is actually to understand whether the candidate's understanding of a knowledge point is only on the surface, or whether it has really been studied in depth.

Interview content

Here are some common interview content. The interview questions are not necessarily what I actually encountered. They may be collected from other people's interview questions, or they may be knowledge points that I think are important, for reference only.

1. Project

The project is very important for a development with 3-5 years of experience, and the interviewer also values ​​this one very much. The development of this experience is basically the main coding force of major companies, so when interviewing candidates of this age, the project is usually a very important piece. The interviewer usually asks you to introduce yourself the most involved (or most powerful) project, and then ask questions from it. The common ones are as follows:

Introduce your most involved projects

Draw the architecture diagram of the project

If the core process is halfway through and the server crashes, what will happen?

What challenges or problems have been encountered in the project and how to solve them

How to ensure the stability and availability of the project

How to design data security

The technical selection of the project, why choose these

2. Scenario questions

The more interviewers at the back, the more they like to ask scene questions, which test the candidates' usual accumulation and problem-solving ability. This link is easy to kill a group of people, especially the students who are easily nervous, and it is easy to lose their minds. The core of the scenario question is generally to deal with the problem of large data volume and solve the problem of performance.

Scenario questions are relatively open in nature, and there is no standard answer. As long as your own solution can solve the problem, you can "justify yourself".

In this session, the interviewer may ask questions about real online scenes, which I have encountered myself.

3. Professional skills

set

Which maps are often used

The difference between these types of maps

How does CocurrentHashMap ensure thread safety

What is the difference between the locks of CocurrentHashMap before and after JDK 1.8

Talk about the principle of HashMap

When HashMap is Put, whether the new linked list node is placed at the head or tail

The process of HashMap expansion

What is the change of HashMap in JDK 1.8

What has changed in CocurrentHashMap in JDK 1.8

Principle of TreeMap

Map, List, Set, respectively, talk about thread-safe classes and thread-unsafe classes you know

Multithreading, lock

Which thread pool is used

How to configure thread pool parameters

The role of each parameter of the thread pool

What to pay attention to in the parameter configuration of the thread pool

Thread pool workflow

What do the concurrency classes in the JDK know

The underlying principle of AQS

Introduce pessimistic lock and optimistic lock

Which locks have been used

The difference and usage scenarios of synchronized and Lock

synchronized principle

Synchronized acts on the difference between static methods, ordinary methods, this, Lock.class

Why introduce biased locks, lightweight locks, and introduce the upgrade process

The necessary conditions for deadlock, how to prevent deadlock

Introduce CountDownLatch and CyclicBarrier

Introduce CAS, what's the problem

Introduce ThreadLocal, what are the problems

The internet

How is HTTPS encrypted

The principle of ordinary hash and consistent hash

Disadvantages of consistent hash

TCP three-way handshake process, why do we need three-way handshake

Why does the TIME_WAIT state need to go through 2MSL to return to the CLOSE state

TCP congestion control

How does TCP solve the problem of flow control, disorder, and packet loss

Why does the sticking and unpacking appear, and how to solve it

Spring、Mybatis

The difference between # and $ in Mybatis

How to prevent SQL injection

When using Mybatis, how to call SQL when calling DAO (Mapper) interface

Introduce the process of Spring IoC

The difference between BeanFactory and FactoryBean

How is Spring's AOP implemented

What are Spring's transaction propagation behaviors? Let's talk about nested transactions

Under what circumstances the object cannot be proxied

How does Spring solve the problem of circular dependencies

How to implement some logic after the Spring IoC container is built

The difference between @Resource and @Autowire

@Autowire how to use name to inject

Is there a problem if other bean instances are used in the method specified by the bean’s init-method attribute?

Is there a problem if other bean instances are used in the method modified by @PostConstruct?

In Spring, if there are two beans with the same id, will an error be reported? If an error will be reported, at which stage the error will be reported

In Spring, the bean's class attribute specifies a class that does not exist. Will an error be reported? If an error occurs, at which stage

What are the common extension points in Spring

MySQL

Data structure of MySQL index

Why use B+ tree and what are the advantages compared to other indexes

The difference between various indexes

How to deal with B+ tree during range search

What is stored in MySQL index leaf nodes

The underlying implementation of the joint index (composite index)

How MySQL locks a row of data

Can a mutex lock be added to a SELECT statement?

Multiple transactions SELECT FOR UPDATE on a row of data at the same time will block or be abnormal

MySQL version and execution engine

The difference between different MySQL execution engines

MySQL transaction isolation level

How MySQL's Repeatable Reading Is Realized

Will there be phantom reads in MySQL

MySQL gap lock

MySQL's master-slave synchronization principle

Implementation scheme of sub-database and sub-table

Distributed unique ID scheme

How to optimize slow queries

The meaning of each field in explain

What are the common values ​​of the type field in explain

Which fields do you usually pay attention to in explain and why

JVM

Runtime data area

What garbage collector is used by the server

The principle of CMS garbage collection

The characteristics of G1 garbage collection, why low latency

What are the garbage collection algorithms, advantages and disadvantages

Which objects can be used as GC Roots

What class loaders are there

Parental delegation model, which scenarios are to break the parental delegation model

How to troubleshoot the frequent occurrence of Full GC on the online server

What commands are commonly used to locate problems

Introduce the process of JVM tuning

Kafka

Why use Kafka

Introduce the various components of Kafka

How to ensure that the data written to Kafka is not lost

How to ensure that the data consumed from Kafka is not lost

Why is Kafka so high?

Which method is used to achieve zero-copy technology

There is a similar zero-copy technology in Java, which method is it?

How does Kafka guarantee the sequential consumption of messages

How to avoid repeated consumption in Kafka

What is HighWatermark and LEO

What is ISR and why do I need to introduce ISR

Redis

Redis version used in the project

Redis usage scenarios in the project

How does Redis ensure high availability

Redis election process

The difference between Redis and Memcache

Redis cluster mode

Redis cluster needs to increase shards, how to ensure lossless slot migration

Implementation of Redis distributed lock

Redis's strategy for deleting expired keys

Redis's memory elimination strategy

Redis's Hash object underlying structure

The expansion process of Hash objects in Redis

Will there be any problems with the expansion process of Redis's Hash object when the amount of data is large?

What are the persistence mechanisms of Redis

The realization principle, advantages and disadvantages of RDB and AOF

AOF rewriting process

Principles of Sentinel Mode

When using the cache, whether to operate the database first or operate the cache first

Why invalidate the cache instead of updating the cache

Cache penetration, cache breakdown, cache avalanche

Several design patterns for updating the cache

Zookeeper

Usage scenarios of Zookeeper

How does Zookeeper implement distributed locks

How does Zookeeper ensure data consistency

Principle of ZAB Agreement

Which of the CAPs does Zookeeper follow

The difference between Zookeeper and Eureka

Leader election for Zookeeper

The role of Observer

The leader sent a commit message, but none of the followers received this message, and the leader hung up. What will happen next?

distributed

CAP theory

BASE theory

Principles of Distributed Transaction 2PC and TCC

What to do if TCC fails in the cancel phase

Paxos algorithm, Raft algorithm

4. Hr surface

If you pass five levels and cut six generals all the way, and finally come to the Hr side, then congratulations, you are very, very close to the offer. You can start to imagine yourself getting promoted and raising your salary, becoming a general manager, becoming a CEO, marrying Bai Fumei, and embarking on the scene of the pinnacle of life.

The HR interview is mainly to understand some general qualities of the candidate, and the frequently asked questions are as follows:

Introduce the project that I invested the most in (I was shocked at the time, Hr also started to ask about the project)

Reason for leaving

Current salary, performance

The situation of other companies currently interviewing

Do you usually have the habit of studying, how did you study, what are you studying now

Future plan

There are no standard answers to these questions, but the very important principle is to maintain a positive attitude and not have negative emotions throughout the process.

Regarding the current salary issue, due to many reasons, some people may want to report a little bit more. I am neutral on this approach, but we must grasp the degree. After all, big factories basically have background checks. Big companies generally have zero tolerance for integrity issues, and may blacklist them. Being on the blacklist means you will never get involved with this company anymore.

Some experience

I think I’m relatively lucky, and in the end I wish you all the offers you like.

Share some java interview materials collected over the years for everyone to learn, BAT must-have interview questions with answers (hope to be helpful to you), friends who want to get it can follow me to help and like the article, click here to get it for free

4 years of Java development, I got offers from Ali and Pinduoduo to share interview experience and summary

4 years of Java development, I got offers from Ali and Pinduoduo to share interview experience and summary

Guess you like

Origin blog.csdn.net/weixin_47066028/article/details/112603388