This article was written on August 19

preface

Due to personal development and changes in work, I came up with the idea of looking at opportunities. After a period of preparation, I began to interview in late May and got the offer from my favorite company in early July. According to their own habits, the interview process of some experience summary, experience recorded, their own record, but also hope to help some students.

In addition, I also recorded my experience when I changed my job for the first time two years ago. Here is a portal: summary of the interview of two years’ working experience in Java development

Personal circumstances

Coordinates Magic city, graduated from the general first in 15 years, after graduation, worked for a traditional telecom company, 17 years later, meituan Dianping.

The interview situation

Compared with 17 years, because of the background of the United States, this year in the resume this close a lot of smooth, have to sigh dachang background really sweet 🙈.

In line with the reason of asking for leave as little as possible, I interviewed fewer companies, only 3: Ali, netease and Pinduoduo.

The three companies have gone through the interview process, and finally got the offer from Ali and Pinduoduo. I am quite satisfied with it.

As for the reason of netease’s failure, the specific reason is not clear. I performed well in the interview. I was satisfied with me in the BOSS’s interview, but I did not receive the offer at last.

If you have any questions about the interview process of these three companies, please leave a message on the public account, and I will answer them as soon as possible.

4 years of experience should have what skills

First of all, I will briefly talk about what I think a good Java programmer with about 4 years of experience should have by “professional skills” and “projects”, including but not limited to the following.

Professional energy saving

  • Basic: JDK common class principle, source code, use scenarios.

  • Design mode: common principles, usage scenarios, singleton, dynamic proxy, template, responsibility chain, etc.

  • Data structures: arrays, linked lists, stacks, queues, trees.

  • 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: Core principles and best practices of common middleware, and in-depth study of one or two of them: Redis, Kafka (RocketMQ, RabbitMQ), Dubbo, and Zookeeper.

  • Database (MySQL) : index principle, isolation level, locking mechanism, database and table division, slow SQL positioning and optimization, online problem solving.

  • Netty: NIO principles, 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 to quickly locate and rectify faults.

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

projects

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

  • Able to constantly think, find better design and solution, actively optimize slow SQL, slow service.

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

  • Ability to solve difficult problems, solve project challenges and provide technical guidance to junior engineers.

  • Preliminary ability to lead a team (1-3 people), able to reasonably allocate demands, control progress, risk assessment and Code Review.

Strictly speaking, it’s a little hard to do all of this, and I don’t have it myself, but it can be a goal to work towards.

Common Forms of Interview

Interviews at big companies are usually conducted in a rapid-fire manner.

Interviewer: Which maps have you used

Me: LinkedHashMap, ConcurrentHashMap, HashMap, TreeMap

Interviewer: The differences between the four maps

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

Interviewer: How does ConcurrentHashMap ensure thread safety

I: JDK 1.8 used staging locking, JDK 1.8 used CAS + Synchronized

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

I: before JDK 1.8 lock segments, JDK 1.8 lock a single node, the lock granularity is reduced, concurrency becomes higher

Interviewer: #%¥%…… # % $

Me: Meow meow meow

This type of question is used to find out if the candidate’s understanding of a knowledge point is superficial or if he has really studied it.

The interview content,

Here are some common interview questions. The interview questions are not necessarily what I have actually met, but may be collected from other people’s interview questions, or some important knowledge points that I think are important for my reference.

1, project

The project is very important for a development with 3-5 years of experience, and the interviewer will value it very much. The development of this experience is basically the main coding force of every major company, so the project is usually an important part of interviewing candidates in this age group. Interviewers will often ask you to tell them about your most engaged (or awesome) projects first, and then ask questions about them. Common ones are as follows:

  • Tell me about the projects you were most involved in

  • Draw an architectural diagram of the project

  • What happens if the server crashes halfway through the core process

  • What challenges or problems did you encounter in the project and how did you solve them

  • How to guarantee the stability and availability of the project

  • What about data security

  • Technical selection of the project, why choose these

  • .

2

The further the interviewers go, the more likely they are to ask scenario questions, which test the candidates’ ability to accumulate and solve problems. This link is easy to fail a group of people, especially nervous students, it is easy to mind a blank. The core of scenario problems is to deal with large amount of data and solve performance problems.

The scene question is more open in nature, there is no standard answer, as long as their own scheme can solve the problem, can “justify” it.

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

3. Professional skills

A collection of

  • Which maps are used frequently

  • The differences between these maps

  • How does CocurrentHashMap ensure thread safety

  • What is the difference between locking CocurrentHashMap before and after JDK 1.8

  • Let’s talk about how hashMaps work

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

  • HashMap Capacity expansion process

  • How has HashMap changed in JDK 1.8

  • How has CocurrentHashMap changed in JDK 1.8

  • The principle of the TreeMap

  • Map, List, and Set List of thread-safe and thread-unsafe classes you know, respectively

