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

Coding

Google Gemini 2.5 Flash-Lite VS OpenAI GPT-5.2

Implement a Lock-Free Concurrent LRU Cache

Design and 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. The cache has a fixed maximum capacity specified at construction time. 2. It supports three operations: - get(key): Returns the value associated with the key, or None if the key is not present. Accessing a key should mark it as most recently used. - put(key, value): Inserts or updates the key-value pair. If the cache is at capacity and a new key is inserted, the least recently used entry must be evicted. - delete(key): Removes the key from the cache if present. Returns True if the key was found and removed, False otherwise. 3. The cache must be safe to use from multiple threads simultaneously. Concurrent get operations on different keys should not block each other. You should minimize contention — a single coarse-grained lock around everything is not acceptable. 4. The eviction policy must be strictly LRU: the entry that was accessed (via get or put) least recently must be the one evicted. 5. Handle edge cases: capacity of 1, rapid concurrent puts that trigger evictions, interleaved get/put/delete on the same key from different threads, and zero or negative capacity (raise ValueError). Provide your complete implementation as a single Python module. Include a brief explanation of your concurrency strategy and why it preserves correctness. Also include a short demonstration (in a main block or test function) that spawns multiple threads performing mixed get/put/delete operations and asserts that the cache never exceeds its capacity and that no data corruption occurs.

60
Mar 19, 2026 11:51

System Design

Anthropic Claude Haiku 4.5 VS Google Gemini 2.5 Flash-Lite

Design a Real-Time Ride Matching Platform

Design the backend architecture for a ride-hailing platform that matches riders with nearby drivers in real time across multiple cities. Your design should support these product requirements: - Riders can request a trip by sending pickup and destination locations. - Nearby available drivers should receive the request quickly, and one driver can accept it. - The system must prevent double-booking of drivers. - Riders and drivers should see live trip status updates such as requested, accepted, arrived, in progress, and completed. - The platform should provide an estimated fare and estimated pickup time before confirmation. - Trip history should be available to both riders and drivers. Constraints and assumptions: - 8 million daily ride requests. - Peak load is 25 times the average request rate during commuting windows. - Operates in 40 cities, with uneven traffic distribution. - Location updates from active drivers arrive every 3 seconds. - Acceptable rider-facing latency for initial driver matching is under 2 seconds at p95. - Trip status updates should usually appear within 1 second. - The system should remain available during a regional service outage affecting one data center. - Exact payment processing details are out of scope, but trip records must be durable for later billing. - Privacy, security, and regulatory concerns may be mentioned briefly, but the main focus is architecture and scaling. In your answer, describe: - The main services or components and their responsibilities. - The data flow from ride request to driver assignment to trip completion. - How you would store and query driver locations efficiently. - How you would handle scaling for peak traffic and hotspot cities. - How you would ensure reliability, fault tolerance, and data consistency where it matters. - Key trade-offs in your design, including any places where you prefer eventual consistency over strong consistency, or vice versa. You do not need to provide exact cloud vendor products. A clear architecture and reasoning-focused design is preferred over exhaustive implementation detail.

61
Mar 19, 2026 07:43

Summarization

Google Gemini 2.5 Flash-Lite VS OpenAI GPT-5.4

Summarize a Passage on the History and Science of Urban Heat Islands

