← Render Interview Insights

Render·Software Engineer·Online Assessment (OA)·Intermediate

Intermediate
Apr 2026Remote

Summary

Render gave me a coding assessment that was basically a rate-limiting simulation problem on CSV data. Pretty niche, not your typical leetcode grind, and it took me a while to even wrap my head around what they were actually asking.

Questions Asked (1)

Q1

Given a CSV log of HTTP requests with timestamps, IPs, and hostnames, implement a sliding-window rate limiter with two rules: one capping total requests per IP across all hosts, and another capping requests per IP per hostname. A request is blocked if either limit is exceeded, and blocked requests still count toward both limits for future decisions. With specific parameter values provided, return the total number of blocked requests across the dataset.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This one messed me up for longer than I'd like to admit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the sliding-window semantics (e.g., fixed-size window vs. rolling window) and the exact parameter values, then design a data structure that tracks per-IP and per-IP-per-host request timestamps. Process the CSV chronologically, checking both limits before admitting each request, and count blocked requests while still recording them for future window calculations.

Pro tip: Explicitly state your assumptions about the window definition and tie-breaking, and mention that you would validate with edge cases like requests exactly at the window boundary and simultaneous timestamps—this shows attention to detail and prevents silent misinterpretation.

1. Clarify requirements and parameters

Ask about the sliding-window definition (e.g., fixed window vs. rolling window), the exact limit values, and whether timestamps are sorted. Confirm that blocked requests still count toward both limits.

2. Choose data structures

Use a hash map from IP to a deque of timestamps for the global per-IP limit, and a nested hash map from IP to hostname to a deque for the per-host limit. Deques allow efficient removal of expired timestamps.

3. Process requests chronologically

Iterate through the CSV rows in timestamp order. For each request, first evict timestamps outside the current window from both deques, then check if either deque size exceeds its limit.

4. Apply blocking logic and update state

If either limit is exceeded, increment the blocked counter. Regardless of the outcome, append the current timestamp to both deques to ensure blocked requests count toward future limits.

5. Return the total blocked count

After processing all rows, output the accumulated blocked count. Optionally, discuss time and space complexity and potential optimizations for large datasets.

Key Points to Mention

  • Sliding-window semantics: fixed window vs. rolling window and how it affects eviction.
  • Data structures: hash maps and deques for O(1) amortized operations per request.
  • Handling of blocked requests: they must be recorded in both limit trackers.
  • Edge cases: requests exactly at the window boundary, out-of-order timestamps, and multiple requests with the same timestamp.
  • Time and space complexity: O(N) time and O(N) space in the worst case.
  • Scalability: potential use of distributed rate limiting or approximate algorithms for large-scale systems.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.