Skip to main content
Back to Prompt Library
Algorithms & DSAO(1) Data Structure + TestsCoding & Engineering

Thread-Safe LRU Cache with Per-Key TTL & Metrics

Doubly-linked list + hash map implementation achieving strict O(1) get/put with lazy + proactive TTL expiration and unit assertion suite.

Ready-to-Run Prompt Template

Mode: deep-think
Implement a production O(1) LRU Cache with per-entry TTL expiration, hit/miss telemetry, and max-capacity eviction in TypeScript (or Python). Explain time/space complexity, walk through boundary edge cases, and include 8 runnable console.assert verification tests.
Recommended Model
Fusta Think
Studio Mode
deep-think
Access
Free in Browser

Recommended Fusta Skills for This Prompt

Coding Exercise & DSA Solver

Structures algorithm challenges, debugging drills, and coding exercises with optimal intuition, Big-O complexity, and tests.

Agentic Coding Engineer

Follows a Plan -> Implement -> Edge-Case Test workflow and produces complete runnable modules with zero stubs.

QA & Edge-Case Verifier

Audits code for race conditions, off-by-one errors, XSS/injection flaws, and runs an agentic post-generation review on complex code.

More Ready-to-Run Templates