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

Anthropic Claude Sonnet 5 VS OpenAI GPT-5.6

Web Server Log Analyzer

Write a Python function analyze_logs(log_data) that takes a multi-line string containing web server log entries. The function should parse these logs, perform an analysis, and return a dictionary summarizing the results. Each valid log line follows this format: [TIMESTAMP] LEVEL IP_ADDRESS "REQUEST_METHOD /path" RESPONSE_CODE BYTES_SENT Example of a valid line: [2023-10-27T10:00:00Z] INFO 192.168.1.1 "GET /index.html" 200 1543 Your function should: Parse only the valid log lines, gracefully ignoring any malformed or empty lines. Calculate the following metrics: total_requests: The total count of valid log entries. error_rate: The percentage of requests with a LEVEL of ERROR, rounded to two decimal places. top_3_ips: A list of tuples, where each tuple contains an IP address and its request count, for the top 3 most frequent IPs. The list should be sorted in descending order of request count. busiest_hour: The hour of the day (an integer from 0 to 23) that had the most requests. The timestamp is in ISO 8601 format (UTC). Return a dictionary with keys total_requests, error_rate, top_3_ips, and busiest_hour containing the calculated values. Handle the following edge cases: If the input string log_data is empty, return a dictionary with zeroed or empty values as appropriate (e.g., total_requests: 0, top_3_ips: []). If there are fewer than 3 unique IP addresses, the top_3_ips list should contain all unique IPs, sorted by count. If there is a tie for the busiest hour, returning any one of the tied hours is acceptable.

31
Jul 25, 2026 01:19

Coding

OpenAI GPT-5.6 VS Google Gemini 2.5 Pro

Rate Limiter with Sliding Window and Fair Multi-Tenant Quotas

Implement a reusable rate limiter library in a language of your choice (Python, Go, TypeScript, Java, or Rust) that enforces per-client request quotas using a sliding-window algorithm, plus a fair-sharing policy across multiple tenants. Functional requirements: Provide a class or module with a method such as allow(tenant_id, client_id, now_ms) that returns whether a request is permitted and, when denied, how many milliseconds until the next request would be allowed (retry_after_ms). Each client is limited to a maximum number of requests within a rolling time window (for example, 100 requests per 60,000 ms). Configuration must be adjustable per tenant. Implement a true sliding window (weighted or log-based), not a fixed calendar-bucket window, so that bursts across bucket boundaries are handled correctly. Add a per-tenant global cap so that all clients of a tenant combined cannot exceed a tenant-level ceiling, and when the tenant is saturated, remaining capacity is shared fairly across active clients rather than being monopolized by one client. The limiter must be safe under concurrent access from multiple threads or async tasks. Memory must not grow unbounded: stale client state must be evicted or compacted over time. Deliverables: The complete implementation with clear public API and inline documentation of key decisions. A brief explanation (in comments or a short prose section) of the sliding-window algorithm you chose and its accuracy/memory tradeoffs. A test suite covering the core edge cases described below. Edge cases to address explicitly in code and tests: Requests exactly at the window boundary. A client that goes idle then returns after the window has fully elapsed. Concurrent requests racing against the same client counter. Clock going backwards or duplicate timestamps. Tenant saturation and fair redistribution among competing clients. Eviction of stale client state without dropping active clients. State any assumptions you make (single-process vs distributed, monotonic clock availability, etc.). If you assume a single process, briefly describe how the design would extend to a distributed deployment.

137
Jul 16, 2026 09:49

Related Links

X f L