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

Explanation

OpenAI GPT-5.4 VS Google Gemini 2.5 Flash

Explain Database Indexing to a Junior Developer

You are a senior software engineer mentoring a junior developer who has about six months of experience writing basic CRUD applications with a relational database (e.g., PostgreSQL or MySQL). They have noticed that some of their queries are slow and have heard that indexes can help, but they do not understand how indexes work or when to use them. Write a clear, teaching-oriented explanation of database indexing for this audience. Your explanation should cover: 1. What a database index is and why it exists, using an intuitive analogy. 2. How a B-tree index works at a conceptual level (you do not need to go into node-splitting details, but the reader should understand the basic structure and why it speeds up lookups). 3. The trade-offs of adding indexes: when they help, when they hurt, and the costs involved (storage, write performance, maintenance). 4. Practical guidance on deciding which columns to index, including at least two concrete examples of queries and whether an index would help. 5. A brief mention of at least one other index type beyond B-tree (e.g., hash, GIN, GiST) and when it might be preferred. Aim for a tone that is encouraging and accessible without being condescending. Use concrete examples where possible. The explanation should be thorough enough that the junior developer could confidently decide whether to add an index to a table after reading it.

71
Mar 18, 2026 23:09

System Design

Google Gemini 2.5 Pro VS OpenAI GPT-5 mini

Design a URL Shortening Service at Scale

You are tasked with designing a URL shortening service (similar to bit.ly or tinyurl.com) that must handle the following constraints: 1. The service must support 100 million new URL shortenings per month. 2. The read-to-write ratio is 100:1 (i.e., 10 billion redirects per month). 3. Shortened URLs must be at most 7 characters long (alphanumeric). 4. The system must guarantee that a shortened URL, once created, never expires unless explicitly deleted by the user. 5. Redirect latency (from receiving the request to issuing the HTTP 301/302) must be under 10 milliseconds at the 99th percentile. 6. The system must remain available even if an entire data center goes offline. 7. The service must support an optional analytics dashboard showing click counts, geographic distribution, and referrer data per shortened URL, but analytics must not degrade redirect performance. Provide a comprehensive system design that addresses: A. High-level architecture: Describe the major components and how they interact. B. URL generation strategy: How you generate unique short codes, why you chose that approach, and how you handle collisions. C. Data model and storage: What databases or storage systems you use and why. Include schema considerations. D. Read path optimization: How you achieve the latency requirement for redirects at the given scale. E. Write path: How new URLs are created and persisted reliably. F. Scaling strategy: How the system scales horizontally to handle growth. G. Reliability and fault tolerance: How you handle data center failures, replication, and failover. H. Analytics pipeline: How you collect, process, and serve analytics data without impacting redirect performance. I. Key trade-offs: Identify at least three significant trade-offs you made in your design and justify each one. Be specific about technologies, protocols, and numerical estimates where relevant (e.g., storage calculations, QPS estimates, cache sizes).

59
Mar 18, 2026 22:59

Coding

Google Gemini 2.5 Pro VS Anthropic Claude Sonnet 4.6

Implement a Versioned Key-Value Store with Historical Queries

Write code that implements an in-memory versioned key-value store supporting historical reads. The store begins empty and processes a sequence of commands. Each successful mutating command creates exactly one new global version number, starting from 1. Read-only commands must not create a version. Keys and values are case-sensitive strings without spaces. Versions are positive integers. Commands: SET key value Create or overwrite key with value. DELETE key Remove key if it exists. GET key Return the current value for key, or NULL if the key does not exist. GET_VERSION key version Return the value associated with key immediately after the specified global version was created, or NULL if the key did not exist at that version. If version is greater than the latest existing version, treat it as invalid and return INVALID_VERSION. HISTORY key Return all historical states for the key in increasing version order, including deletions, formatted as version:value pairs separated by commas. Use NULL for deleted or absent-after-mutation states. If the key has never been affected by any mutating command, return EMPTY. Input format: The first line contains an integer N, the number of commands. The next N lines each contain one command. Output format: For every GET, GET_VERSION, and HISTORY command, print one line with the result. Behavior details and edge cases: - Every SET always creates a new version, even if the value is unchanged. - Every DELETE always creates a new version, even if the key does not exist. - Versions are global across all keys, not per key. - HISTORY for a key should include only versions where that key was directly affected by SET or DELETE. - If a key was deleted and later set again, both events must appear in HISTORY. - Efficiency matters: assume up to 200000 commands, with many historical queries. Your solution should read from standard input and write to standard output. Include the full working program in one file. You may use any mainstream programming language, but the code should be complete and executable as written.

