28/28
Part 6 of 6 · What interviewers ask nextCheck yourself
Check yourself
5 questions
1.Each fetch on the 41-page site waits about 58 ms. One page at a time took 2.36 s, and an 8-thread pool took 0.35 s. Why doesn't the GIL stop that?
2.You start a
threading.Threadfor every new link instead of using a pool. On the test's 41-page site withmax_workers=4, how many fetches were in flight at the peak?3.A page links to
http://example.com/b#top. What should go intoseenand get fetched?4.The crawl starts at
http://example.com/. Which check keeps it on that host?5.One page's fetch raises
ConnectionError, and your coordinator callsfuture.result()with notry. What happens?
That's the lesson.Next lesson: Coin change with dollar amounts
Now the problem this lesson builds to: 12 A web crawler, then make it concurrentPractice it