1. Introduction to Redis:


  • Three major features:
    • Data can be persistent, you can persist the data in memory to the local disk, with a restart to load again for use
    • Redis supports multiple data types: String, list, Hash, set, zset
    • Redis supports backup, that is, data backup in master-slave mode
  • Ps: Redis has high performance, rich data types, atomicity (all or none), and support for setting expiration times
  • Different from other K-V databases: 1. Multiple data types are supported; 2. Data can be persisted to disk.

See: https://juejin.cn/post/6844903559322927112

3. Why is the capacity of hashMap a power of 2

  • To add a k-V key-value pair, specify the location of the element by using the hash value % the length of the hash table (hash%table.length), but the module operation is very expensive, and the bit operation hash& (leng-1) can also obtain the location of the module. And bit operation efficiency is high, but only when the length of length is 2 n power, h& (length-1) is equivalent to H %length.
  • When the length of the array is 2 to the power of n, the probability of the index calculated by different KE is very small, so the data distribution in the array is more uniform, that is, the collision is reduced, and there is no need to traverse the linked list at a certain position during the query, so the query efficiency is improved.

4, The object class you know the method:

5. Design patterns

6, sorting,

See: https://juejin.cn/post/6844903488892174343;

5. Collection and synthesis — see your own collection

6. What is consistency and isolation

Java’s memory model and garbage collection

Dynamic proxy

See: https://blog.csdn.net/heyutao007/article/details/49738887

Java polymorphism

10. Data structures