Einstein said, "Patience and perseverance will always get paid." I have always regarded this as my motto, and this motto has been completely realized in "me" this year.
Every programmer has a dream of a big factory, and I am no exception. I was asked by MySQL last year when I interviewed Ant Financial. Many related questions were not answered, and it was cold after only two. After I went back, I also concentrated on reviewing and prepared for World War II. Now I finally entered Ant Financial and was hired.
The following Alibaba interview questions (including answers), learning materials, actual combat documents, etc., can be shared with everyone for free. Friends who need it, there is a free way at the end of the article
01 Ant Financial Interview Questions of MySQL
The previous interview questions of Ali are summarized, and the content of the specific interview questions is organized into documents. This article is for the MySQL series, so the following only shows some of the MySQL problems that I was slammed and asked when I interviewed Ali for the first time.
- Please explain the concept and main features of relational database?
- Please tell us the typical products, characteristics and application scenarios of relational databases?
- Please describe in detail the SQL statement classification and corresponding representative keywords.
- What is MySQL multi-instance and how to configure MySQL multi-instance?
- How to strengthen MySQL security, please give specific feasible measures?
- I executed a SQL statement in the drop library by mistake. How to recover completely?
- Describe the principle of MySQL master-slave replication and the complete steps to configure master-slave.
- How does MySQL realize bidirectional master-slave replication and explain the application scenarios?
- How does MySQL realize cascade synchronization and explain the application scenarios?
- How to solve MySQL master-slave replication failure?
02 Interview Questions for Ali, Tmall Team in World War II (3 rounds of technical side + HR side)
Ant Financial Interview Technical Questions:
- Introduce yourself
- Project introduction (first introduce the project by yourself, then chat)
- junit usage, before, beforeClass, after, afterClass execution order
- Distributed lock
- Nginx request forwarding algorithm, how to configure forwarding based on weight
- What are the problems with using hashmap to implement redis (deadlock, dead loop, ConcurrentHashmap available)
- Thread status
- The way the thread is blocked
- The difference between sleep and wait
- The underlying implementation of hashmap
- Ten thousand people grab 100 red envelopes, how to achieve (without queue), how to ensure that 2 people can not grab the same red envelope, distributed locks are available
- Java memory model, garbage collection mechanism, unreachable algorithm
- Two Integer reference objects are passed to a swap method to exchange references within the method. After returning, will the values of the two references be found to change
- The underlying implementation of AOP, how dynamic is the dynamic proxy? If there are 100 objects, how to dynamically proxy these 100 objects?
- Have you used maven install, maven test, git (make install is to install local jar packages)
- Various Tomcat configurations, how to configure docBase
- Several ways of Spring bean configuration
- Web.xml configuration
- Spring's listener.
- The implementation mechanism of Zookeeper, there is a cache, how to store the registration service
- Will IO block? Is readLine blocking
- Have you used Spring's thread pool or Java's thread pool?
- String formatting method (the two questions 20 and 21 are too low-level)
- Time formatting method
- What is the timer made of
- How the thread exits and ends
- What locks does java have? Optimistic lock, pessimistic lock synchronized, reentrant lock, read-write lock, have you used reentrantlock? The difference between reentrantlock and synmchronized
- Usage scenarios of ThreadLocal
- Java memory model, garbage collection mechanism
- Why the thread execution should call start instead of run directly (direct run is no different from ordinary methods, start first, run will run as a thread method)
- The realization mechanism of qmq messages (qmq is a message queue encapsulated by Qunar.com)
- Three ways to traverse the hashmap
- Some commands of JVM
- The difference between memcache and redis
- Where is the row-level lock of Mysql added
- How is the lock of ConcurrentHashmap added? Is the more segments the better
- The difference between myisam and innodb (innodb is a row-level lock, myisam is a table-level lock)
- MySQL other performance optimization methods
- Where to look at the Linux system log
- How to view the network process?
- Count the number of bit 1 in the binary representation of an integer
- JVM memory model, java memory model
Answers to interview questions:
03 How did I review before World War II?
(1) MySQL topic section (first brush the topic)
- What kind of locks are there in Mysql?
- Under what circumstances are MYSQL data tables easily damaged?
- What field type is good for recording currency in MySQL
- Does MYSQL support transactions?
- Explain the access control list
- What are common SQL functions?
- What is a non-standard string type?
- How many TRIGGERS are allowed in Mysql table?
- What kind of objects can be created using the CREATE statement?
- What is the difference between NOW() and CURRENT_DATE()?
- How many columns can be used to create an index?
- What is InnoDB?
- How does Mysql optimize DISTINCT?
- How to input characters as hexadecimal numbers?
- How to display the first 50 rows?
- ......
Answers to MySQL interview questions:
(2) 21 best practices for MySQL performance optimization
- Optimize your queries for query caching
- EXPLAIN your SELECT query
- Use LIMIT 1 when only one row of data is required
- Index the search field
- Use a similar type of example when joining the table, and index it
- Never ORDER BY RAND()
- Avoid SELECT *
- Always set an ID for each table
- Use ENUM instead of VARCHAR
- Get advice from PROCEDURE ANALYSE()
- Use NOT NULL whenever possible
- Prepared Statements
- Unbuffered query
- Save the IP address as UNSIGNED INT
- Fixed-length tables will be faster
- Vertical split
- Split large DELETE or INSERT statements
- The smaller the column, the faster
- Choosing the right storage engine
- Use an Object Relational Mapper
- Beware of "permalinks"
(3) MySQL performance tuning and architecture design
- Basic articles:
- Basic introduction to MySQL
- MySQL architecture composition
- Introduction to MySQL storage engine
- MySQL security management
- MySQL backup and restore
- Performance optimization articles:
- Related factors affecting the performance of MySQLServer
- MySQL database locking mechanism
- Optimization of MySQL database query
- Performance optimization of MySQL database schema design
- MySQLServer performance optimization
- Common storage engine optimization
- Architecture design articles:
- Basic principles of MySQL scalable design
- Scalable design of MySQLReplication
- Data segmentation for scalability design
- Scalable design of Cache and Search..
- MySQLCluster
- Ideas and solutions for high-availability design
- MySQL monitoring of high availability design
04 My review book data
(1) Java Interview Manual
- Performance optimization interview column
- Microservice architecture interview column
- Concurrent programming advanced interview column
- Open source framework interview questions column
- Distributed interview column
(2) Actual documentation
- Redis combat
- MySQL combat
- Spring Boot combat
- Spring Cloud combat
- Actual Java Virtual Machine
Take the actual combat Java virtual machine as an example:
- Probe into the Java Virtual Machine
- Understand the basic structure of the Java virtual machine
- Common Java virtual machine parameters
- Garbage collection concepts and algorithms
- Garbage collector and memory allocation
- Performance monitoring tools
- Analyze the Java heap
- Locking and concurrency
- Class file structure
- Class loading system
- Bytecode execution
(3) Java core knowledge points to organize documents
Due to space limitations, many contents only show catalogs and screenshots, which are organized in documents. Those who need these documents can be shared with everyone for free . I hope all programmers can learn and strive to achieve our big factory. dream!