Read the following passage carefully and write a summary of approximately 200 to 250 words. Your summary must capture all of the key points listed after the passage, maintain a neutral and informative tone, and must not introduce any information not present in the original text. SOURCE PASSAGE: Urban heat islands (UHIs) are metropolitan areas that experience significantly higher temperatures than their surrounding rural counterparts. This phenomenon, first documented by amateur meteorologist Luke Howard in the early nineteenth century when he observed that central London was consistently warmer than its outskirts, has become one of the most studied aspects of urban climatology. Howard's pioneering observations, published in his 1818 work "The Climate of London," laid the groundwork for more than two centuries of research into how cities alter their local climates. Today, with more than half of the world's population living in urban areas and projections suggesting that figure will rise to nearly 70 percent by 2050, understanding and mitigating the urban heat island effect has taken on unprecedented urgency. The mechanisms behind urban heat islands are multifaceted and interconnected. At the most fundamental level, cities replace natural vegetation and permeable soil with impervious surfaces such as asphalt, concrete, and steel. These materials have markedly different thermal properties compared to natural landscapes. Dark-colored asphalt, for example, can absorb up to 95 percent of incoming solar radiation, whereas a grassy field might reflect 20 to 30 percent of that energy back into the atmosphere. Concrete and brick structures similarly absorb and store heat during the day, then slowly release it at night, which is why urban areas often experience their greatest temperature differential from rural areas after sunset rather than during peak daytime hours. This nocturnal warming effect is particularly consequential for public health, as it deprives residents of the cooler nighttime temperatures that allow the human body to recover from daytime heat stress. Beyond surface materials, the three-dimensional geometry of cities plays a critical role in amplifying the heat island effect. Tall buildings arranged along narrow streets create what climatologists call "urban canyons." These canyons trap both solar radiation and longwave thermal radiation through multiple reflections between building facades and the street surface below. The sky view factor, a measure of how much open sky is visible from a given point on the ground, is significantly reduced in dense urban cores. A lower sky view factor means that less longwave radiation can escape to the upper atmosphere at night, effectively insulating the city and keeping temperatures elevated. Wind patterns are also disrupted by the built environment; buildings create turbulence and reduce average wind speeds at street level, limiting the convective cooling that would otherwise help dissipate accumulated heat. Additionally, the waste heat generated by vehicles, air conditioning systems, industrial processes, and even the metabolic heat of millions of human bodies contributes a non-trivial amount of thermal energy to the urban atmosphere, further compounding the problem. The consequences of urban heat islands extend well beyond mere discomfort. From a public health perspective, elevated urban temperatures are directly linked to increased rates of heat-related illness and mortality. During the catastrophic European heat wave of 2003, which killed an estimated 70,000 people, mortality rates were disproportionately concentrated in dense urban centers such as Paris, where nighttime temperatures remained dangerously high. Vulnerable populations, including the elderly, young children, outdoor workers, and those with pre-existing cardiovascular or respiratory conditions, bear the heaviest burden. Heat islands also exacerbate air quality problems by accelerating the chemical reactions that produce ground-level ozone, a harmful pollutant that triggers asthma attacks and other respiratory ailments. Economically, the increased demand for air conditioning during heat events strains electrical grids, raises energy costs for households and businesses, and increases greenhouse gas emissions from power generation, creating a feedback loop that contributes to broader climate change. Researchers and urban planners have developed a range of strategies to combat the urban heat island effect. One of the most widely promoted approaches is the expansion of urban green spaces, including parks, street trees, green roofs, and vertical gardens. Vegetation cools the surrounding air through evapotranspiration, the process by which plants release water vapor from their leaves, absorbing thermal energy in the process. Studies have shown that a mature tree can have a cooling effect equivalent to ten room-sized air conditioners operating for twenty hours a day. Green roofs, which involve growing vegetation on building rooftops, not only reduce rooftop surface temperatures by as much as 30 to 40 degrees Celsius compared to conventional dark roofs but also provide insulation that reduces the energy needed to cool the building below. Another effective strategy involves the use of cool roofs and cool pavements, which employ highly reflective materials or coatings to bounce solar radiation back into space rather than absorbing it. Cities such as Los Angeles have experimented with coating streets in a light-gray reflective sealant, reporting surface temperature reductions of up to 10 degrees Fahrenheit. Water-based cooling strategies, including the restoration of urban waterways, the installation of fountains, and the creation of permeable surfaces that allow rainwater to infiltrate and evaporate, offer additional pathways for reducing urban temperatures. Despite the availability of these mitigation strategies, implementation faces significant challenges. Retrofitting existing urban infrastructure is expensive, and the costs are often borne unevenly across communities. Research consistently shows that lower-income neighborhoods and communities of color tend to have fewer trees, more impervious surfaces, and higher ambient temperatures than wealthier, predominantly white neighborhoods within the same city. This environmental inequity means that those least able to afford air conditioning or medical care are often the most exposed to extreme heat. Addressing the urban heat island effect therefore requires not only technical solutions but also a commitment to environmental justice, ensuring that cooling interventions are prioritized in the communities that need them most. As climate change continues to push global temperatures upward, the intersection of urbanization, heat, and equity will remain one of the defining challenges of the twenty-first century. KEY POINTS YOUR SUMMARY MUST INCLUDE: 1. Definition of urban heat islands and their historical documentation by Luke Howard. 2. The role of impervious surfaces and building materials in absorbing and re-emitting heat, especially at night. 3. How urban canyon geometry and reduced sky view factor trap heat and limit cooling. 4. Public health consequences, including heat-related mortality and worsened air quality. 5. At least three specific mitigation strategies discussed in the passage. 6. The environmental justice dimension, noting that lower-income and minority communities are disproportionately affected.

50
Mar 19, 2026 02:29

System Design

Google Gemini 2.5 Flash-Lite VS Anthropic Claude Opus 4.6

Design a URL Shortening Service for Global Read Traffic

Design a production-ready URL shortening service similar to Bitly. The system must let users create short links that redirect to long URLs, support optional custom aliases, and provide basic click analytics per link. Assume these requirements and constraints: - 120 million new short links are created per month. - 1.5 billion redirects happen per month. - Read traffic is highly bursty during news events and marketing campaigns. - Redirect latency should be under 80 ms at the 95th percentile for users in North America and Europe. - Short links should continue working even if one data center goes down. - Analytics do not need to be perfectly real time, but should usually appear within 5 minutes. - Users may update the destination URL only within 10 minutes of creation. - Links can expire at an optional user-defined time. - Abuse prevention matters: the service should reduce obvious spam and malicious redirects, but deep security implementation details are not required. In your answer, provide: - A high-level architecture and main components. - The core data model and storage choices. - API design for creating links, resolving links, and reading analytics. - A scaling strategy for traffic growth and burst handling. - Reliability and disaster recovery approach. - Key trade-offs, including ID generation, database selection, caching, consistency, and analytics pipeline design. - A brief note on how you would monitor the system and detect failures.

69
Mar 16, 2026 04:45

Showing 21 to 40 of 75 results

Related Links

X f L