Multithreading, locking

  • Which thread pool is used

  • How to configure thread pool parameters

  • The role of the thread pool parameters

  • What should I pay attention to when setting thread pool parameters

  • Thread pool workflow

  • What the concurrent classes in the JDK know

  • The underlying principles of AQS

  • Pessimistic locks and optimistic locks

  • Which locks have been used

  • Differences between synchronized and Lock and usage scenarios

  • Principle of synchronized

  • Synchronized distinguishes static methods from ordinary methods, this from Lock.class

  • Why are biased locks and lightweight locks introduced? Introduce the upgrade process

  • Deadlocks are necessary and how to prevent deadlocks

  • Introduce CountDownLatch and CyclicBarrier

  • What are the problems with CAS

  • What are the problems with ThreadLocal

network

  • How is HTTPS encrypted

  • Common Hash and consistent Hash principles

  • Disadvantages of consistent Hash

  • TCP three-way handshake process. Why is the three-way handshake required

  • Why does TIME_WAIT take 2MSL to return to CLOSE

  • TCP congestion control

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

  • Why does sticking and unpacking occur and how to solve it

Spring, Mybatis

  • # and $in Mybatis

  • How do I prevent SQL injection

  • Mybatis: How to call DAO (Mapper) interface into SQL

  • This section describes the Spring IoC process

  • The difference between BeanFactory and FactoryBean

  • How is Spring AOP implemented

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

  • When can an object not be proxied

  • How does Spring solve the problem of loop dependency

  • How to perform some logic after the Spring IoC container is built

  • Difference between @Resource and @Autowire

  • How does @autowire use a name for injection

  • Is there a problem with the method specified by the bean’s init-method property using another bean instance

  • Is there a problem with the @postconstruct method using other bean instances

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

  • In Spring, the bean’s class property specifies a class that does not exist. Does an error occur, and if so, at what stage

  • What are common extension points in Spring

MySQL

  • MySQL index data structure

  • Why use B+ trees, and what are the advantages over other indexes

  • Differences between indexes

  • How do B+ trees handle range lookups

  • What is stored in the MySQL index leaf node

  • The underlying implementation of a federated index (compound index)

  • How does MySQL lock a row of data

  • Can a SELECT statement be mutex

  • Will multiple transactions simultaneously SELECT FOR UPDATE a row of data block or exception

  • Version and execution engine used by MySQL

  • MySQL different execution engines

  • MySQL transaction isolation level

  • How is repeatable read implemented in MySQL

  • Whether phantom reading occurs in MySQL

  • MySQL gap of the lock

  • The master-slave synchronization principle of MySQL

  • Implementation scheme of sub – library sub – table

  • Distributed unique ID scheme

  • How to optimize slow queries

  • Explain the meaning of each field

  • What are the common values for the type field in Explain

  • What fields do you usually focus on in Explain and why

JVM

  • Runtime data area

  • What garbage collector does the server use

  • Principles of CMS garbage collection

  • G1 Garbage collection features, why low latency

  • What are the garbage collection algorithms, advantages and disadvantages

  • Which objects can be used as GC Roots

  • What class loaders are available

  • Parental delegation pattern, which scenarios break parental delegation pattern

  • Online server frequently Full GC, how to check

  • Common commands for locating problems

  • Describes the process of JVM tuning

Kafka

  • Why Kafka

  • Introduce the components of Kafka

  • How do I ensure that data written to Kafka is not lost

  • How do I ensure that data consumed from Kafka is not lost

  • Why does Kafka perform so well

  • Which method is used to implement zero-copy technology

  • There is a similar zero-copy technique in Java

  • How does Kafka guarantee sequential consumption of messages

  • How does Kafka avoid repeated purchases

  • What are HighWatermark and LEO

  • What is ISR and why is it needed

Redis

  • The version of Redis used in the project

  • Redis usage scenarios in projects

  • How does Redis ensure high availability

  • Redis election process

  • Difference between Redis and Memcache

  • Redis cluster mode

  • Redis cluster to increase sharding, how to ensure the migration of slots lossless

  • Redis distributed lock implementation

  • Redis deletes the expired key policy

  • Redis’ memory elimination strategy

  • Redis Hash object underlying structure

  • Expansion flow of Hash objects in Redis

  • Is there any problem with Redis Hash object expansion process when there is a large amount of data

  • What are the persistence mechanisms of Redis

  • RDB and AOF implementation principle, advantages and disadvantages

  • AOF rewrite process

  • The principle of sentinel mode

  • When using caching, do you work on the database or the cache first

  • Why invalidate the cache instead of updating it

  • Cache penetration, cache breakdown, cache avalanche

  • Several design patterns for updating the cache

