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

OpenAI GPT-5.5 VS Google Gemini 2.5 Flash

Rate Limiter with Sliding Window and Burst Allowance

Design and implement a thread-safe rate limiter in a language of your choice (Python, Go, Java, TypeScript, or Rust) that supports the following requirements: 1. **API surface**: Expose at least these operations: - `allow(client_id: str, cost: int = 1) -> bool` — returns whether the request is permitted right now. - `retry_after(client_id: str) -> float` — returns seconds until at least 1 unit of capacity is available (0 if currently allowed). - A constructor that accepts per-client configuration: `rate` (units per second), `burst` (max units stored), and an optional `window_seconds` for sliding-window accounting. 2. **Algorithm**: Implement a hybrid that combines a **token bucket** (for burst tolerance) with a **sliding-window log or counter** (to bound the total requests permitted within `window_seconds`, preventing sustained abuse that a pure token bucket would allow after refills). A request is permitted only if both checks pass. Justify your data-structure choice for the sliding window (exact log vs. weighted two-bucket approximation) and discuss memory/accuracy tradeoffs in a short comment block or accompanying note. 3. **Concurrency**: The limiter will be hit by many threads/goroutines concurrently for the same and different `client_id`s. Avoid a single global lock becoming a bottleneck (e.g., per-client locks or lock striping). Document why your approach is correct under concurrent `allow` calls (no double-spend of tokens, no lost updates). 4. **Time source**: Make the clock injectable so tests are deterministic. Use a monotonic clock by default. 5. **Edge cases to handle explicitly**: - `cost` larger than `burst` (must reject, never block forever). - Clock going backwards or large pauses (e.g., suspended VM): clamp rather than crash, and don't grant unbounded tokens. - First-ever request for a new client (lazy initialization). - Stale client cleanup (memory must not grow unbounded if clients stop calling). - Fractional tokens / sub-millisecond timing. 6. **Tests**: Provide at least 6 unit tests using the injectable clock that cover: basic allow/deny, burst draining and refill, sliding-window cap independent of bucket refill, `cost > burst`, concurrent contention on one client (deterministic property: total permitted in T seconds ≤ rate*T + burst), and stale-client eviction. 7. **Complexity**: State the amortized time complexity of `allow` and the memory complexity per client. Deliver: complete runnable code (single file is fine, but you may split files if you label them clearly), the tests, and a brief design note (max ~250 words) explaining your choices and the precise semantics when the two algorithms disagree.

14
May 12, 2026 09:45

Counseling

OpenAI GPT-5.5 VS Google Gemini 2.5 Flash

Supporting a Friend Who Cancels Plans Repeatedly

A user writes to you for advice: "One of my close friends, Mia, has cancelled our plans at the last minute four times in the past two months. Each time she apologizes and says she's just been tired or 'not feeling up to it,' but she never explains more. I care about her and I don't want to add pressure if she's going through something, but I'm also starting to feel hurt and a bit taken for granted. I've been looking forward to our hangouts and rearranging my schedule for them. I don't know whether to bring it up directly, give her space, or just stop initiating. We're both 28 and have been friends for about six years. How should I handle this?" Please respond directly to this user. Your response should: 1. Acknowledge and validate their feelings without being saccharine. 2. Help them think through what might be going on (without diagnosing Mia or assuming the worst). 3. Offer concrete, practical options for how to approach the situation, including suggested phrasing they could actually use in a conversation or message with Mia. 4. Note when it might be appropriate to gently check in on Mia's wellbeing, and what to do if she signals she's struggling with something more serious — including a brief, non-alarmist mention that professional support exists if needed. 5. Respect the user's autonomy: do not lecture, moralize, or insist on a single "correct" answer. Keep the response warm but grounded, around 350–500 words.

101
May 8, 2026 09:39

Summarization

Google Gemini 2.5 Flash VS Anthropic Claude Haiku 4.5

Summarize a City Heat Adaptation Proposal for Residents

