Bird
Raised Fist0
Intro to Computingfundamentals~20 mins

Search engines and how they find information in Intro to Computing - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Search Engine Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does a search engine find web pages?

Imagine a search engine as a librarian who needs to find books in a huge library. Which step below best describes how the search engine finds web pages?

AIt only searches pages stored on the user's computer.
BIt waits for users to send web pages directly to it.
CIt guesses web pages based on popular topics without visiting them.
DIt uses a program called a crawler to visit web pages and collect information about them.
Attempts:
2 left
💡 Hint

Think about how a librarian collects books to organize them.

trace
intermediate
2:00remaining
What does the crawler find on a web page?

Look at the simplified flowchart below showing a crawler visiting a web page:

Start -> Visit URL -> Read page content -> Extract links -> Store data -> End

What information does the crawler collect to help the search engine?

AOnly the images on the page.
BThe text on the page and the links to other pages.
CThe user's personal data on the page.
DThe color scheme of the page.
Attempts:
2 left
💡 Hint

Think about what helps the search engine find and connect pages.

Comparison
advanced
2:00remaining
Comparing indexing and crawling

Which statement correctly compares the roles of crawling and indexing in search engines?

ACrawling finds and reads pages; indexing organizes the information for fast searching.
BIndexing finds pages; crawling organizes the information.
CBoth crawling and indexing do the same job of finding pages.
DNeither crawling nor indexing is used by search engines.
Attempts:
2 left
💡 Hint

Think of crawling as collecting books and indexing as making a catalog.

identification
advanced
2:00remaining
Identify the error in this crawler behavior

A crawler visits pages but never follows links to new pages. What problem will this cause?

AThe crawler will collect personal user data accidentally.
BThe crawler will find too many pages and slow down the search engine.
CThe search engine will only know about the first pages visited and miss many others.
DThe crawler will index pages twice causing duplicates.
Attempts:
2 left
💡 Hint

Think about how the crawler discovers new pages.

🚀 Application
expert
3:00remaining
Predict the output of a simplified crawler simulation

Given this simplified crawler code simulation:

pages = {"A": ["B", "C"], "B": ["C"], "C": ["A"]}
crawled = set()
def crawl(page):
    if page not in crawled:
        crawled.add(page)
        for link in pages.get(page, []):
            crawl(link)
crawl("A")
print(sorted(crawled))

What will be printed?

Intro to Computing
pages = {"A": ["B", "C"], "B": ["C"], "C": ["A"]}
crawled = set()
def crawl(page):
    if page not in crawled:
        crawled.add(page)
        for link in pages.get(page, []):
            crawl(link)
crawl("A")
print(sorted(crawled))
A["A", "B", "C"]
B["A", "B"]
C["B", "C"]
D[]
Attempts:
2 left
💡 Hint

Trace the calls and see which pages get added to the set.

Practice

(1/5)
1. What is the main role of a search engine crawler?
easy
A. To display search results to users
B. To organize information into categories
C. To visit web pages and collect information
D. To delete outdated web pages from the internet

Solution

  1. Step 1: Understand the crawler's function

    A crawler is a program that visits many web pages to gather data.
  2. Step 2: Differentiate from other parts

    Unlike indexers or searchers, crawlers focus on collecting information, not organizing or displaying it.
  3. Final Answer:

    To visit web pages and collect information -> Option C
  4. Quick Check:

    Crawler = Collects data [OK]
Hint: Crawlers collect data by visiting pages [OK]
Common Mistakes:
  • Confusing crawlers with indexers
  • Thinking crawlers display results
  • Assuming crawlers delete pages
2. Which of the following is the correct order of steps a search engine uses to find information?
easy
A. Indexing -> Crawling -> Searching
B. Searching -> Crawling -> Indexing
C. Searching -> Indexing -> Crawling
D. Crawling -> Indexing -> Searching

Solution

  1. Step 1: Recall the search engine process

    First, the crawler visits pages (Crawling), then the data is organized (Indexing), and finally results are shown (Searching).
  2. Step 2: Match the correct sequence

    Only Crawling -> Indexing -> Searching lists the steps in the correct order.
  3. Final Answer:

    Crawling -> Indexing -> Searching -> Option D
  4. Quick Check:

    Process order = Crawling, Indexing, Searching [OK]
Hint: Remember: Crawl first, then index, then search [OK]
Common Mistakes:
  • Mixing up the order of steps
  • Thinking searching happens before indexing
  • Assuming indexing happens before crawling
3. Consider this simplified flowchart of a search engine process:



What happens immediately after the search query is received?
medium
A. The search engine shows the results
B. The search engine indexes the data
C. The search engine crawls new web pages
D. The search engine deletes old data

Solution

  1. Step 1: Analyze the flowchart sequence

    The flowchart shows the steps: Crawl -> Index -> Search Query -> Show Results.
  2. Step 2: Identify the step after receiving the search query

    After the search query, the next step is to show the results to the user.
  3. Final Answer:

    The search engine shows the results -> Option A
  4. Quick Check:

    After query = Show results [OK]
Hint: After query input, results are displayed [OK]
Common Mistakes:
  • Thinking crawling happens after query
  • Confusing indexing with showing results
  • Assuming data deletion occurs here
4. A student wrote this description of how search engines work:

"Search engines first show results, then crawl web pages, and finally index the data."

What is wrong with this description?
medium
A. Crawling happens after indexing
B. The order of steps is incorrect
C. Search engines do not index data
D. Search engines delete data before crawling

Solution

  1. Step 1: Review the correct order of search engine steps

    The correct order is crawling first, then indexing, and finally showing results.
  2. Step 2: Compare with the student's description

    The student says results are shown first, which is incorrect.
  3. Final Answer:

    The order of steps is incorrect -> Option B
  4. Quick Check:

    Correct order ≠ student's order [OK]
Hint: Remember: Crawl -> Index -> Show results [OK]
Common Mistakes:
  • Believing results show before crawling
  • Thinking indexing is optional
  • Assuming data deletion is part of the main steps
5. Imagine a search engine that only crawls web pages but never indexes the data. What problem would users face when searching?
hard
A. Users would get no search results or irrelevant ones
B. Search results would be slow but accurate
C. The search engine would delete all web pages
D. Users would see only images, not text

Solution

  1. Step 1: Understand the role of indexing

    Indexing organizes and stores data so the search engine can quickly find relevant results.
  2. Step 2: Consider the effect of missing indexing

    Without indexing, the search engine cannot match queries to relevant pages, so users get no or irrelevant results.
  3. Final Answer:

    Users would get no search results or irrelevant ones -> Option A
  4. Quick Check:

    No indexing = no relevant results [OK]
Hint: No indexing means no useful search results [OK]
Common Mistakes:
  • Thinking results would still be accurate
  • Assuming crawling deletes pages
  • Believing search shows only images