Web Technology Questions and Answers – Understanding URLs

This set of Web Technology Multiple Choice Questions & Answers (MCQs) focuses on “Understanding URLs”.

1. Which part of the URL identifies the way a file is transmitted?
a) Domain
b) Filepath
c) Name of the website
d) Scheme
View Answer

Answer: d
Explanation: Scheme is the first part of URL, most web pages use Hypertext Transfer Protocol (HTTP) to pass information. Https:// when doing banking online which is a more secure form of http. Ftp:// when downloading large sized files.

2. What happens when a filename is not provided?
a) Returns a similar file
b) Creates a duplicate file and provides
c) Looks for a default file and returns it
d) Provides a random file available
View Answer

Answer: c
Explanation: The server returns a default file which is usually index.html for XHTML written websites from the root folder. It also offers the list of files in that directory. Shows a message displaying that the file is not found.

3. What is Domain Name Server?
a) Creates a duplicate of the website
b) Converts IP address to domain name
c) Converts domain name to IP address
d) Identifies the wrong IP address
View Answer

Answer: c
Explanation: When you enter a domain name into a browser, behind the scenes the name gets converted into the IP address for the computer that stores the web site. This is done by consulting a domain name server. DNS keeps a directory of domain names and the corresponding IP addresses.
advertisement
advertisement

4. Host name can also be called as _________
a) Server
b) IP address
c) DNS
d) Element
View Answer

Answer: b
Explanation: The host address is usually the domain name for the site. www is found before the domain name, although it is not actually part of the domain name itself. The host address can also be a number called an IP address.

5. What is Absolute URL?
a) Contains everything you need to uniquely identify a particular file
b) Contains just the sub topic you are searching for
c) It converts any URL into IP address
d) Contains only one main topic you are searching for
View Answer

Answer: a
Explanation: This is what you would type into the address bar of your browser to find a page. Absolute URLs can quickly get quite long, and every page of a web site can contain many links. The detailed explanation is given in the search which turns into an absolute URL.

6. What does an Relative URL indicate?
a) Indicates where the resource is not in relation to the current page
b) Indicates if the URL contains the file you are searching for
c) Indicates the incorrect resources in relation to the current page
d) Indicates where the resource is in relation to the current page
View Answer

Answer: d
Explanation: Relative URLs are also used to specify files in different directories. It allows us to not mention the name of the resource if the sub-source is present under the same resource. Relative URLs are more convenient than Absolute URLs.

7. Correct syntax to access the parent directory is _______
a) page.html
b) nameofdirectory/page.html
c) . ./page.html
d) /page.html
View Answer

Answer: c
Explanation: The ../ notation of two periods or dots followed by a forward slash character helps the user to access it’s parent directory. Each time you repeat the ../ notation, you go up another directory. If the two dots in the start aren’t present, then it takes the user to root directory.
advertisement

8. Which of the following is accessing a sub directory?
a) Music/index.html
b) ../index.html
c) /Entertainment/Music/index.html
d) index.html
View Answer

Answer: a
Explanation: The user must include the name of the subdirectory, followed by a forward slash character, and the name of the page you want to link to. For each additional subdirectory, just add the name of the directory followed by a forward slash character. A sub directory should only start with a name and not a forward slash.

9. What is the function of <basegt; element?
a) Allows you to specify a base URL for a page that all relative URLs will be added
b) Protects relative URL from being converted to absolute URL
c) It doesn’t allow to specify the base URL as the value of the href attribute
d) It shows the base information of the website
View Answer

Answer: a
Explanation: When a browser comes across a relative URL, it actually transforms the relative URL into a full absolute URL. The user specifies the base URL as the value of the href attribute on the <basegt; element. Apart from the href attribute, the only other attribute a <basegt; element can carry is the id attribute.
advertisement

10. How to access a root directory?
a) Adding .html at the end of the file name
b) You use its path preceded by a forward slash
c) Two dots followed by a forward slash with the filename
d) Starting with a forward slash followed by the filename
View Answer

Answer: b
Explanation: It is also possible to indicate a file relative to the root folder of the site. The forward slash at the start indicates the root directory. And then the path from there is specified.

Sanfoundry Global Education & Learning Series – Web Technology.

To practice all areas of Web Technology, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.