🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Design a URL Shortener: all 10 questions

Quiz: Design a URL Shortener · Question 8 of 10

What is a drawback of creating short codes by hashing the long URL and keeping 7 characters?

What is a drawback of creating short codes by hashing the long URL and keeping 7 characters?

  1. A.Two different URLs can produce the same code, so collisions must be checked and handled
  2. B.Hashes cannot be converted to text
  3. C.It needs a central counter
  4. D.It only works for HTTPS links
Answer & explanation

Correct answer: Two different URLs can produce the same code, so collisions must be checked and handled

Truncating a hash makes collisions possible.

Can you get the rest right without peeking?

Take the timed Quiz: Design a URL Shortener quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →