Total Crowd Control Time With Overlapping Stuns and Tenacity

Last updated: November 29, 2026

Quick Overview

A champion is hit by crowd control effects, each with a start time, duration and type. Tenacity shortens stuns and slows by a percentage but does not affect knockups; return the total time the champion is under at least one effect.

Riot Games
Coding & Algorithms
Software Engineer
Riot Games
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Easy

0

0

0 solved


A champion is hit by crowd control effects, each with a start time, duration and type. Tenacity shortens stuns and slows by a percentage but does not affect knockups; return the total time the champion is under at least one effect.

A gameplay-flavored interval question of the kind a Riot technical screen might use for gameplay or combat systems engineers. The interviewer checks that you apply the tenacity rule before merging, merge overlapping intervals correctly, and do not double count overlap.

What the Interviewer Expects
  • Transform durations by type before any merging
  • Sort intervals by start and merge overlaps
  • Sum merged lengths without double counting
  • Handle zero-length effects and an empty list
  • Explain the floating point choice for durations
Key Topics to Cover
interval merging
sorting
game mechanics
simulation
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you return total time per effect type when a stun and a slow overlap?
  • What changes if a cleanse at time t removes all effects active at that moment?
  • How would you answer many queries of the form: was the champion disabled at time t?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Each effect is (start, duration, kind). Tenacity is a value in [0, 1); a stun of 2 seconds with 30% tenacity lasts 1.4 seconds. Knockups ignore tenacity, which matches the League rule that airborne ...

High-Level Design

Step one converts each effect into a concrete [start, end) interval after applying tenacity. Step two is classic interval union: sort by start, extend the current block while the next interval start...


Submit Your Answer
Markdown supported

Related Questions