Recently, the Boss of my previous internship contacted me and said that he had moved to Ali. He asked me if I was interested in a Java background development position.
Considering I’ve only been working for a year, I’m not too keen on taking a pay cut to go to Ali. However, in order to improve myself, I took the interview.
One interview (1 hour telephone interview)
First, make a brief introduction of yourself, including school experience and work experience. I have only worked for one year, and most of my time was in product Design and UI/UX Design, so I could feel the shock of the interviewer across the phone.
Java based. How to implement autounboxing, StringBuffer, StringBuilder and their respective implementations.
The JVM. JVM memory model, common garbage collection algorithm.
Transaction ACID, how to guarantee transactions in programming, how to guarantee transactions in distributed situation.
Since I have no experience with distributed scenarios, the interviewer has been enticing me to design and implement a distributed transaction.
Optimistic and pessimistic database locks. How to implement an optimistic lock.
Message queue usage scenarios, Kafka architecture and principles.
What are restful apis and how are they different from RPC calls?
Several ways of writing singletons. What does the volatile keyword do?
These are the general questions for the telephone interview. After the interview, I was given three algorithm questions and asked to complete them in one hour. Here are three algorithm questions:
-
Flip a long number. For example, enter 123456L and output 654321L. – Leetcode reverses the integer variant. See if overflow situations can be handled correctly.
-
Enter a double and ask for the closest number of.49 or.99 to be returned. For example, 12.77 returns 12.99, 11.02 returns 10.99, 12.61 returns 12.49.
-
Thread ABC writes a, L, and I to an array. The number of writes is determined by thread A.
I did well in the three questions. The next day, the interviewer contacted me to explain the ideas of the first and third questions, and then informed me that I could participate in the next round.
Second interview (telephone interview for one hour)
The second interview mainly examined some open questions.
First, introduce yourself. Mostly post-job experience. Introduce the products of the team I worked in for one year and what responsibilities I undertook.
Open questions. How to design an RPC framework.
Open questions. How to design a service registry.
Collection class source. How HashMap was implemented, the process of expansion, and why it was doubled. Can a linked list in a HashMap be replaced with an array? Is the time complexity the same?
Collection class source. What is a thread-safe HashMap? (HashTable and ConcurrentHashMap) How is ConcurrentHashMap implemented? What are the advantages over HashTable (Java7 fragment locking and CAS+Lock for Java8)? The structure of the red-black tree, what the time complexity is, how it’s calculated.
What are CAS operations and how do I implement a custom lock
Database design. If you have a large order table, how can you design it to improve query efficiency (satisfy query by buyer ID and seller ID at the same time)?
The second interview also lasted about an hour, and the interview process went smoothly.
Ps. After the first and second interviews, the interviewers suggested that I would work overtime like crazy. Can I accept blabla?
Three interviews (telephone interview for one and a half hours)
On the third day after the second interview, I received the notice of the third interview.
The three sides are a big Boss, so the interview questions are more about the ability to analyze problems.
Tell me what you have learned in one year of work. What is the architecture of the project? What are the specifications for UI/UX design (the interviewer asked because I said I had learned something about UI/UX design)? Data isolation level, dirty read unreal.
Thread pool principles.
Synchronized implementation, lock upgrade process.
The role of K8s, K8s underlying architecture.
Some of the projects I’ve been working on in my spare time.
What do you think you can bring to Ali by joining ali?
You need to endure a lot of difficulties to enter Ali, you need to grasp the nettle, if you get a bad review, what will you do?
On the whole, the three interviews went well, and the interviewer was kind.
conclusion
The whole process from one side to three lasted about 10 days. In general, the questions were within the expected range. Although I was asked some distributed questions during the interview, I didn’t have any experience. At this time, don’t give up.
Finally, I summarized some of the interview Java background engineer must master the knowledge point.
- Collection class source code
ArrayList: Internal data structure, array expansion mechanism
LinkedList: Internal data structures, why two-way lists
HashMap: Internal data structure, complete flow of PUT methods, expansion mechanism
LikedHashMap: Internal data structure, how to implement a Cache
TreeMap: Internal data structure, time complexity
CurrentHashMap: internal data structure, Java7 segmental locking, Java8 CAS+Synchronized
- Java based
Principle of automatic unpacking
String, StringBuffer and StringBuilder
Throwable
The reader and the stream
NIO
- The JVM based
JVM memory model
Common garbage collection algorithms
- Fundamentals of Concurrent programming
Principle of Synchronized keyword
Wait, notify, sleep
Safe thread termination and thread state transition
Custom Lock
Thread Pool Principle
5. Database basics
Database triad, transaction ACID, Isolation level, View, index
JPA entity status
EntityManger
- Network based
TCP/IP
- Common Design Patterns
Decorator, template method, strategy, factory, state