A false alarm , Almost on three sides of meituan , The culprit is actually “Redis”？
In the process of looking for a job , about Redis The skills that must be mastered have become . Meituan interview is often asked about Redis Related knowledge , And this time I almost hung up in meituan 3 Noodles , The interviewer asked me the following questions Redis The problem of , And then it jammed …
- redis Understand? ？Redis key The expiration strategy of Redis Understand? ？ Tell me how to use redis Implement distributed locks ？
- Redis Common data structure and underlying data structure implementation
- How to solve Redis The concurrent competition of Key problem
- How to ensure the cache and database double write data consistency ？
- Redis What are the ways of persistence , How to choose ？
- Redis Of zset How to achieve ？
- Redis What is the process of master-slave synchronization ？
- … …（ I don't remember the rest … For this reason, I will come back after the interview Redis I made a big summary ）
01 Redis The common division of interview questions （6 Parts of , With a complete explanation of the answer ）
The first part ：Redis Conceptual understanding of
The second part ：Redis Data structures and instructions
The third part ：Redis High concurrency processing strategy
The fourth part ：Redis Cluster structure and design concept
The fifth part ：Redis Cache management and persistence mechanism
The sixth part ：Redis Application scenario design
Be careful ： All the questions are listed above , Without looking at the analysis first , Try the water yourself first .. The resolution is at the end ..
The notes are hand written all the way , I hope you don't throw your notes into your favorites after you get them ！
1.1 Redis Interview questions ： The first part ：Redis Conceptual understanding of
- What is? Redis?
- Redis What are the characteristics of ？
- Memcache And Redis What are the differences ?
- Redis comparison Memcached What are the advantages ？
- How to implement local caching ？ Please describe the way you know
- Redis What is the communication protocol ？ What are the characteristics of ？
1.2 Redis Interview questions ： The second part ：Redis Data structures and instructions
- Redis Supported data types
- Redis What are the common commands ？
- What is the maximum storage capacity of a string type value ？
- Redis What is the maximum storage capacity of each data type ?
- Please introduce Redis Data type of SortedSet（zset） And the underlying implementation mechanism ？
- Redis What are the transaction related commands ？
- What is? Redis Business ？ What is the principle ？
- Redis What are the points for attention in business ？
- Redis Why rollback is not supported ？
- Please introduce Redis Of Pipeline（ The Conduit ）, And use scenarios
- Please explain Redis Batch command and Pipeline What's the difference ？
- Please introduce Redis The publish and subscribe function of
- Redis What are the characteristics of linked list data structure of ？
- Please introduce Redis Of String The type underlying implementation ？
- Redis Of String Type used SSD The benefits of this approach ？
- What are the commands for setting the lifetime and expiration time of the key ？
1.3 Redis Interview questions ： The second part ： The third part ：Redis High concurrency processing strategy
- Why? Redis You need to put all the data in memory ？
- Redis Is it single threaded ？
- Redis Why is it designed to be single threaded ？
- What is cache penetration ？ How to solve ？
- What is a cache avalanche ？ How to solve ？
- There are several cache update strategies ？ What are the precautions ？
- Please introduce several possible causes of Redis Cause of obstruction
- How to find out Redis Blocking anomalies ？
1.4 Redis Interview questions ： The second part ： The fourth part ：Redis Cluster structure and design concept
- Redis What are the cluster architecture models ？
- Redis What is the maximum number of nodes in the cluster ？
- Redis What is the master-slave replication model of a cluster ？
- Please introduce Redis Cluster implementation scheme
- Redis Are there any write operations lost in the cluster ？ Why? ？
- Redis What is slow query ？ Through what configuration ？
- Redis What's the experience of slow query repair ？ How to fix it ？
- How to optimize Redis Service performance ？
- Redis What are the advantages and disadvantages of the master-slave replication model ?
- Redis sentinel（ sentry ） What are the advantages and disadvantages of the model ？
- How to set up Redis Is the maximum number of connections ？ see Redis Is the maximum number of connections ？ see Redis The current
- Introduce some Redis Common security settings ？
1.5 Redis Interview questions ： The second part ： The fifth part ：Redis Cache management and persistence mechanism
- Redis What are the persistence mechanisms ？
- Redis Persistence mechanism AOF and RDB What are the differences ？
- Please introduce RDB The advantages and disadvantages of persistence mechanism
- Please introduce AOF The advantages and disadvantages of persistence mechanism
- If AOF The data of the file is abnormal , Redis How to deal with the service ？
- What are the common elimination algorithms ？
- Redis What are the elimination strategies ？
- Redis What are the cache invalidation strategies ？
- Redis How to optimize memory ？
- What is? bigkey？ What's the impact? ？
- How to find out bigkey?
- Redis What are the memory consumption categories of ？ What command does memory statistics use ？
- A brief introduction Redis What are the memory management methods of ？
- How to set up Redis The maximum memory limit of ？ What's the role ？
- Redis How to deal with insufficient memory ？
1.6 Redis Interview questions ： The sixth part ：Redis Application scenario design
- Redis What are the applicable scenarios ？
- Redis What are the common business scenarios ？
- Redis Supported by Java What are the clients ？ A brief description of the features .
- Please give a brief description of Jedis The basic use method ？
- Jedis What are the advantages of the connection pool linking method ？
- What is distributed lock ？ What's the role ？
- What can distributed locks be implemented through ？
- This paper introduces the matters needing attention in the implementation of distributed lock ？
- Redis How to implement distributed locks ？
- What does cache hit ratio mean ？
- How to improve cache hit rate ？
- Please introduce Spring Annotation cache
All in all from Redis Conceptual understanding of 、 Data structures and instructions 、 High concurrency processing strategy 、 Cluster structure and design concept 、 Cache management and persistence mechanism 、 Application scenario design and other six major parts of the above 70 High frequency , There are 25 page （ As shown in the figure below ）, The space is limited, so I can't write it all in the article （ There are handwritten notes and so on ）, But you can share it with friends who need it
02 A pure handwritten copy of Redis note
This is from a friend , After watching it, I still feel very good . The whole note is divided into five parts ： The first part ：Redis The basic chapter The second part ：Redis Data structure The third part ：Redis Persistent article The fourth part ：Redis Cluster The fifth part ：Redis Other questions
2.1 The first part ：Redis The basic chapter
- What is? Redis ?mRedis Advantages and disadvantages
- Why cache ? Why use Redis?
- What's wrong with using cache ?
- Redis Why did earlier versions choose single threads ?
- Redis Why so soon? ?
2.2 The second part ：Redis Data structure
- Redis Common data structure and implementation ?
- Redis Of SDS and C The advantages of string comparison in ?
- How the dictionary is realized ? Rehash Understand? ?
- How the jump table is realized ? principle ?
- HyperLogLog Do you understand ?
- What do you know about bloon filter ?
- GeoHash Understand? ?
- Compress the list to understand ?
- Quick list quicklist Understand? ?
- Stream Do you know the structure ?
2.3 The third part ：Redis Persistent article
- What is persistence ?
- Redis Two ways of persistence in ?
- RDB and AOF What are the advantages and disadvantages of each ?
- How to choose two ways ?
- Redis Data recovery
2.4 The fourth part ：Redis Cluster
- Master slave synchronization ?
- Do you understand sentinel mode ?
- Redis Has the cluster ever been used ? principle ?
- How to partition data in a cluster ?
- Do you understand the communication mechanism between nodes ?
- Do you know how to store cluster data ?
2.5 The fifth part ：Redis Other questions
- Redis How to implement distributed locks ?
- Redis Delete strategy of expired key ?
- Redis What are the elimination strategies ?
- Redis Common performance problems and solutions ?
03 Redis Advanced must see ：《Redis actual combat 》+《Redis Design and implementation 》
3.1 《Redis actual combat 》
Introduced in simple terms Redis Of 5 Type of data , And through a number of practical examples to show Redis usage . besides , It also tells about Redis Optimization method and extension method of , For learning and using Redis For rare reference notes .
This note consists of three parts ：
The first part introduction ： Yes Redis Introduced , Illustrates the Redis The basic use method 、 It has 5 Data structures and operations 5 Command of data structure , And explained how to use Redis To build an article aggregation site 、cookie、 The shopping cart 、 Web caching 、 A series of programs, such as database row caching ;
- The first 1 Chapter First time to know Redis
- The first 2 Chapter Use Redis structure Web application
The second part The core concept ： Yes Redis The command is described in more detail , And shows how to use Redis To build more complex tools and Applications , At the end of the article, it shows how to use Redis To build a simple social network ;
- The first 3 Chapter Redis command
- The first 4 Chapter Data security and performance assurance
- The first 5 Chapter Use Redis Build support
- The first 6 Chapter Use Redis Build application components
- The first 7 Chapter Search based applications
- The first 8 Chapter Build a simple social network
The third part Advanced content ： Yes Redis Some problems that users often encounter are introduced , Explained lowering Redis How to use memory 、 Expand Redis Performance method and use Lua Language for scripting methods ;
- The first 9 Chapter Reduce memory usage
- The first 10 Chapter Expand Redis
- The first 11 Chapter Redis Of Lua scripting
Tip： Due to the limited length of the article , And then there is 20 about MySQL The problem of , I'll make a copy of it pdf Document. , I'll show you the rest of the questions in the following contents
If you think it's helpful 【 forward + give the thumbs-up + Focus on 】 Stand by me , The follow-up will bring you more technical articles and learning articles ！（ Ali is right MySQL The underlying implementation and index implementation ask a lot ）
After eating through this pdf, You can also talk to the interviewer MySQL. Actually, like Ali p7 The demand for jobs is not that hard （ But it's not easy ）, Solid Java Basics + No short board knowledge + Deep learning of some open source technologies + Read the source code + Algorithm brush question , This one comes down p7 It's almost no problem , I hope everyone can get a high salary offer Well .
This article has been CODING Open source project ：【 A big factory Java Analysis of interview questions + Core summary learning notes + The latest explanation video + Actual project source code 】 Included