Zookeeper

  • Usage scenarios of Zookeeper

  • How to implement distributed lock in Zookeeper

  • How does Zookeeper ensure data consistency

  • Principle of ZAB protocol

  • Which of the CAP does Zookeeper follow

  • Differences between Zookeeper and Eureka

  • The Zookeeper Leader election

  • The role of the Observer

  • The Leader sends a COMMIT message, but none of the followers receive the message. As a result, the Leader hangs up. What happens next

distributed

  • Theory of CAP

  • The BASE theory of

  • Principles of distributed transaction 2PC and TCC

  • What if TCC fails in the Cancel phase

  • Paxos algorithm, Raft algorithm

4, Hr

If you’ve made it through all of these hurdles to Hr, you’re very, very close to getting an offer. You can start to imagine yourself getting a raise or a promotion, becoming a general manager, becoming a CEO, marrying Bai Fumei and stepping onto the peak of your life.

The Hr interview is to get to know the general qualities of candidates. The following questions are often asked:

  • Tell me about the projects you are most involved in (I was surprised when Hr started asking about projects

  • Reasons for leaving

  • Current salary, performance

  • I am currently interviewing with other companies

  • Have the habit of study at ordinary times, how study, what is studying now

  • Future planning

There are no right answers to these questions, but it is important to maintain a positive attitude and not negative emotions throughout the process.

When it comes to current salary, for many reasons, some people might want to overpay a little bit. I’m on the fence about that, but it’s important to be careful, because most big companies have background checks. Big companies tend to have zero tolerance for integrity issues and may block lists, which means you’ll never work there again.

Some lessons learned

  1. Pick a few small companies to look for the next interview feeling, too long without the face, need to find the feeling of the interview, I begin to face is not very good, very flustered 🙈.

  2. It’s normal to be nervous during an interview, but don’t be too nervous. If your mind goes blank after the interviewer asks you a question, you can tell the interviewer that you need to think about it, and then you can speak slowly but clearly in response.

  3. Answering questions during the interview is one thing; On the other hand, you should make the interviewer feel some good qualities of you in the process of answering, such as: potential, flexible, love of learning, learning ability, problem solving ability, solid foundation, etc. All of these qualities can affect how the interviewer judges you.

  4. When you encounter problems in your daily projects, you should actively solve them. The process of solving problems can make people grow quickly, and the problems you solve may become the highlights in your interview, especially for those projects with no highlights.

  5. When preparing for a project, pick a few features that you’ve done best or solved the most challenging problems, and have a thorough understanding of them. Don’t “falter” when you introduce them to the interviewer.

  6. Both frameworks and middleware have to have a few very deep studies, meaning you have to have enough “depth” in some areas as well as “breadth”. A common interview question is: which framework or middleware do you understand the most? Then the interviewer will continue to ask questions in this direction, and if you only see a lot of things in general, you are likely to be asked questions in this direction.

  7. Every function point and knowledge point you speak out should be prepared to be challenged, so you should think more about every function point and knowledge point.

  8. If the question is about an actual online situation, sometimes the interviewer will give their current online solution. If you can give some thoughts and opinions, it may make a good impression on the interviewer.

  9. A simple, crude way to tell if you’re ready: Can you answer about 90 percent of the interview questions you see, such as the ones listed in “Professional Skills” above?

  10. If you’re serious about changing jobs, or if you’re already quitting, don’t stop interviewing until you receive an e-offer. Even verbal offers can be shaky, especially in the middle of winter.

  11. Think more in daily work, whether it is writing code or scheme design, think more about better solutions. Especially the longer we work, the more important thinking becomes to our career development.

  12. Preparation before the interview is very important, but what is more important is the accumulation of daily work. Many of the questions asked by the 4-year experience cannot be prepared temporarily, and many of them need to be accumulated continuously to have a good plan.

  13. Focus on your own growth, don’t let others influence you, as long as you continue to accumulate, you can one day become the god in your eyes.

  14. Learning is like rowing upstream; not to advance is to drop back. Don’t stop learning, especially while you are young, while you are still a single dog, force yourself, the future you will be grateful for now desperately.

  15. Being a programmer is a simple job. There’s no bells and whistles involved. As long as you put in the effort, you usually reap the rewards.

  16. For those without dACHang background and in a traditional industry (like ME two years ago), it is difficult to enter Dachang directly, unless you are lucky like me, but the odds are not good. I think the more realistic way is to find an Internet unicorn to settle for a period of time.

  17. Large companies have many departments, and the recruitment of each department is usually independent. If you want to join a large company, you can invest more. The demand tension of each department is different, and it may be a very good opportunity if there is an urgent need for recruitment.

  18. Interviews at large companies are usually on file, and interviewers may see your previous interview evaluations. If you go round a lot, you are sure to give the interviewer a bad impression. So be prepared for the interview and don’t waste it.

  19. The market of the Internet industry is not so good in 2019, and it may continue to be so, especially for students without big factory background, so please remember a very important principle: do not resign naked.

  20. Last but not least, if you think this article is helpful to you, please follow my wechat public number and share it in moments to help more friends.