One side (phone interview for one hour)
First, make a simple self-introduction, which mainly includes school experience and work experience. I have only one year of work experience, and I spend most of my time doing product design and UI/UX Design, so I can feel the shock of the interviewer over the phone.
Java basics. How to realize automatic unpacking, the similarities and differences of String, StringBuffer, StringBuilder and their respective implementations.
JVM basics. JVM memory model, common garbage collection algorithm.
Transaction ACID, how to guarantee transactions during programming, and how to guarantee transactions in distributed situations.
Since I haven't been exposed to distributed related scenarios, the interviewer has always induced me to design and implement a distributed transaction.
Optimistic and pessimistic locking of the database. How to implement an optimistic lock.
Message queue usage scenarios, Kafka's architecture and principles.
What is a restful api, and what is the difference between rpc calls.
Several ways of writing singletons. What is the role of the volatile keyword.
The above is the general question of the telephone interview. After the interview, I sent me three algorithm questions and asked me to complete them within one hour. Here are the three algorithm questions:
1. Flip a long type number. For example, input 123456L and output 654321L. -Leetcode flips the variant of integer. Check whether the overflow situation can be handled correctly.
2. Enter a double and ask to return the nearest .49 or .99 number. For example, 12.77 returns 12.99, 11.02 returns 10.99, and 12.61 returns 12.49.
3. There are three threads ABC write a, l, i to an array respectively, and the final write result is required to be in the form of aliasali...the number of writes is determined by the A thread.
These three questions are still relatively smooth. The interviewer contacted me the next day to explain the ideas of the first and third questions, and then informed me that I could participate in the next round.
Two sides (one hour phone interview)
The second side mainly examines some open-ended questions.
First of all, introduce yourself. Mainly the experience after work. Introduce the products of the team where I have worked for one year, and what responsibilities I have assumed.
Open-ended questions. How to design an rpc framework.
Open-ended questions. How to design a service registry.
Collection source code. How is HashMap realized, and why should the capacity be doubled during the expansion process? Can the linked list in HashMap be replaced with an array? Is the time complexity the same?
Collection source code. What is a thread-safe HashMap? (HashTable and ConcurrentHashMap) How is ConcurrentHashMap implemented? (Java7 segment lock and Java8 CAS+Lock) What are the advantages compared to HashTable? The structure of the red-black tree, what is the time complexity, and how to calculate it.
What is CAS operation and how to implement a custom lock
Database Design. There is a large order table, how to design it to improve query efficiency (at the same time satisfy the query based on buyer id and seller id)?
It was also about an hour on both sides, and the interview process was fairly smooth.
ps. After one side and two sides are over, the interviewer all hinted that I am going to work crazy overtime, can I accept blabla......
Three sides (phone interview for one and a half hours)
On the third day after the end of the second side, I received a notice from the three sides on the spot.
Three sides are a big Boss, so the interview questions are more about the ability to analyze problems.
Introduce what you learned during a year of work? What is the structure of the project? What are the UI/UX design specifications (because I said I learned some UI/UX design methods, so the interviewer asked)? Data isolation level, dirty read phantom read.
Principle of thread pool.
The realization of Synchronized, the upgrade process of the lock.
The role of K8s, the underlying architecture of K8s.
I introduced some projects that I did in my spare time.
What do you think you can bring to Ali by joining Ali?
You have to endure a lot of difficulties to enter Ali, and you need to face them. What will you do if you get bad reviews in the performance appraisal?
All in all, it's pretty smooth, and the interviewer is kind.
to sum up
The whole process lasted about 10 days from one side to three sides. In general, the questions are within the expected range. Although some distributed-related questions were asked during the interview, I have no experience. Don't give up at this time. Take the initiative to speak your thoughts, and then be guided by the interviewer. , I believe you can tell the answer.
Finally, I have summarized some of the knowledge points that I must master when interviewing a Java background engineer.
1. Collection source code
ArrayList: internal data structure, array expansion mechanism
LinkedList: Internal data structure, why use doubly linked list
HashMap: internal data structure, complete process of put method, expansion mechanism
LikedHashMap: internal data structure, how to implement a Cache
TreeMap: internal data structure, time complexity
CurrentHashMap: internal data structure, Java7 segment lock, Java8 CAS+Synchronized
2. Java basics
Principle of automatic unpacking
String,StringBuffer和StringBuilder
Throwable
reader and stream
NIO
3. JVM basics
JVM memory model
Common garbage collection algorithms
4. Fundamentals of Concurrent Programming
Synchronized keyword principle
wait,notify,sleep
Safe termination of threads and thread state transitions
Custom Lock
Principle of Thread Pool
5. Database foundation
Database three paradigms, transaction ACID, isolation level, view, index
JPA entity status
EntityManger
6. Network Foundation
TCP/IP
7. Common design patterns
Decorator, template method, strategy, factory, state
Thank you for watching, you need to receive the interview questions compiled by the editor, pay attention to the official account: Java Development Road, and send [Interview]