Summary of Java Interview Questions about Distributed System Message Queuing

2023/04/02 1:24

  1. Why use message queues?
  2. What are the advantages and disadvantages of using message queues?
  3. What are the differences among kafka, activemq, rabbitmq, and rocketmq?
  4. How do you ensure the high availability of message queues?
  5. How to ensure that messages are not consumed repeatedly? How to ensure that consumption is idempotent?
  6. How to ensure reliable transmission of messages? What if the news is lost?
  7. How to ensure the sequence of messages?
  8. How to solve the problem of message queue latency and expiration expiration? What should I do when the message queue is full? There are millions of messages that have been backlog for several hours. How can we solve them?
  9. If you were asked to write a message queue, how would you design the architecture? Tell me your thoughts
  10. How do you use message queuing in your project?
  11. What MQ have you used and how to use it? What are the advantages and disadvantages compared to other mqs? Is MQ connection thread safe
  12. How to ensure that data in the MQ system is not lost
  13. Kafka’s Three ACK Mechanisms
  14. Can you explain the principle of distributed architecture of ES (how does ES achieve distributed architecture)?
  15. How does ES write data work? How does ES query data work?
  16. How can ES improve query performance when there is a large amount of data (billions of levels)?
  17. What is the deployment architecture of the ES production cluster? What is the approximate amount of data per index? How many slices are there per index?
  18. What about Lucene on the bottom? Do you understand the inverted index?
  19. Can Redis swap memory space into disk
  20. Is Redis distributed for caching? Is the data stored on different servers duplicate? What about Guavacache? Repeat? Different machines store different data
  21. How is cache used in a project? What are the consequences of using the cache improperly?
  22. What is the difference between Redis and Memcached? The difference in memory management between Redis and Memcached; What is the threading model for Redis? Why is single threaded Redis much more efficient than multi threaded Memcached (why is Redis single threaded but still capable of supporting high concurrency)?
  23. What data types does Redis have? Which scenarios are suitable for use?
  24. What are the expiration policies for Redis? What are the memory obsolescence mechanisms? Handwriting LRU code implementation?
  25. How to ensure high concurrency and high availability of Redis? Can you introduce the principle of master slave replication for Redis? Can you introduce the Sentinel Principle of Redis?
  26. The relationship between Redis high concurrency and the high concurrency of the entire system
  27. Where is the bottleneck that Redis cannot support high concurrency?
  28. What should Redis do if it wants to support more than 100000+concurrency?
  29. Redis data structure, enabling scenarios, and Weibo scenarios enable Redis to design user relationships
  30. What are the ways to persist Redis? What are the advantages and disadvantages of different persistence mechanisms? How is the underlying persistence mechanism implemented? Talk about the persistence process of Redis
  31. Can you explain the working principle of the Redis cluster mode? How is the Redis key addressed in cluster mode? What are the algorithms for distributed addressing? Do you understand the consistent hash algorithm?
  32. How to ensure dual write consistency between the cache and the database?
  33. Understand what is the avalanche and penetration of Redis? What happens after Redis crashes? How should the system respond to this situation? How to handle Redis penetration?
  34. What are the concurrent competition issues with Redis? How to solve this problem? Do you understand the CAS solution for Redis transactions?
  35. How is Redis deployed in a production environment?
  36. What is the semi open and semi closed state of a connection
  37. If a service relies on a single point of Redis, this Redis failure will cause the service to be unavailable. How to improve Redis sharding
  38. When a large amount of data is required to be saved using Redis, it is difficult for a single machine to meet the needs. Therefore, a load balancing system is designed (swapped)
  39. The scheme of balance
  40. When Redis uses hash for sharding, there are now 8 nodes, and the load scheme is pos=hash (key)%
  41. Then save it on the pos node. What are the advantages and disadvantages of doing this? What should I do when 8 nodes need to be expanded to 10 nodes? Is there any more convenient expansion plan? (Consistency hash, presharding)
  42. The differences between sentinel and cluster and their respective scenarios, the Redis cluster synchronization process, why Redis single thread is fast, why multiple threads are called hot keys, the causes and consequences of hot key production, and how to resolve them, and what about the timeliness of local cache requirements
  43. What are the common cache strategies, what cache systems are used in your project, how to design them, what to pay attention to when using Redis, persistence methods, memory settings, clustering, and obsolescence strategies
  44. Explain what is the MESI protocol (cache consistency)
  45. Tell me about several HASH algorithms you know. Simple ones can also be used
  46. What is the paxos algorithm
  47. What are the problems with using hashmap to implement Redis (deadlock, loop, and ConcurrentHashmap are available)
  48. An online document system that allows documents to be edited. How to prevent multiple people from editing and updating the same document simultaneously
  49. What are the general methods for implementing distributed locks? How to design distributed locks using Redis? Is it okay to use zk to design distributed locks? Which of the two distributed lock implementations is more efficient?
  50. How to implement distributed sessions during cluster deployment?
  51. What are the usage scenarios for zk?
  52. Why should we choose this implementation for distributed locks in ZK? What is the scene like?
  53. What happened to ZK? Election mechanism?
  54. The implementation mechanism of Zookeeper, including caching, and how to store the registration service
  55. How to notify the consumer when a transaction, node, or service provider of a Zookeeper hangs
  56. How is Redis implemented? Have you ever used RedisTemplet
  57. What is the difference between Jedis and RedisTemplate?

Leave a Reply

Back to top