The parser reads the page content and finds new URLs.
How does a crawler avoid visiting duplicate pages?
ABy downloading pages twice
BBy increasing crawl speed
CBy ignoring robots.txt
DBy tracking visited URLs
✗ Incorrect
Tracking visited URLs helps skip duplicates.
Explain the main components of a web crawler and their roles.
Think about how URLs are stored, fetched, processed, and tracked.
You got /5 concepts.
Describe how a web crawler respects website rules and avoids overloading servers.
Consider both technical and ethical aspects.
You got /4 concepts.
Practice
(1/5)
1. What is the primary role of a web crawler in system design?
easy
A. To manage user authentication on websites
B. To display web pages to users
C. To automatically visit and collect data from websites
D. To store user preferences for websites
Solution
Step 1: Understand the function of a web crawler
A web crawler is designed to visit websites automatically and collect data for indexing or analysis.
Step 2: Differentiate from other web functions
Displaying pages, managing authentication, or storing preferences are not tasks of a crawler but of browsers or web servers.
Final Answer:
To automatically visit and collect data from websites -> Option C
Quick Check:
Web crawler = data collection [OK]
Hint: Crawler means automatic website data collection [OK]
Common Mistakes:
Confusing crawler with browser functionality
Thinking crawler manages user data
Mixing crawler with server-side tasks
2. Which component is essential for managing the list of URLs to visit in a web crawler?
easy
A. User Interface
B. URL Frontier
C. Data Storage
D. HTML Parser
Solution
Step 1: Identify the URL management part
The URL Frontier is the component that keeps track of URLs to be visited next in a crawler.
Step 2: Exclude unrelated components
HTML Parser processes page content, Data Storage saves data, and User Interface is unrelated to URL management.
Final Answer:
URL Frontier -> Option B
Quick Check:
URL list manager = URL Frontier [OK]
Hint: URL list is managed by URL Frontier [OK]
Common Mistakes:
Confusing parser with URL manager
Thinking storage manages URLs
Assuming UI handles crawling logic
3. Consider a crawler fetching pages with a politeness delay of 2 seconds per domain. If it visits 5 domains concurrently, how many pages can it fetch in 10 seconds?
medium
A. 50 pages
B. 10 pages
C. 5 pages
D. 25 pages
Solution
Step 1: Calculate pages per domain in 10 seconds
With 2 seconds delay, each domain can be fetched 10 / 2 = 5 times in 10 seconds.
Step 2: Multiply by number of domains
5 domains * 5 pages each = 25 pages total.
Final Answer:
25 pages -> Option D
Quick Check:
5 domains * 5 pages = 25 [OK]
Hint: Pages = (time/delay) * domains [OK]
Common Mistakes:
Multiplying delay by domains incorrectly
Ignoring concurrency in calculation
Using total time as pages directly
4. A web crawler's URL Frontier is implemented as a simple queue. What problem might arise with this design?
medium
A. It may revisit the same URLs multiple times
B. It will fetch pages too quickly without delay
C. It cannot parse HTML content correctly
D. It will store data inefficiently
Solution
Step 1: Understand queue behavior in URL management
A simple queue does not track visited URLs, so duplicates can be added and revisited.
Step 2: Identify consequences
This causes repeated crawling of same pages, wasting resources.
Final Answer:
It may revisit the same URLs multiple times -> Option A