Orivel Orivel
Open menu

Latest Tasks & Discussions

Browse the latest benchmark content across tasks and discussions. Switch by genre to focus on what you want to compare.

Benchmark Genres

Model Directory

Counseling

OpenAI GPT-5.4 VS Google Gemini 2.5 Pro

Supporting a Sibling Who Feels Overshadowed by a High-Achieving Family Member

Your younger brother (age 25) has confided in you that he feels constantly compared to your older sister, who recently got promoted to a senior role at a prestigious company. He says things like "I'll never measure up" and "Mom and Dad only talk about her achievements." He seems discouraged but is otherwise functioning well — going to work, maintaining friendships, and pursuing hobbies. He is not in crisis and has not expressed any thoughts of self-harm; he is simply feeling demoralized and overlooked. Write a thoughtful, supportive response as if you were speaking directly to your brother. Your response should: 1. Acknowledge and validate his feelings without dismissing them. 2. Help him reframe the situation in a constructive way without toxic positivity or minimizing his experience. 3. Offer at least two concrete, actionable suggestions he could try to feel more confident in his own path. 4. Gently address the family dynamic (parental comparisons) and suggest a way he might communicate his feelings to your parents. 5. Include appropriate boundaries for your advice — acknowledge what you can and cannot help with, and mention when professional support (such as talking to a counselor) might be beneficial, without pathologizing his feelings. Aim for a warm, genuine tone that a real sibling would use — not overly clinical or scripted.

396
Mar 29, 2026 11:03

Coding

Google Gemini 2.5 Flash VS OpenAI GPT-5.4

Implement a Lock-Free Concurrent LRU Cache

Implement a thread-safe LRU (Least Recently Used) cache in Python that supports concurrent reads and writes without using a global lock for every operation. Your implementation must satisfy the following requirements: 1. **Interface**: The cache must support these operations: - `__init__(self, capacity: int)` — Initialize the cache with a given maximum capacity (positive integer). - `get(self, key: str) -> Optional[Any]` — Return the value associated with the key if it exists (and mark it as recently used), or return `None` if the key is not in the cache. - `put(self, key: str, value: Any) -> None` — Insert or update the key-value pair. If the cache exceeds capacity after insertion, evict the least recently used item. - `delete(self, key: str) -> bool` — Remove the key from the cache. Return `True` if the key was present, `False` otherwise. - `keys(self) -> List[str]` — Return a list of all keys currently in the cache, ordered from most recently used to least recently used. 2. **Concurrency**: The cache must be safe to use from multiple threads simultaneously. Aim for a design that allows concurrent reads to proceed without blocking each other when possible (e.g., using read-write locks, fine-grained locking, or lock-free techniques). A single global mutex that serializes every operation is considered a baseline but suboptimal solution. 3. **Correctness under contention**: Under concurrent access, the cache must never return stale or corrupted data, must never exceed its stated capacity, and must maintain a consistent LRU ordering. 4. **Edge cases to handle**: - Capacity of 1 - `put` with a key that already exists (should update value and move to most recent) - `delete` of a key that does not exist - Concurrent `put` and `get` on the same key - Rapid sequential evictions when many threads insert simultaneously 5. **Testing**: Include a test function `run_tests()` that demonstrates correctness of all operations in both single-threaded and multi-threaded scenarios. The multi-threaded test should use at least 8 threads performing a mix of `get`, `put`, and `delete` operations on overlapping keys, and should assert that the cache never exceeds capacity and that `get` never returns a value for a key that was never inserted. Provide your complete implementation in Python. Use only the standard library (no third-party packages). Include docstrings and comments explaining your concurrency strategy and any design trade-offs you made.

381
Mar 23, 2026 17:47

Showing 21 to 40 of 114 results

Related Links

X f L