Basics 1 Flashcards

Design URL Shortener (like Bit.ly) Design Pastebin Design Rate Limiter Design File Storage Service (like Dropbox) (57 cards)

1
Q

What is a URL shortener?

A

A service that converts long URLs into shorter, fixed-length URLs that redirect to the original address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the advantages of a URL shortener?

A

Improves readability, saves space, enables easy sharing, and can include tracking analytics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the disadvantages of a URL shortener?

A

Adds a redirection layer, introduces dependency on the shortener service, and may pose security risks if abused.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are best practices when designing a URL shortener?

A

Use a scalable key generation algorithm, avoid collisions, use caching for redirects, implement rate limiting, and support custom aliases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are common use cases for a URL shortener?

A

Social media posts, marketing campaigns, QR codes, and analytics tracking for links.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does a URL shortener impact system design?

A

Requires considerations around performance, availability, storage, key generation, analytics, and abuse prevention.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give an example of a URL shortening service.

A

Bitly, TinyURL, or Google’s deprecated goo.gl are well-known examples.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the architectural components of a URL shortener?

A

Typically includes an API layer, key generator, database (for mappings), redirect handler, cache layer, and monitoring/analytics pipeline.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are common key generation strategies?

A

Auto-incrementing IDs encoded in base62, UUIDs, or hash-based methods to ensure uniqueness and efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can performance be ensured in a URL shortener?

A

Use caching (e.g., Redis) for frequently accessed URLs, CDN for static redirection, and minimize DB lookups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can fault tolerance be added to a URL shortener?

A

Use redundant database replicas, load balancers, and retries; decouple components via message queues where needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How is monitoring and debugging handled in a URL shortener?

A

Track redirect latency, cache hit/miss rates, request volume, and error rates; use logs and distributed tracing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a real-world tradeoff in a URL shortener?

A

Short keys improve UX but may increase collision risk; long keys reduce collisions but impact usability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a common interview question on URL shorteners?

A

Design a scalable URL shortener—how would you handle unique key generation and redirects at scale?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a potential gotcha in URL shorteners?

A

Lack of abuse detection can lead to phishing/malware links; also, poor key design may cause collisions or non-uniqueness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Pastebin?

A

A web application where users can store plain text, such as code snippets or logs, for sharing via unique URLs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the advantages of Pastebin?

A

Simplifies sharing of text/code, provides version control, and allows for public or private pastes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the disadvantages of Pastebin?

A

Potential for misuse (e.g., sharing sensitive data), and may require moderation to prevent abuse.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are best practices when designing Pastebin?

A

Implement user authentication, content moderation, expiration times for pastes, and syntax highlighting for code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are common use cases for Pastebin?

A

Sharing code snippets, logs, or configuration files among developers or support teams.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How does Pastebin impact system design?

A

Requires efficient storage for text data, search functionality, and mechanisms for content expiration and privacy settings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Give an example of a Pastebin service.

A

Pastebin.com is a popular example of such a service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the architectural components of Pastebin?

A

Includes a web interface, database for storing pastes, user authentication system, and optional features like syntax highlighting.

24
Q

How can performance be ensured in Pastebin?

A

Use caching for frequently accessed pastes, optimize database queries, and implement pagination for listing pastes.

25
How can fault tolerance be added to Pastebin?
Deploy redundant servers, use database replication, and implement regular backups.
26
How is monitoring and debugging handled in Pastebin?
Monitor server performance, track user activity, and log errors for debugging.
27
What is a real-world tradeoff in Pastebin?
Balancing user anonymity with the need for moderation to prevent misuse.
28
What is a common interview question on Pastebin?
Design a Pastebin-like service—how would you handle storage, retrieval, and expiration of pastes?
29
What is a potential gotcha in Pastebin?
Failing to sanitize user input can lead to security vulnerabilities like XSS attacks.
30
What is a rate limiter?
A mechanism that controls the rate of incoming requests to prevent overloading a system or abuse.
31
What are the advantages of a rate limiter?
Protects services from abuse, ensures fair usage, and helps maintain system performance.
32
What are the disadvantages of a rate limiter?
May inadvertently block legitimate users if not configured properly.
33
What are best practices when designing a rate limiter?
Implement per-user limits, use sliding window algorithms, and provide informative error messages.
34
What are common use cases for a rate limiter?
API request limiting, login attempt restrictions, and controlling traffic to services.
35
How does a rate limiter impact system design?
Requires tracking request counts, managing state (possibly distributed), and ensuring low-latency enforcement.
36
Give an example of a rate limiter in action.
An API that allows 100 requests per minute per user, returning a 429 error when exceeded.
37
What are common algorithms used in rate limiting?
Token Bucket, Leaky Bucket, Fixed Window, and Sliding Window algorithms.
38
How can performance be ensured in a rate limiter?
Use in-memory data stores like Redis for tracking, and optimize algorithms for low latency.
39
How can fault tolerance be added to a rate limiter?
Implement distributed rate limiting with consistent hashing and fallback mechanisms.
40
How is monitoring and debugging handled in a rate limiter?
Track metrics like request counts, blocked requests, and latency; log anomalies for analysis.
41
What is a real-world tradeoff in rate limiting?
Strict limits protect services but may hinder user experience; lenient limits may allow abuse.
42
What is a common interview question on rate limiting?
Design a rate limiter for an API—how would you handle distributed enforcement and fairness?
43
What is a potential gotcha in rate limiting?
Improper synchronization in distributed systems can lead to inconsistent enforcement.
44
What is a file storage service like Dropbox?
A cloud-based service that allows users to store, sync, and share files across devices.
45
What are the advantages of a file storage service?
Provides data accessibility, backup, collaboration features, and scalability.
46
What are the disadvantages of a file storage service?
Requires robust security measures and can be complex to implement synchronization.
47
What are best practices when designing a file storage service?
Use chunking for large files, implement deduplication, and ensure secure data transfer and storage.
48
What are common use cases for a file storage service?
Personal file backup, team collaboration, and document sharing.
49
How does a file storage service impact system design?
Necessitates handling large volumes of data, ensuring data consistency, and providing high availability.
50
Give an example of a file storage service.
Dropbox, Google Drive, and OneDrive are popular examples.
51
What are the architectural components of a file storage service?
Includes client applications, metadata servers, storage servers, and synchronization mechanisms.
52
How can performance be ensured in a file storage service?
Implement CDN for file delivery, optimize synchronization protocols, and use efficient storage solutions.
53
How can fault tolerance be added to a file storage service?
Use data replication, distributed storage systems, and implement disaster recovery plans.
54
How is monitoring and debugging handled in a file storage service?
Monitor storage usage, sync errors, and system health; provide logs for troubleshooting.
55
What is a real-world tradeoff in file storage services?
Balancing storage costs with redundancy and performance requirements.
56
What is a common interview question on file storage services?
Design a Dropbox-like service—how would you handle file synchronization and conflict resolution?
57
What is a potential gotcha in file storage services?
Handling file version conflicts and ensuring data consistency across devices.