Linked List
Reverse Linked List
| |
Reverse linked list focuses on pre and cur positions before start and after end. In this case, old pre.next becomes new pre, old cur.next becomes new cur.

| |
Reverse linked list focuses on pre and cur positions before start and after end. In this case, old pre.next becomes new pre, old cur.next becomes new cur.

Use Redis sorted set: key is post ID, set stores user IDs who liked, score is timestamp of like.
When frontend views post details, backend needs to:
| |
Frontend doesn’t send current like status; backend checks if user liked by checking sorted set for user ID.
Interface is an abstraction of behavior.
| |
Abstract classes usually serve as base classes, like Person, Animal. Because different subclasses may have different method bodies for certain methods, these methods are placed as abstract methods in the abstract class.
An interface is an abstraction of behavior.
Interface.method(). | |
Abstract classes typically serve as base classes, such as Person, Animal. Because the body of certain methods may differ among various subclasses, these methods are placed as abstract methods in the abstract class.
The definition of a functional interface is that it must contain only one abstract method. It can have many static or default methods (with implementations), but there must be only one abstract method.
This abstract method represents that it can perform some behavior, but what specifically it does is determined by the caller through overriding this abstract method. This can be accomplished through anonymous inner classes or lambda expressions.
A functional interface is defined as an interface that must contain only one abstract method. It can have many static or default methods (with implementations), but there must be only one abstract method.
This abstract method indicates that it can perform a certain behavior, but the specific action is determined by the caller through overriding this abstract method. This can be achieved using anonymous inner classes or lambda expressions.
You can think of a lock as a mutex. It’s just a variable with two states: available/acquired. Each thread can acquire and release it. Reference: OSTEP-Locks
Concurrent requests can cause inconsistency regardless of update order (cache first or database first).
Use Cache Aside strategy: cache only updated during read operations.
Thread A reading, Thread B updating simultaneously:
Disadvantages of database auto-increment IDs:

| |
keyPrefix represents object type, e.g., coupon order.
JMeter Usage Installation path: /Users/ruoke/Documents/devTools/apache-jmeter-5.6.3/bin
In this path, run the sh jmeter command to start JMeter.