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
Recall & Review
beginner
What does URL stand for?
URL stands for Uniform Resource Locator. It is the address used to find resources on the internet, like websites or files.
Click to reveal answer
beginner
Name the main parts of a URL.
A URL has these main parts: 1. Protocol (like http or https) 2. Domain name (like www.example.com) 3. Optional port number (like :80) 4. Path (like /page1) 5. Optional query parameters (like ?id=123) 6. Optional fragment (like #section2)
Click to reveal answer
beginner
What is the role of the protocol in a URL?
The protocol tells the browser how to communicate with the server. For example, 'http' or 'https' means to use the HyperText Transfer Protocol, where 'https' is secure.
Click to reveal answer
beginner
Explain the difference between domain and path in a URL.
The domain is like the street address of a building (e.g., www.example.com). The path is like the room number inside the building (e.g., /about). Together, they tell the browser exactly where to go.
Click to reveal answer
intermediate
What are query parameters in a URL?
Query parameters come after a question mark (?) in a URL. They send extra information to the server, like search terms or filters. For example, '?search=books' tells the server to look for books.
Click to reveal answer
Which part of the URL specifies the website's address?
AProtocol
BPath
CDomain name
DQuery parameters
✗ Incorrect
The domain name is the main address of the website, like www.example.com.
What symbol starts the query parameters in a URL?
A?
B/
C#
D:
✗ Incorrect
Query parameters always start with a question mark (?) in a URL.
In the URL 'https://www.site.com:8080/page?item=5#top', what does ':8080' represent?
APath
BProtocol
CFragment
DPort number
✗ Incorrect
The ':8080' is the port number telling the browser which port to use to connect.
What does the fragment part of a URL do?
APoints to a section within the page
BSends data to the server
CSpecifies the server location
DDefines the protocol
✗ Incorrect
The fragment, after a #, points to a specific section inside the webpage.
Which protocol indicates a secure connection?
Ahttp
Bhttps
Csmtp
Dftp
✗ Incorrect
'https' means the connection is secure using encryption.
Describe the structure of a URL and explain the purpose of each part.
Think of a URL like a mailing address with extra details.
You got /6 concepts.
Explain how query parameters and fragments are used in URLs with examples.
Consider how you search or jump to parts of a webpage.
You got /4 concepts.
Practice
(1/5)
1. Which part of a URL specifies the protocol used to access a resource? https://www.example.com:8080/path?query=123#section
easy
A. www.example.com
B. 8080
C. https
D. /path
Solution
Step 1: Identify the scheme in the URL
The scheme is the part before the first colon (:), which defines the protocol.
Step 2: Locate the scheme in the example URL
In https://www.example.com:8080/path?query=123#section, the scheme is https.
Final Answer:
https -> Option C
Quick Check:
Scheme = https [OK]
Hint: Look before :// for the protocol name [OK]
Common Mistakes:
Confusing domain with scheme
Thinking port number is the protocol
Selecting path as scheme
2. Which of the following is the correct syntax for a URL including a port number?
easy
A. http://example.com:80
B. http://:80example.com
C. http://example.com/80
D. http://example.com?80
Solution
Step 1: Understand port placement in URL syntax
The port number comes after the domain, separated by a colon (:).
Step 2: Check each option for correct port syntax
http://example.com:80 uses http://example.com:80, which correctly places port 80 after the domain with a colon.
Final Answer:
http://example.com:80 -> Option A
Quick Check:
Port follows domain with colon [OK]
Hint: Port number always follows domain with a colon [OK]
Common Mistakes:
Placing port before domain
Using slash instead of colon for port
Adding port as query parameter
3. What is the full path and query part of this URL? https://shop.example.com/products/item?id=12345&color=red#reviews
medium
A. /products/item?id=12345&color=red
B. /products/item#reviews
C. ?id=12345&color=red#reviews
D. /products/item?id=12345&color=red#reviews
Solution
Step 1: Identify path and query parts in the URL
The path is the part after the domain up to the question mark (?), and the query is after the question mark up to the hash (#).
Step 2: Extract path and query from the example URL
Path: /products/item, Query: ?id=12345&color=red. The fragment #reviews is not part of path or query.
Hint: Path starts with /, query starts with ? [OK]
Common Mistakes:
Including fragment (#reviews) in path or query
Confusing query with fragment
Ignoring query parameters
4. Identify the error in this URL: ftp//files.example.com/downloads/file.zip
medium
A. Path should start with a question mark
B. Missing colon after scheme
C. Domain name is invalid
D. Port number is missing
Solution
Step 1: Check the scheme syntax
The scheme must end with a colon (:), e.g., ftp:.
Step 2: Locate the error in the URL
The URL has ftp// missing the colon after ftp. Correct form is ftp://.
Final Answer:
Missing colon after scheme -> Option B
Quick Check:
Scheme ends with : [OK]
Hint: Scheme must end with : before // [OK]
Common Mistakes:
Ignoring missing colon in scheme
Thinking domain is invalid
Expecting port number always
5. You want to create a URL to access a user profile page with user ID 789 and show the 'settings' section. Which URL correctly uses path, query, and fragment? Base URL: https://app.example.com
hard
A. https://app.example.com/user?id=789#settings?section=profile
B. https://app.example.com/user/789#settings?section=profile
C. https://app.example.com/user/789?section=settings#profile
D. https://app.example.com/user/789?section=settings#settings
Solution
Step 1: Understand URL parts for user profile
The user ID should be part of the path (/user/789), the section to show is a query parameter (?section=settings), and the fragment points to a page section (#settings).
Step 2: Evaluate each option for correct structure
https://app.example.com/user/789?section=settings#settings correctly places user ID in path, section in query, and fragment as #settings. Others mix fragment and query incorrectly or mismatch sections.
Final Answer:
https://app.example.com/user/789?section=settings#settings -> Option D
Quick Check:
Path + Query + Fragment correct [OK]
Hint: Path for ID, query for filters, fragment for page section [OK]