Ctrl K
Backend · Mid-level · System design

Design a URL shortener: a user submits a long URL and gets a short one, and following the short link redirects to the original.

~10 min by voice

How to approach it

This checks whether you can go through the full system design cycle on a simple problem: clarify requirements and load, choose a scheme for generating unique codes, storage and a cache for a read-heavy profile, and not forget the operational details: 301/302, analytics and abuse.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsСпроектируйте сервис переводов по номеру телефона между клиентами банка: от нажатия кнопки «Перевести» до зачисления денег получателю. SeniorСпроектируйте сервис лимитов: у клиента есть дневные и месячные лимиты на переводы и снятия наличных, и каждую операцию нужно проверить до проведения. SeniorDesign a search bar with autocomplete for a large marketplace: from typing a character to displaying the suggestions. SeniorПеред базой стоит кеш в Redis с карточками товаров, TTL — пять минут. Расскажите, как бы вы организовали чтение и обновление, как кеш может разойтись с базой, и что произойдёт, когда истечёт TTL у очень популярного ключа. Mid-levelWrite a memoizeAsync function. It takes an async function of a string key and a cache time to live in milliseconds, and returns a wrapper: a repeated call with the same key doesn't go to the network, concurrent calls share a single request, and errors aren't cached. Senior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~10 min