HardDesign: URL Shortener (TinyURL)

Two users simultaneously request a custom alias 'mylink'. How do you handle this safely?

Tests your understanding of this concept.

Answer Options

AUse application-level mutex
BUse database unique constraint + catch exception
CUse Redis SETNX
DBoth B and C are valid approaches

Want to see the correct answer?

Get the answer with a detailed explanation, plus practice 22+ more Design: URL Shortener (TinyURL) questions with adaptive quizzes and timed interviews.

See the Answer on Guru Sishya →

This question is from the Design: URL Shortener (TinyURL) topic (System Design Cases).

More Design: URL Shortener (TinyURL) Questions