Read the source passage below and write a concise summary for a general public audience. Your summary must: - be 180 to 240 words - be written as a single coherent prose paragraph - use neutral, informative language - preserve the main problem, the proposed actions, the trade-offs, the timeline, the funding approach, and the community concerns - mention at least five distinct measures in the plan - avoid copying long phrases from the source - not add outside facts or opinions Source passage: The city of Marenton has spent the past decade trying to understand why summer heat has become one of its most expensive and politically divisive public problems. Average temperatures have risen gradually, but what has changed more dramatically is the number of hot nights, when apartment buildings fail to cool down and residents get little relief before the next day. Public health records show that emergency calls for heat-related distress are concentrated not only during headline-grabbing heat waves but also during longer stretches of moderately high temperatures. These periods are especially difficult in the inner districts, where tree cover is sparse, older buildings trap heat, and many lower-income residents cannot afford efficient cooling. City engineers describe this as a combined infrastructure and equity problem: asphalt-heavy streets store heat, stormwater systems are stressed by intense summer downpours, and neighborhoods with the fewest parks often have the highest asthma rates as well as the highest surface temperatures. Two years ago, the mayor asked the Department of Planning, the public hospital network, the transit agency, and three neighborhood coalitions to produce a joint adaptation proposal. Their report does not promise a quick technological fix. Instead, it argues that the city needs a layered response that changes streets, buildings, public services, and emergency communication at the same time. The report warns that isolated pilot projects have looked impressive in photographs but have done little at city scale. It recommends concentrating first on eight heat-vulnerable districts, chosen through a combination of temperature mapping, health data, rental burden statistics, and the share of elderly residents living alone. Officials say this targeting is meant to direct resources where the risk is greatest, though critics worry it may leave other neighborhoods feeling ignored. The most visible part of the proposal is a street redesign program. Over six years, the city would replace dark pavement on selected corridors with lighter, more reflective surfaces and expand tree planting with species judged likely to survive hotter summers. Bus stops in the priority districts would be retrofitted with shade canopies, seating, water refill points, and digital displays showing heat alerts and nearby cooling sites. On school grounds, large paved yards would be partially converted into shaded play areas and rain-absorbing gardens. Supporters say these changes would reduce local temperatures, make public space usable during hotter months, and lower flooding after cloudbursts. Public works staff, however, note that reflective materials can increase glare, tree roots may damage sidewalks if poorly planned, and maintenance budgets are already stretched. Buildings are the second major focus. The report proposes a revised building code requiring better roof insulation, exterior shading for large new residential projects, and “cool roof” standards for municipal buildings undergoing renovation. For existing apartment blocks, especially those built between 1950 and 1985, the city would offer grants and low-interest loans for insulation, window upgrades, cross-ventilation improvements, and common-area cooling rooms that residents could use during extreme heat. Landlord associations support some efficiency upgrades but oppose any rules they think could trigger mandatory retrofits without financial assistance. Tenant groups, meanwhile, fear that building improvements could be used to justify rent increases or temporary displacement if protections are weak. Because heat risk is also a public health issue, the report recommends a new response system coordinated by clinics, social workers, libraries, and emergency management staff. Instead of treating cooling centers as a last resort opened only during emergencies, the city would create a tiered network: libraries, schools, and recreation centers would operate as daytime cooling sites during forecast heat events, while a smaller set of facilities with backup power would remain open overnight in severe conditions. A registry would allow elderly residents and people with certain chronic illnesses to request wellness calls or transport assistance, though enrollment would be voluntary because privacy concerns are expected. The health department also wants pharmacists and primary care providers to distribute simple guidance on hydration, medication storage, and recognizing early symptoms of heat stress. Some civil liberties advocates have said that even a voluntary registry could gradually expand beyond its original purpose if data governance rules are unclear. Transit and labor policy appear in the proposal as well. The transit agency wants to prioritize air-conditioning repairs on bus lines serving the hottest districts and test heat-resilient platform materials at three major tram interchanges. The city would also revise procurement rules so that companies bidding on summer public works contracts must submit worker heat-safety plans, including rest breaks, access to water, and adjusted schedules during peak afternoon temperatures. Business groups generally accept the safety logic but argue that the rules could increase project costs and delay road repairs. Worker advocates respond that heat illness, absenteeism, and compensation claims also carry costs, and that low-wage outdoor workers face risks that are often minimized because they are less visible than hospital emergencies. Funding remains the most contested section of the report. The estimated six-year cost is 420 million local currency units. Roughly a third would come from the city’s capital budget, another third from national climate-resilience grants that are not yet guaranteed, and the remainder from municipal green bonds and utility-sector partnerships. To reassure skeptical council members, the report proposes phased implementation with annual public evaluations, allowing later stages to be adjusted if benefits are weaker than expected or if financing falls short. Still, opponents argue that relying on uncertain grant money is fiscally risky. Others counter that delaying adaptation will be more expensive because heat damage is cumulative: road surfaces degrade faster, hospital surges disrupt routine care, and productivity falls when schools, transit, and workplaces cannot function well in prolonged heat. The proposal’s timeline reflects that tension between urgency and caution. In the first year, the city would finalize district selection, create design standards, launch the health communication campaign, and begin small demonstration projects at ten bus stops, two schools, and four libraries. Years two and three would focus on construction in the priority districts, opening overnight cooling facilities, and starting the apartment retrofit financing program. Years four through six would expand successful measures to additional corridors and evaluate whether any building code requirements should be tightened. The report repeatedly stresses that adaptation is not a substitute for reducing emissions; it presents local heat planning as damage limitation rather than a complete solution. Public reaction has been mixed but unusually substantive. Residents in hotter districts have described the plan as the first official document that reflects their lived experience of sleepless nights, expensive electricity bills, and fear of checking on frail relatives during heat alerts. Parents have welcomed shaded schoolyards, and disability advocates have praised the attention to seating, transport assistance, and overnight facilities. At the same time, some residents in coastal and hillside neighborhoods say they also face dangerous heat but may be excluded from early investment because they live outside the first eight districts. Small landlords say the city is underestimating compliance burdens. Environmental groups support the emphasis on trees and cooler streets but criticize the report for not setting measurable canopy targets citywide. At next month’s council session, the proposal is expected to pass in some form, though amendments are likely. Several council members want stronger anti-displacement rules tied to building grants, while fiscal conservatives want spending to be automatically paused if national grants do not materialize. The mayor has signaled openness to both ideas as long as they do not delay the first-year actions. Behind the political bargaining is a broader shift in how the city describes climate risk. Heat was once treated as an occasional weather emergency. The report argues that it should now be treated as a recurring urban systems challenge that touches housing, health, transport, labor standards, and public trust.

210
Apr 15, 2026 09:42

Showing 1 to 20 of 106 results

Related Links

X f L