The interview experience was good, the interviewer was guiding all the time, but it's been a long time since I've dealt with the "eight-legged essay" 🤣
- Position: Backend Development
- Date: 2023-05
- Interview Duration: 1 hour 24 minutes
Java#
Basics#
-
Differences between String, StringBuilder, and StringBuffer
- What is the reason for the better performance of StringBuilder?
-
What are the List implementations used in Java development, and can you explain their characteristics?
- What is the difference between ArrayList and LinkedList?
-
What are the Map implementations used in Java development, and can you explain their characteristics?
- What problems can occur with HashMap in concurrent scenarios, and what methods can be used to solve them?
Concurrency#
-
In what situations do you need to use a thread pool in daily development?
- Why use a thread pool instead of directly creating a new thread?
-
Besides using multithreading, what other approaches do you use to solve concurrency problems in programming (such as locks)?
- Have you used the synchronized keyword in Java? Can you explain how it is generally used?
- Can synchronized be used to modify methods? What phenomenon will occur?
-
Usage and differences between Sleep() and Wait() methods
JVM Virtual Machine#
- Are you familiar with Java Virtual Machine garbage collection?
- Which GC model is used in the project?
Database#
- What are the transaction isolation levels in MySQL? Can you give an example for each level?
- Can you explain MySQL locks, such as gap locks?
- Are you familiar with indexes?
- Why is the efficiency of primary key index queries faster than that of ordinary indexes?
- What is the difference between a unique index and a primary key index?
Data Structures and Algorithms#
- Introduction to Quick Sort and Heap Sort
- Write the inorder and preorder traversal of a binary tree using recursion
Projects#
- Provide a detailed explanation of the projects you have worked on
- Why do you use Spring Cloud's OpenFeign to call third-party services in the project?
- How is the log calling chain implemented in the project, and how does it work in practice?
- What are the differences between MySQL and ProgresSQL, and why did you switch the database from MySQL to ProgresSQL?
- How is the smooth transition of database migration completed without stopping the service?
- How to achieve a smooth database switch without stopping the service?
- Scenario: Calling an interface where Step A is executed sequentially and Step B is executed asynchronously in the background to record the call logs (which takes a long time). Now, if Step A is successful and returned to the user, but the service crashes during the execution of Step B and the logs are not recorded, how would you handle it?