66
Mar 18, 2026 22:33

Coding

Google Gemini 2.5 Flash VS OpenAI GPT-5.2

Implement a Lock-Free Concurrent Skip List with Range Queries

Design and implement a concurrent skip list data structure in a language of your choice (C++, Java, Rust, Go, or Python) that supports the following operations: 1. **insert(key, value)** – Insert a key-value pair. If the key already exists, update the value atomically. Returns true if a new key was inserted, false if updated. 2. **remove(key)** – Logically delete the key-value pair. Returns true if the key was found and removed, false otherwise. 3. **find(key)** – Return the value associated with the key, or indicate absence. 4. **range_query(low, high)** – Return all key-value pairs where low <= key <= high, as a list sorted by key. The result must be a consistent snapshot: it should not include keys that were never simultaneously present during the operation's execution. 5. **size()** – Return the approximate number of active (non-deleted) elements. Requirements and constraints: - The skip list must be safe for concurrent use by multiple threads performing any mix of the above operations simultaneously, without a single global lock. You may use fine-grained locking, lock-free techniques (CAS), or a combination. - Lazy deletion is acceptable: nodes can be logically marked as deleted before physical removal. - The probabilistic level generation should use a standard geometric distribution with p=0.5 and a maximum level of 32. - Keys are 64-bit integers; values are strings. - Include proper memory safety considerations. If using a language without garbage collection, explain or implement your reclamation strategy (e.g., epoch-based reclamation, hazard pointers). Deliverables: 1. Complete, compilable/runnable source code with comments explaining your concurrency strategy. 2. A test or demonstration that launches multiple threads performing concurrent inserts, deletes, finds, and range queries, and validates correctness (e.g., no lost updates, no phantom reads in range queries, no crashes). 3. A brief analysis section (as comments or a docstring) discussing: - The linearizability (or snapshot isolation) guarantees your implementation provides. - The expected time complexity of each operation. - Known limitations or potential ABA issues and how you address them. Your solution will be evaluated on correctness under concurrency, code clarity, robustness of the concurrency strategy, quality of the range query snapshot mechanism, and thoroughness of the analysis.

69 1
Mar 18, 2026 22:05

Education Q&A

Google Gemini 2.5 Pro VS OpenAI GPT-5.4

Explain the Paradox of the Banach–Tarski Theorem and Its Educational Implications

The Banach–Tarski paradox states that a solid ball in three-dimensional space can be decomposed into a finite number of non-overlapping pieces, which can then be reassembled (using only rotations and translations) into two solid balls, each identical in size to the original. Answer the following in a structured essay: 1. State precisely how many pieces are needed in the standard proof of the Banach–Tarski theorem (give the exact minimum number established in the literature). 2. Explain why this result does not contradict physical reality or conservation of mass. In your explanation, identify the specific mathematical property that the pieces must have which prevents them from being physically realizable, and name the axiom of set theory upon which the proof fundamentally depends. 3. Describe how the concept of "measure" (in the sense of Lebesgue measure) relates to this paradox. Why can we not simply say the volumes must add up? 4. Discuss how this theorem is used in mathematics education at the advanced undergraduate or graduate level. What key lessons about the foundations of mathematics—specifically regarding the Axiom of Choice, non-measurable sets, and the limits of geometric intuition—does it illustrate? Suggest a pedagogical approach for introducing this topic to students encountering it for the first time. Your essay should be rigorous yet accessible, demonstrating both mathematical precision and educational insight.

83
Mar 18, 2026 20:40

Showing 121 to 140 of 333 results

Related Links

X f L