chrisjacksonn/interview-sim / skills/sim
sim
VerifiedRun a timed coding assessment simulation in the terminal. Use for OA practice, GCA or ICA mocks, mock interviews, pairing rounds, take-homes, and pasted job postings.
questions/gca/dup-window/problem.md
View on GitHub# Repeat Alerts
An alerting system fires alerts, each with a name and a timestamp. An alert is
**noisy** if the same name fires twice within `window` minutes of each other,
counting the gap inclusively.
Write `solve(alerts, window)` returning the sorted list of noisy alert names.
`alerts` is a list of `(name, timestamp)` pairs in no particular order.
## Examples
```python
solve([("disk", 1), ("cpu", 3), ("disk", 4)], 5)
# ["disk"]
# The two disk alerts are 3 apart, within the window of 5.
solve([("disk", 1), ("disk", 40)], 5)
# []
solve([("a", 1), ("a", 6), ("b", 2), ("b", 3)], 5)
# ["a", "b"]
# Exactly 5 apart counts, because the gap is inclusive.
solve([], 10)
# []
```
## Constraints
- `0 <= len(alerts) <= 200_000`
- `window` may be zero or negative, in which case only alerts sharing a
timestamp exactly are noisy, and a negative window makes nothing noisy.
- Names are case-sensitive. Timestamps are integers and may be negative.
- The input you are given must be left as it was. Do not modify or consume it.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |