2025-04-05 03:48:18 +02:00

12 lines
404 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Cache with Expiration
Implement a basic in-memory cache where each key can have an optional time-to-live (TTL).
Keys should expire automatically after their TTL passes.
The cache should support:
- `Set(key, value, ttl)` — stores a key with a given TTL (0 = no expiration)
- `Get(key)` — returns value if key exists and hasnt expired
- `Delete(key)` — deletes the key
## Tags
`Concurrency`