UNIT 3 : INTERNET & WEB TECHNOLOGIES
HTML5
1. What does HTML stand for?
a) Hyper Text Markup Language
b) HyperText Markup Language
c) Home Text Markup Language
d) Hyper Transfer Markup Language
Answer: b) HyperText Markup Language
2. Which of the following is a new feature in HTML5?
a) <marquee>
b) <center>
c) <section>
d) <font>
Answer: c) <section>
3. Which of the following elements is used to define navigation links in
HTML5?
a) <nav>
b) <navigation>
c) <menu>
d) <nav>
Answer: a) <nav>
4. In HTML5, which element is used for specifying the main content of a
document?
a) <main>
b) <body>
c) <content>
d) <main>
Answer: a) <main>
5. Which of the following is not a valid HTML5 element?
a) <header>
b) <article>
c) <footer>
d) <b>
Answer: d) <b>
6. How do you create a hyperlink in HTML5?
a) <link>
b) <a href="http://www.example.com">Link</a>
c) <url>
d) <a href="http://www.example.com">Link</a>
Answer: b) <a href="http://www.example.com">Link</a>
7. Which HTML5 element is used to define a footer for a document or
section?
a) <bottom>
b) <footer>
c) <end>
d) <foot>
Answer: b) <footer>
8. Which element in HTML5 is used to define a header for a document or
section?
a) <head>
b) <header>
c) <top>
d) <heading>
Answer: b) <header>
9. Which HTML5 tag is used for embedding audio files?
a) <sound>
b) <audio>
c) <music>
d) <audio>
Answer: b) <audio>
10. How do you create a form in HTML5?
a) <input>
b) <form>
c) <form>
d) <createform>
Answer: b) <form>
11. What is the purpose of the placeholder attribute in HTML5?
a) To specify a default value for an input field
b) To provide a short hint in the input field
c) To limit the number of characters in an input field
d) To change the color of the text in the input field
Answer: b) To provide a short hint in the input field
12. Which HTML5 element is used to display a video?
a) <movie>
b) <video>
c) <film>
d) <media>
Answer: b) <video>
13. What does the <canvas> element in HTML5 do?
a) Allows users to draw graphics dynamically
b) Used for 3D graphics rendering
c) Used to display text content
d) Renders images and videos
Answer: a) Allows users to draw graphics dynamically
14. Which of the following is a new form input type in HTML5?
a) text
b) email
c) password
d) url
Answer: b) email
15. How do you define a document's character encoding in HTML5?
a) <meta charset="UTF-8">
b) <meta encoding="UTF-8">
c) <charset="UTF-8">
d) <meta charset="UTF-8">
Answer: a) <meta charset="UTF-8">
16. Which attribute in HTML5 is used to specify the source for the <video>
element?
a) src
b) src
c) source
d) href
Answer: a) src
17. Which HTML5 element is used to represent a list of links?
a) <ul>
b) <nav>
c) <ol>
d) <list>
Answer: b) <nav>
18. In HTML5, what does the required attribute do for input elements?
a) Makes the field editable
b) Specifies that the field must be filled out before submitting the form
c) Defines a default value for the input field
d) Makes the input field read-only
Answer: b) Specifies that the field must be filled out before submitting the form
19. Which of the following is the correct HTML5 tag for defining a section in
a webpage?
a) <section>
b) <section>
c) <area>
d) <div>
Answer: a) <section>
20. What is the purpose of the localStorage feature in HTML5?
a) To store user data on the server
b) To store data locally on the user's browser
c) To store large images
d) To provide offline access to websites
Answer: b) To store data locally on the user's browser
21. Which of the following is used to define a group of related options in a
form?
a) <fieldset>
b) <group>
c) <options>
d) <choice>
Answer: a) <fieldset>
22. What does the <article> element in HTML5 define?
a) The metadata of a webpage
b) Content that is independent and can be distributed or reused
c) A block of text
d) A navigation section
Answer: b) Content that is independent and can be distributed or reused
23. What does the type="range" input in HTML5 do?
a) Allows text input
b) Creates a slider to select a value within a range
c) Creates a dropdown menu
d) Allows the user to select multiple options
Answer: b) Creates a slider to select a value within a range
24. Which of the following tags is used for defining a table in HTML5?
a) <tbl>
b) <table>
c) <tbody>
d) <tr>
Answer: b) <table>
25. Which HTML5 tag is used to define the header of a table?
a) <thead>
b) <th>
c) <header>
d) <h1>
Answer: a) <thead>
26. What attribute is used to provide a fallback option for an <audio> or
<video> element?
a) fallback
b) source
c) alt
d) default
Answer: b) source
27. How do you define a metadata for a webpage in HTML5?
a) <meta data>
b) <meta>
c) <info>
d) <head>
Answer: b) <meta>
28. What is the purpose of the <mark> element in HTML5?
a) To highlight text
b) To define a heading
c) To create a hyperlink
d) To add a comment
Answer: a) To highlight text
29. Which HTML5 element is used to group inline elements?
a) <section>
b) <span>
c) <div>
d) <p>
Answer: b) <span>
30. What does the autoplay attribute do in the <video> element in HTML5?
a) Automatically starts downloading the video
b) Automatically starts playing the video when the page loads
c) Allows the user to loop the video
d) Sets the video volume
Answer: b) Automatically starts playing the video when the page loads
31. What is the purpose of the <progress> element in HTML5?
a) To represent the completion progress of a task
b) To represent an image
c) To create a hyperlink
d) To display content
Answer: a) To represent the completion progress of a task
32. How can you include external JavaScript in an HTML5 document?
a) <script src="script.js">
b) <script src="script.js"></script>
c) <javascript src="script.js">
d) <link href="script.js" rel="script">
Answer: b) <script src="script.js"></script>
33. Which HTML5 element is used to define a header in a document?
a) <header>
b) <head>
c) <heading>
d) <title>
Answer: a) <header>
34. How is the canvas element used in HTML5?
a) <canvas id="myCanvas" width="500" height="500"></canvas>
b) <draw id="myCanvas">
c) <graphic id="myCanvas">
d) <canvas id="myCanvas" width="500" height="500"></canvas>
Answer: a) <canvas id="myCanvas" width="500" height="500"></canvas>
35. Which HTML5 element allows you to embed a map?
a) <map>
b) <iframe>
c) <googlemap>
d) <location>
Answer: b) <iframe>
36. Which element in HTML5 is used to define a navigation menu?
a) <menu>
b) <navigation>
c) <nav>
d) <list>
Answer: c) <nav>
37. Which HTML5 element is used to define a section of content related to the
document?
a) <aside>
b) <article>
c) <section>
d) <section>
Answer: a) <aside>
38. What is the new form element introduced in HTML5 for handling date
input?
a) <input type="date">
b) <input type="date">
c) <input type="datetime">
d) <input type="calendar">
Answer: b) <input type="date">
39. What is the purpose of the <time> element in HTML5?
a) To define a specific time on a clock
b) To represent a specific period in time
c) To display the current time
d) To display a countdown timer
Answer: b) To represent a specific period in time
40. Which attribute is used to specify the alternative text for an image in
HTML5?
a) alt
b) src
c) title
d) longdesc
Answer: a) alt
41. Which of the following is used to create a drop-down list in HTML5?
a) <input>
b) <select>
c) <dropdown>
d) <list>
Answer: b) <select>
42. What is the purpose of the <footer> tag in HTML5?
a) To define a part of the header
b) To define the footer section of a document or section
c) To create a form
d) To insert an image
Answer: b) To define the footer section of a document or section
43. What element in HTML5 is used to display a scrollable content area?
a) <scroll>
b) <div>
c) <section>
d) <content>
Answer: b) <div>
44. Which of the following can be used to store data on the client-side in
HTML5?
a) localStorage
b) cookies
c) sessionStorage
d) databases
Answer: a) localStorage
45. What attribute in HTML5 is used for embedding web fonts?
a) font-face
b) font-family
c) @font-face
d) font-link
Answer: c) @font-face
46. How do you create an input field for entering a password in HTML5?
a) <input type="text">
b) <input type="password">
c) <input type="password">
d) <input type="secret">
Answer: b) <input type="password">
47. Which of the following elements represents an independent piece of
content in HTML5?
a) <article>
b) <header>
c) <footer>
d) <section>
Answer: a) <article>
48. Which of the following is used to define a navigation link within a webpage
in HTML5?
a) <a>
b) <link>
c) <button>
d) <nav>
Answer: a) <a>
49. What does the target="_blank" attribute do in an anchor (<a>) tag?
a) It opens the link in the same window
b) It opens the link in a new tab or window
c) It opens the link in a new browser
d) It opens the link in a specific iframe
Answer: b) It opens the link in a new tab or window
50. Which element is used to specify a caption for a <table> in HTML5?
a) <head>
b) <caption>
c) <title>
d) <subheader>
Answer: b) <caption>
CSS3
1. Which of the following is the correct syntax to change the background color
in CSS3?
a) background-color: #FFFFFF;
b) background-color: white;
c) background: color white;
d) color: background white;
Answer: b) background-color: white;
2. What does the border-radius property do in CSS3?
a) Adds a solid border
b) Rounds the corners of an element
c) Adds space around an element
d) Changes the color of borders
Answer: b) Rounds the corners of an element
3. Which of the following is a valid CSS3 selector?
a) .selector
b) #selector
c) .selector, #selector
d) *selector
Answer: b) #selector
4. Which property is used to change the font of an element in CSS3?
a) font-family
b) font-size
c) font-weight
d) text-align
Answer: a) font-family
5. How can you apply a shadow effect to text in CSS3?
a) text-shadow: 2px 2px 5px black;
b) text-shadow: 2px 2px 5px #000000;
c) box-shadow: 2px 2px 5px black;
d) shadow-effect: 2px 2px 5px #000000;
Answer: b) text-shadow: 2px 2px 5px #000000;
6. Which property is used to change the background image in CSS3?
a) background-image
b) background-color
c) image-background
d) background-picture
Answer: a) background-image
7. How do you make a CSS3 transition effect happen when an element is
hovered over?
a) transition: 1s;
b) transition: all 0.5s ease;
c) transition-effect: all 1s;
d) transition-duration: 0.5s;
Answer: b) transition: all 0.5s ease;
8. What is the purpose of the @media rule in CSS3?
a) To define styles for different screen sizes or devices
b) To define animation keyframes
c) To add external stylesheets
d) To define media types for printing
Answer: a) To define styles for different screen sizes or devices
9. Which property in CSS3 is used to set the height of an element?
a) height
b) max-height
c) min-height
d) vertical-align
Answer: a) height
10. Which CSS3 property is used to define the space between lines of text?
a) letter-spacing
b) line-height
c) word-spacing
d) text-spacing
Answer: b) line-height
11. How can you create a circular shape using CSS3?
a) By setting border-radius to 50%
b) By setting width and height to the same value
c) By setting border to a large value
d) By setting display: inline-block;
Answer: a) By setting border-radius to 50%
12. Which of the following is used to specify the width of an element in CSS3?
a) width-size
b) width
c) element-width
d) element-size
Answer: b) width
13. Which property in CSS3 is used to control the opacity of an element?
a) opacity-level
b) opacity
c) transparency
d) visibility
Answer: b) opacity
14. Which property is used to set the space between the content and the
border of an element in CSS3?
a) padding
b) margin
c) border-spacing
d) border-width
Answer: a) padding
15. Which of the following CSS3 properties is used to set the display behavior
of an element?
a) display-mode
b) display
c) block-display
d) style-display
Answer: b) display
16. Which CSS3 property is used to change the text color?
a) font-color
b) color
c) text-color
d) background-color
Answer: b) color
17. How do you set the font size of an element in CSS3?
a) font-size: large;
b) font-size: 16px;
c) font-style: large;
d) text-size: 16px;
Answer: b) font-size: 16px;
18. Which of the following is used to specify the background color of an
element in CSS3?
a) bg-color
b) background-color
c) color-background
d) background
Answer: b) background-color
19. What is the function of z-index in CSS3?
a) It controls the stacking order of elements
b) It sets the opacity of an element
c) It defines the font size
d) It defines the border radius
Answer: a) It controls the stacking order of elements
20. Which of the following is used to create a gradient background in CSS3?
a) gradient
b) background-image: linear-gradient();
c) background-color: gradient();
d) background: gradient();
Answer: b) background-image: linear-gradient();
21. Which CSS3 property is used to create space between elements?
a) padding
b) margin
c) spacing
d) gap
Answer: b) margin
22. Which of the following is a new CSS3 layout feature for creating flexible
layouts?
a) flexbox
b) grid
c) positioning
d) table-layout
Answer: a) flexbox
23. How do you create an animated transition effect for a property change in
CSS3?
a) transition: property duration
b) animation: property duration
c) motion: property duration
d) effect: property duration
Answer: a) transition: property duration
24. How do you center text horizontally using CSS3?
a) text-align: center;
b) text-align: center;
c) vertical-align: center;
d) align: center;
Answer: a) text-align: center;
25. Which property is used to control the line height in CSS3?
a) line-height
b) line-spacing
c) height-spacing
d) spacing
Answer: a) line-height
26. What property in CSS3 is used to add a shadow effect to an element’s
box?
a) box-shadow
b) text-shadow
c) shadow
d) element-shadow
Answer: a) box-shadow
27. Which of the following is a new unit of measurement in CSS3?
a) rem
b) em
c) pt
d) px
Answer: a) rem
28. Which of the following CSS3 properties is used to control the layout of
items inside a container?
a) flex
b) align-items
c) justify-content
d) float
Answer: a) flex
29. What is the function of the display: flex; property in CSS3?
a) It defines the position of elements
b) It creates a flexible container for layout
c) It controls the width of elements
d) It adds a background color
Answer: b) It creates a flexible container for layout
30. Which of the following is used to create a responsive design in CSS3?
a) @media queries
b) flexbox
c) grid
d) border-radius
Answer: a) @media queries
31. Which property is used to set the transparency of an element in CSS3?
a) transparency
b) opacity
c) visibility
d) clear
Answer: b) opacity
32. What is the purpose of float property in CSS3?
a) To display elements in a line
b) To float elements left or right
c) To clear the space around an element
d) To set the height of an element
Answer: b) To float elements left or right
33. Which of the following is the correct syntax for a CSS3 class selector?
a) #classname
b) .classname
c) classname
d) classname#
Answer: b) .classname
34. Which CSS3 property allows you to set the border style of an element?
a) border-size
b) border-style
c) border-color
d) border-width
Answer: b) border-style
35. What is the purpose of the @font-face rule in CSS3?
a) To specify a font family
b) To load custom fonts
c) To set the font size
d) To define the font weight
Answer: b) To load custom fonts
36. How do you set a font weight of bold in CSS3?
a) font-style: bold;
b) font-weight: bold;
c) font: bold;
d) font-size: bold;
Answer: b) font-weight: bold;
37. Which CSS3 property allows you to add a curved border to an element?
a) border-radius
b) corner-radius
c) radius
d) border-corner
Answer: a) border-radius
38. Which CSS3 property is used to set the background size of an image?
a) background-size
b) image-size
c) background-image-size
d) image-background
Answer: a) background-size
39. What does the text-align: justify; property do in CSS3?
a) Aligns text to the right
b) Aligns text to both the left and right margins
c) Centers the text
d) Aligns text to the center
Answer: b) Aligns text to both the left and right margins
40. What does the visibility: hidden; property do in CSS3?
a) It makes the element invisible but still takes up space
b) It hides the element completely, removing its space
c) It hides the text inside the element
d) It changes the background color
Answer: a) It makes the element invisible but still takes up space
41. Which of the following properties is used for 2D transformations in CSS3?
a) rotate()
b) transform
c) transform3D()
d) rotate3D()
Answer: b) transform
42. How do you add a hover effect in CSS3?
a) hover: element;
b) element:hover {}
c) hover {element}
d) element:hover {}
Answer: b) element:hover {}
43. Which property is used to set the text alignment in CSS3?
a) text-align
b) align-text
c) align
d) text-position
Answer: a) text-align
44. What is the purpose of box-sizing in CSS3?
a) It defines the border of an element
b) It defines how the width and height of elements are calculated
c) It sets the box-shadow of an element
d) It controls the overflow behavior
Answer: b) It defines how the width and height of elements are calculated
45. Which of the following CSS3 properties is used to specify the width of a
border?
a) border-size
b) border-width
c) border-thickness
d) border-height
Answer: b) border-width
46. How do you define a keyframe animation in CSS3?
a) @animation
b) @keyframes
c) @frames
d) @animation-key
Answer: b) @keyframes
47. Which CSS3 property is used to control the visibility of an element?
a) display
b) visibility
c) opacity
d) visibility-mode
Answer: b) visibility
48. Which CSS3 property controls the layout of an element in a 2D grid?
a) grid
b) flex
c) layout
d) layout-grid
Answer: a) grid
49. What is the function of the position property in CSS3?
a) It defines the size of an element
b) It specifies how an element is positioned in the document
c) It changes the color of an element
d) It controls the margin of an element
Answer: b) It specifies how an element is positioned in the document
50. How do you add a border around an element in CSS3?
a) element-border: 1px solid black;
b) border: 1px solid black;
c) border-style: 1px solid black;
d) element-border: solid black;
Answer: b) border: 1px solid black;
JAVASCRIPT
1. Which of the following is the correct syntax to print a message to the
console in JavaScript?
a) console.print("Hello, world!");
b) console.log("Hello, world!");
c) log.console("Hello, world!");
d) echo.console("Hello, world!");
Answer: b) console.log("Hello, world!");
2. What is the correct way to declare a variable in JavaScript?
a) var x = 10;
b) let x = 10;
c) const x = 10;
d) All of the above
Answer: d) All of the above
3. Which method is used to add an element at the end of an array in
JavaScript?
a) append()
b) push()
c) push()
d) add()
Answer: b) push()
4. What is the correct way to define a function in JavaScript?
a) function myFunction() {}
b) function myFunction() {}
c) function: myFunction() {}
d) myFunction() function {}
Answer: b) function myFunction() {}
5. Which of the following is used to select an HTML element by its ID in
JavaScript?
a) document.getElementById()
b) document.getElementByClass()
c) document.querySelector()
d) document.getElementByClassName()
Answer: a) document.getElementById()
6. What will the following code return? typeof NaN
a) number
b) number
c) undefined
d) NaN
Answer: b) number
7. How do you create a single-line comment in JavaScript?
a) /* This is a comment */
b) // This is a comment
c) // This is a comment
d) <!-- This is a comment -->
Answer: b) // This is a comment
8. What is the correct syntax for an if statement in JavaScript?
a) if (x = 10)
b) if (x == 10)
c) if x == 10
d) if (x = 10);
Answer: b) if (x == 10)
9. What is the purpose of the break statement in JavaScript?
a) Exits from the loop or switch statement
b) Ends the program
c) Exits from a function
d) Skips the current iteration of the loop
Answer: a) Exits from the loop or switch statement
10. Which of the following is a falsy value in JavaScript?
a) 1
b) 0
c) true
d) []
Answer: b) 0
11. Which of the following operators is used to compare both value and type
in JavaScript?
a) ==
b) ===
c) !=
d) =
Answer: b) ===
12. Which of the following methods is used to remove the last element from an
array in JavaScript?
a) pop()
b) delete()
c) shift()
d) splice()
Answer: a) pop()
13. What is the correct way to write a JavaScript array?
a) var colors = (1:"red", 2:"blue")
b) var colors = ["red", "blue", "green"]
c) var colors = "red", "blue", "green"
d) var colors = {"red", "blue", "green"}
Answer: b) var colors = ["red", "blue", "green"]
14. Which of the following methods is used to remove the first element from
an array in JavaScript?
a) pop()
b) shift()
c) unshift()
d) splice()
Answer: b) shift()
15. What will console.log(1 + '1') print in JavaScript?
a) 2
b) 11
c) NaN
d) undefined
Answer: b) 11
16. What does the this keyword refer to in JavaScript?
a) The window object
b) The function
c) The current object
d) The global variable
Answer: c) The current object
17. How do you call a function in JavaScript?
a) call function() {}
b) functionName()
c) function call()
d) call functionName()
Answer: b) functionName()
18. How do you declare a constant variable in JavaScript?
a) constant x = 10;
b) const x = 10;
c) var const x = 10;
d) let const x = 10;
Answer: b) const x = 10;
19. How do you find the length of an array in JavaScript?
a) length(array)
b) array.length
c) array.size()
d) length of array
Answer: b) array.length
20. Which of the following will declare a function that returns a value in
JavaScript?
a) function functionName() { return value; }
b) function functionName() { return value; }
c) functionName() => { return value; }
d) functionName() { value return; }
Answer: b) function functionName() { return value; }
21. What does JSON.parse() do in JavaScript?
a) Converts a JSON string into a JavaScript object
b) Converts an object into a string
c) Evaluates JavaScript code from a string
d) Serializes an object into a JSON string
Answer: a) Converts a JSON string into a JavaScript object
22. What will the following code output? console.log("10" + 1)
a) 11
b) 101
c) 10
d) NaN
Answer: b) 101
23. Which of the following methods is used to sort an array in JavaScript?
a) arr.sort()
b) arr.sort()
c) arr.order()
d) arr.arrange()
Answer: b) arr.sort()
24. How do you define a class in JavaScript?
a) class MyClass {}
b) class MyClass {}
c) MyClass = class {}
d) function MyClass() {}
Answer: b) class MyClass {}
25. Which of the following is used to check if a variable is an array in
JavaScript?
a) Array.isArray()
b) Array.isArray()
c) isArray()
d) checkArray()
Answer: b) Array.isArray()
26. What does NaN stand for in JavaScript?
a) Not a Number
b) Null and Not
c) No actual number
d) Non-arithmetic Number
Answer: a) Not a Number
27. What does window.alert() do in JavaScript?
a) Logs a message in the console
b) Displays an alert box with a message
c) Opens a new window
d) Prints a message to the browser screen
Answer: b) Displays an alert box with a message
28. Which of the following is a way to handle asynchronous code in
JavaScript?
a) callbacks
b) Promises
c) async/await
d) All of the above
Answer: d) All of the above
29. Which operator is used for assignment in JavaScript?
a) ==
b) =
c) ===
d) =>
Answer: b) =
30. What does the addEventListener() method do in JavaScript?
a) Adds an event handler to an element
b) Adds an event listener to an element
c) Executes an event
d) Removes an event listener
Answer: b) Adds an event listener to an element
31. Which of the following methods can be used to stop an event from
propagating in JavaScript?
a) event.stop()
b) event.stopPropagation()
c) event.preventDefault()
d) event.cancel()
Answer: b) event.stopPropagation()
32. What is the result of 0 == false in JavaScript?
a) true
b) false
c) undefined
d) NaN
Answer: a) true
33. How do you create a new object in JavaScript?
a) let obj = {};
b) let obj = new Object();
c) let obj = Object.create();
d) let obj = []
Answer: a) let obj = {};
34. What is the purpose of localStorage in JavaScript?
a) To store data in the browser without an expiration date
b) To store cookies for sessions
c) To store data temporarily for the current session
d) To store server-side data
Answer: a) To store data in the browser without an expiration date
35. What does document.getElementById("myId").innerHTML = "Hello"; do in
JavaScript?
a) Retrieves the HTML content of an element
b) Sets the HTML content of an element
c) Creates a new element with id="myId"
d) Returns the id of an element
Answer: b) Sets the HTML content of an element
36. What will typeof null return in JavaScript?
a) null
b) object
c) undefined
d) NaN
Answer: b) object
37. What is the correct syntax for a JavaScript switch statement?
a) switch(expression) { case value: break; }
b) switch { case value: break; }
c) switch(expression) { value: break; }
d) switch(expression) { break: case value; }
Answer: a) switch(expression) { case value: break; }
38. What does the isNaN() function do in JavaScript?
a) Checks if a value is null
b) Checks if a value is NaN
c) Returns the type of a value
d) Checks if a value is an object
Answer: b) Checks if a value is NaN
39. Which of the following is used to parse JSON data in JavaScript?
a) JSON.parse()
b) JSON.stringify()
c) JSON.decode()
d) JSON.convert()
Answer: a) JSON.parse()
40. How can you detect the operating system in JavaScript?
a) navigator.os
b) navigator.getOS()
c) navigator.platform
d) navigator.system()
Answer: c) navigator.platform
41. What does undefined mean in JavaScript?
a) The value is not defined
b) The variable is declared
c) The variable has a null value
d) The variable has been deleted
Answer: a) The value is not defined
42. Which of the following is used to set a timeout for a function in
JavaScript?
a) setTimeout()
b) setInterval()
c) timeOut()
d) delay()
Answer: a) setTimeout()
43. How do you create a new promise in JavaScript?
a) let promise = new Promise()
b) let promise = new Promise(function(resolve, reject) { })
c) let promise = Promise()
d) let promise = new Promise(function() { })
Answer: b) let promise = new Promise(function(resolve, reject) { })
44. How can you trigger an event in JavaScript?
a) element.dispatchEvent()
b) element.trigger()
c) element.fire()
d) element.emit()
Answer: a) element.dispatchEvent()
45. What is the purpose of the default keyword in a switch statement?
a) Specifies the default case when no match is found
b) Defines a fallback case
c) Exits the switch statement
d) Sets the default value of the expression
Answer: a) Specifies the default case when no match is found
46. What does Math.random() return in JavaScript?
a) A random integer
b) A random floating-point number between 0 and 1
c) A random number between -1 and 1
d) A random value between 1 and 100
Answer: b) A random floating-point number between 0 and 1
47. What does null represent in JavaScript?
a) An undefined value
b) An intentional absence of any object value
c) A type of object
d) An invalid reference
Answer: b) An intentional absence of any object value
48. Which method is used to remove all the elements from an array in
JavaScript?
a) array.splice(0, array.length)
b) array.clear()
c) array.delete()
d) array.removeAll()
Answer: a) array.splice(0, array.length)
49. How do you check if an array contains a specific element in JavaScript?
a) array.includes()
b) array.contains()
c) array.has()
d) array.search()
Answer: a) array.includes()
50. Which of the following is the correct way to add a comment in JavaScript?
a) /* This is a comment */
b) // This is a comment
c) <!-- This is a comment -->
d) # This is a comment
Answer: b) // This is a comment
JSON
1. What does JSON stand for?
a) JavaScript Oriented Notation
b) JavaScript Object Notation
c) Java Syntax Object Notation
d) JavaScript Option Notation
Answer: b) JavaScript Object Notation
2. What type of data is JSON used to represent?
a) Structured data
b) Text data
c) Unstructured data
d) Binary data
Answer: a) Structured data
3. What is the correct format for a JSON object?
a) { key: value, key: value }
b) {"key": "value", "key": "value"}
c) ["key": "value", "key": "value"]
d) key = value, key = value
Answer: b) {"key": "value", "key": "value"}
4. Which of the following is a valid JSON string?
a) {name: "John", age: 30}
b) {"name": "John", "age": 30}
c) ("name" = "John", "age" = 30)
d) [name: "John", age: 30]
Answer: b) {"name": "John", "age": 30}
5. What data types can JSON represent?
a) String, Number, Object, Boolean, Null
b) Integer, Decimal, Object, String
c) String, Number, Object, Boolean, Null
d) Text, Binary, String
Answer: c) String, Number, Object, Boolean, Null
6. How do you parse a JSON string into a JavaScript object?
a) JSON.parse()
b) JSON.stringify()
c) parseJSON()
d) convertJSON()
Answer: a) JSON.parse()
7. How do you convert a JavaScript object to a JSON string?
a) JSON.parse()
b) JSON.stringify()
c) toJSON()
d) convertJSON()
Answer: b) JSON.stringify()
8. What is the correct syntax to define an array in JSON?
a) [ "item1", "item2", "item3" ]
b) { "item1", "item2", "item3" }
c) [ "item1", "item2", "item3" ]
d) ("item1", "item2", "item3")
Answer: c) [ "item1", "item2", "item3" ]
9. Which of the following is an invalid JSON object?
a) {"name": "John", "age": 30}
b) {"name": "John", "age": null}
c) {"name": "John", age: 30}
d) {"name": "John", "isActive": true}
Answer: c) {"name": "John", age: 30}
10. What is the correct way to represent a null value in JSON?
a) "null"
b) null
c) null
d) "None"
Answer: c) null
11. Which of the following characters is used to separate key-value pairs in
JSON?
a) ;
b) :
c) ,
d) =
Answer: b) :
12. In JSON, keys must always be...
a) Strings enclosed in double quotes
b) Numbers
c) Strings without quotes
d) Arrays
Answer: a) Strings enclosed in double quotes
13. How would you represent a number in JSON?
a) {"number": 100}
b) {"number": "100"}
c) {"number": 100.0}
d) {"number": "100.0"}
Answer: a) {"number": 100}
14. Which of the following is true about JSON?
a) JSON can contain functions
b) JSON supports single-line comments
c) JSON does not support functions or comments
d) JSON uses single quotes for strings
Answer: c) JSON does not support functions or comments
15. What is the purpose of JSON.parse() in JavaScript?
a) Converts a JSON string to a JavaScript object
b) Converts a JavaScript object to a JSON string
c) Checks if a string is valid JSON
d) Retrieves data from a JSON file
Answer: a) Converts a JSON string to a JavaScript object
16. Which of the following data types is NOT supported in JSON?
a) Object
b) String
c) Date
d) Function
Answer: d) Function
17. What is the JSON syntax for representing a boolean value?
a) "true"
b) "false"
c) true
d) false
Answer: c) true
18. What is the correct way to include a JSON object inside an array?
a) [ {"name": "John"}, {"name": "Jane"} ]
b) [ {name: "John"}, {name: "Jane"} ]
c) { "name": "John", "name": "Jane" }
d) { ["name": "John", "name": "Jane"] }
Answer: a) [ {"name": "John"}, {"name": "Jane"} ]
19. What does JSON.stringify() do?
a) Converts a string to JSON
b) Converts a JSON object to a JavaScript object
c) Converts a JavaScript object to a JSON string
d) Parses a JSON string into a JavaScript object
Answer: c) Converts a JavaScript object to a JSON string
20. How would you check if a string is a valid JSON string in JavaScript?
a) Use try...catch with JSON.parse()
b) Use JSON.isValid()
c) Use JSON.stringify()
d) Use typeof to check if it's a string
Answer: a) Use try...catch with JSON.parse()
21. Can JSON objects contain methods or functions?
a) Yes, methods can be defined inside JSON
b) No, JSON cannot contain functions or methods
c) Yes, methods can be used with strings only
d) Yes, but only with the function keyword
Answer: b) No, JSON cannot contain functions or methods
22. Which of the following is the correct syntax to represent an array in
JSON?
a) ["apple", "banana", "cherry"]
b) {"apple", "banana", "cherry"}
c) [apple, banana, cherry]
d) {"apple": "banana", "cherry"}
Answer: a) ["apple", "banana", "cherry"]
23. Which JSON function is used to convert a JSON string into a JavaScript
object?
a) JSON.stringify()
b) JSON.parse()
c) JSON.convert()
d) JSON.objectify()
Answer: b) JSON.parse()
24. Which of the following is NOT a valid JSON array element?
a) A string
b) A function
c) A number
d) A boolean
Answer: b) A function
25. Which of the following is an example of a valid JSON object with a
boolean value?
a) {"isActive": yes}
b) {"isActive": true}
c) {"isActive": "true"}
d) {"isActive": 1}
Answer: b) {"isActive": true}
26. What is the format used by JSON to represent objects?
a) Key-value pairs
b) Lists
c) Arrays
d) Variables
Answer: a) Key-value pairs
27. What will the following code output? JSON.parse('{"name": "John", "age":
30}')
a) "{"name": "John", "age": 30}"
b) {"name": "John", "age": 30}
c) JavaScript object with name and age properties
d) null
Answer: c) JavaScript object with name and age properties
28. How do you store multiple JSON objects in a single JSON file?
a) Use an array to hold the objects
b) Separate each object with commas
c) Use multiple key-value pairs for each object
d) Store them as strings
Answer: a) Use an array to hold the objects
29. Can JSON be used to represent complex data structures?
a) Yes, it can represent arrays, objects, and nested structures
b) No, it can only represent simple key-value pairs
c) Yes, but only strings and numbers
d) No, it is only for simple data
Answer: a) Yes, it can represent arrays, objects, and nested structures
30. What is the method used to check if a value is a valid JSON string?
a) JSON.validate()
b) try...catch with JSON.parse()
c) JSON.isValid()
d) JSON.check()
Answer: b) try...catch with JSON.parse()
31. Which of the following is true about JSON's support for comments?
a) JSON supports single-line comments using //
b) JSON does not support comments
c) JSON supports multi-line comments using /* */
d) JSON supports comments using <!-- -->
Answer: b) JSON does not support comments
32. Which of the following is a valid JSON value?
a) {"key": "value"}
b) "key: value"
c) "key" = "value"
d) key => value
Answer: a) {"key": "value"}
33. Can JSON represent functions?
a) Yes, using the function keyword
b) No, JSON cannot represent functions
c) Yes, but only anonymous functions
d) Yes, JSON functions can be named
Answer: b) No, JSON cannot represent functions
34. What does JSON.stringify() return?
a) A JavaScript object
b) A JSON string
c) An array
d) A number
Answer: b) A JSON string
35. Which of the following statements is correct?
a) JSON can be used to transmit data between a server and a client
b) JSON is a lightweight data-interchange format
c) JSON is typically used for HTML structure
d) JSON is used only for storing simple key-value pairs
Answer: b) JSON is a lightweight data-interchange format
36. How would you include a JSON object inside another JSON object?
a) {"object1": {"name": "John"}, "object2": {"name": "Jane"}}
b) {"object1": [name: "John"], "object2": [name: "Jane"]}
c) {"object1": {"name": "John"}, "object2": {"name": "Jane"}}
d) {"object1": "John", "object2": "Jane"}
Answer: c) {"object1": {"name": "John"}, "object2": {"name": "Jane"}}
37. Which of the following is NOT a valid way to represent an object in
JSON?
a) {"name": "Alice"}
b) {"age": 25}
c) {"age": (25)}
d) {"isEmployed": true}
Answer: c) {"age": (25)}
38. How is JSON typically used in web development?
a) To style web pages
b) To transmit data between a server and a client
c) To create web page content
d) To execute server-side logic
Answer: b) To transmit data between a server and a client
39. What does JSON.parse() return if the JSON string is invalid?
a) undefined
b) null
c) Throws an error
d) An empty object
Answer: c) Throws an error
40. What is the correct way to represent a string value in JSON?
a) "value"
b) "value" (double quotes)
c) 'value' (single quotes)
d) value without quotes
Answer: b) "value" (double quotes)
41. How can you store a JSON object in the browser's local storage?
a) localStorage.addItem("data", JSON.stringify(object))
b) localStorage.setItem("data", JSON.stringify(object))
c) localStorage.store("data", object)
d) localStorage.putItem("data", object)
Answer: b) localStorage.setItem("data", JSON.stringify(object))
42. Which of the following is a valid JSON array?
a) [1, 2, 3, 4]
b) {1, 2, 3, 4}
c) ["1", "2", "3", "4"]
d) ("1", "2", "3", "4")
Answer: a) [1, 2, 3, 4]
43. What will the following code return? JSON.stringify({"name": "John",
"age": 30})
a) {"name": "John", "age": 30}
b) "{"name": "John", "age": 30}"
c) {name: "John", age: 30}
d) {"name": 'John', "age": 30}
Answer: b) "{"name": "John", "age": 30}"
44. What will JSON.parse('{"name": "John", "age": 30}') return?
a) A JavaScript object with properties name and age
b) A string "{name: John, age: 30}"
c) null
d) A boolean true
Answer: a) A JavaScript object with properties name and age
45. Which of the following is NOT valid in a JSON object?
a) Strings as keys
b) Numbers as values
c) Functions as values
d) Booleans as values
Answer: c) Functions as values
46. How do you convert a JSON object back into a JavaScript object?
a) Use JSON.parse()
b) Use JSON.stringify()
c) Use JSON.objectify()
d) Use JSON.toObject()
Answer: a) Use JSON.parse()
47. Can JSON contain dates?
a) No, JSON does not have a specific date type
b) Yes, but only as string values
c) Yes, JSON has a specific date format
d) Yes, using the Date keyword
Answer: a) No, JSON does not have a specific date type
48. Which of the following is a valid JSON object with an array value?
a) {"name": "John", "children": ["Anna", "Ella"]}
b) {"name": "John", children: ["Anna", "Ella"]}
c) {name: "John", "children": ["Anna", "Ella"]}
d) {name: "John", children: "Anna, Ella"}
Answer: a) {"name": "John", "children": ["Anna", "Ella"]}
49. How do you handle errors when parsing JSON?
a) Use catch to handle exceptions
b) Use try...catch to handle exceptions
c) Use validate()
d) Use isValid()
Answer: b) Use try...catch to handle exceptions
50. What does JSON stand for?
a) JavaScript Object Notation
b) JavaScript Open Notation
c) JavaScript Oriented Network
d) JavaScript Object Navigator
Answer: a) JavaScript Object Notation
AJAX
1. What does AJAX stand for?
a) Asynchronous JavaScript and XML
b) Automated JavaScript and XML
c) Asynchronous JavaScript and XHTML
d) Asynchronous JavaScript and Extensible Markup Language
Answer: a) Asynchronous JavaScript and XML
2. What is the primary purpose of AJAX in web development?
a) To create static web pages
b) To allow asynchronous communication with the server without reloading the
page
c) To manage server-side scripts
d) To style web pages dynamically
Answer: b) To allow asynchronous communication with the server without reloading
the page
3. Which object is used in JavaScript to interact with the server in AJAX?
a) XMLHttpRequest
b) HttpRequest
c) FetchRequest
d) ServerRequest
Answer: a) XMLHttpRequest
4. What does the open() method in XMLHttpRequest do?
a) It sends a request to the server
b) It initializes a new request
c) It closes the connection to the server
d) It waits for the response from the server
Answer: b) It initializes a new request
5. Which method is used to send the request in AJAX?
a) sendRequest()
b) send()
c) post()
d) request()
Answer: b) send()
6. What type of data can be returned from an AJAX call?
a) Only XML
b) XML, JSON, HTML, and plain text
c) Only HTML
d) Only JSON
Answer: b) XML, JSON, HTML, and plain text
7. What is the default request method used in AJAX?
a) GET
b) POST
c) PUT
d) DELETE
Answer: a) GET
8. Which of the following events is fired when an AJAX request completes?
a) onload
b) onreadystatechange
c) oncomplete
d) onfinish
Answer: b) onreadystatechange
9. What does the readyState property of XMLHttpRequest represent?
a) The status code of the response
b) The type of request being made
c) The current state of the request
d) The size of the response data
Answer: c) The current state of the request
10. What is the value of readyState when the request has been successfully
completed?
a) 0
b) 1
c) 4
d) 5
Answer: c) 4
11. Which method can be used to retrieve the status of an AJAX request?
a) statusCode()
b) getStatus()
c) status
d) responseStatus()
Answer: c) status
12. What is the purpose of the onreadystatechange event handler in AJAX?
a) To monitor changes in the state of the request
b) To handle the response data
c) To handle the server errors
d) To close the request
Answer: a) To monitor changes in the state of the request
13. How can you send data to the server with an AJAX request?
a) Using queryString()
b) Using send() method with parameters
c) Using request()
d) Using sendToServer()
Answer: b) Using send() method with parameters
14. How does the XMLHttpRequest object communicate with the server?
a) By using TCP/IP
b) By using HTTP or HTTPS protocol
c) By using FTP
d) By using WebSockets
Answer: b) By using HTTP or HTTPS protocol
15. Which of the following methods is used to send a GET request in AJAX?
a) send()
b) open()
c) request()
d) get()
Answer: b) open()
16. What is the purpose of using AJAX in web pages?
a) To enable faster and smoother web page interactions
b) To increase page load time
c) To improve server security
d) To prevent web pages from loading
Answer: a) To enable faster and smoother web page interactions
17. What does the responseText property of XMLHttpRequest provide?
a) The response body as a string
b) The status code of the response
c) The response headers
d) The content type of the response
Answer: a) The response body as a string
18. Which of the following is true about the GET method in AJAX?
a) It sends data to the server
b) It retrieves data from the server
c) It is slower than POST
d) It sends a secure connection to the server
Answer: b) It retrieves data from the server
19. In AJAX, which of the following is used to handle errors?
a) onerror
b) onreadystatechange with error handling
c) catchError()
d) handleError()
Answer: b) onreadystatechange with error handling
20. Which HTTP method is generally used for submitting data with AJAX
requests?
a) GET
b) POST
c) PUT
d) DELETE
Answer: b) POST
21. What does responseXML property of XMLHttpRequest return?
a) The response body as a plain text
b) The response as XML document
c) The response body as a string
d) The status code of the response
Answer: b) The response as XML document
22. What type of request is used when submitting data to a server in AJAX?
a) POST request
b) PUT request
c) GET request
d) DELETE request
Answer: a) POST request
23. What is the default content type for AJAX requests?
a) application/x-www-form-urlencoded
b) text/plain
c) application/json
d) text/html
Answer: a) application/x-www-form-urlencoded
24. How do you send JSON data to the server using AJAX?
a) By setting the Content-Type header to application/json and using
JSON.stringify()
b) By using sendToServer() method
c) By appending data in the URL
d) By sending data as a query string
Answer: a) By setting the Content-Type header to application/json and using
JSON.stringify()
25. Which of the following is used to monitor the status of an AJAX request?
a) readyState
b) statusCode
c) requestStatus
d) responseStatus
Answer: a) readyState
26. What does the status property of XMLHttpRequest represent?
a) The server error code
b) The HTTP response status code
c) The type of content being returned
d) The readiness of the request
Answer: b) The HTTP response status code
27. What type of responses can be handled by AJAX?
a) Only plain text
b) Only HTML
c) XML, JSON, HTML, and plain text
d) Only JSON
Answer: c) XML, JSON, HTML, and plain text
28. Which of the following methods in JavaScript can be used to make AJAX
requests?
a) HttpRequest()
b) XMLHttpRequest()
c) fetch()
d) Both b and c
Answer: d) Both b and c
29. What does XMLHttpRequest.readyState value of 4 indicate?
a) The request is still processing
b) The request has completed
c) The server is unavailable
d) The request is being initialized
Answer: b) The request has completed
30. Which of the following libraries simplifies AJAX requests in JavaScript?
a) jQuery
b) Axios
c) React
d) Vue.js
Answer: a) jQuery
31. Which of the following events can be used to execute code after an AJAX
request has completed successfully?
a) onload
b) onchange
c) onabort
d) onerror
Answer: a) onload
32. What is the main advantage of AJAX over traditional HTML form
submissions?
a) It allows forms to be submitted without JavaScript
b) It allows pages to update asynchronously without reloading
c) It handles only small amounts of data
d) It ensures form data is sent via secure protocols
Answer: b) It allows pages to update asynchronously without reloading
33. How do you specify the method type (GET, POST, etc.) in an AJAX
request?
a) By passing the method type as the second argument in open()
b) By setting the method in setRequestMethod()
c) By using requestType()
d) By passing the method type in the URL
Answer: a) By passing the method type as the second argument in open()
34. How does AJAX improve user experience on web pages?
a) By allowing parts of the page to update dynamically without a full reload
b) By making pages load faster on initial visit
c) By reducing the amount of JavaScript required
d) By making websites easier to deploy
Answer: a) By allowing parts of the page to update dynamically without a full reload
35. Can AJAX requests be sent asynchronously?
a) Yes, by default AJAX requests are asynchronous
b) No, AJAX can only send synchronous requests
c) Yes, but only for GET requests
d) No, asynchronous requests are not supported in AJAX
Answer: a) Yes, by default AJAX requests are asynchronous
36. What is the typical role of AJAX in Single Page Applications (SPA)?
a) To retrieve data and update parts of the page dynamically
b) To handle user authentication
c) To manage static assets like images
d) To enable server-side rendering
Answer: a) To retrieve data and update parts of the page dynamically
37. Which of the following is a feature of AJAX?
a) It can send requests without reloading the page
b) It cannot interact with the server after the page has loaded
c) It can only send data in JSON format
d) It uses only synchronous requests
Answer: a) It can send requests without reloading the page
38. How do you handle multiple AJAX requests in parallel?
a) Use XMLHttpRequest.parallel()
b) Use Promise.all() or multiple XMLHttpRequest instances
c) Use async functions only
d) Use await for each request
Answer: b) Use Promise.all() or multiple XMLHttpRequest instances
39. What happens if an AJAX request fails?
a) The page reloads automatically
b) The browser displays an error message
c) The onerror event handler is triggered
d) The request is automatically retried
Answer: c) The onerror event handler is triggered
40. What type of data is commonly returned from an AJAX request?
a) Only XML data
b) XML, JSON, or HTML data
c) Only JSON data
d) Only plain text
Answer: b) XML, JSON, or HTML data
41. Which of the following is a way to process data in AJAX?
a) Use JSON.parse() to convert JSON data into JavaScript objects
b) Use parseXML() to parse XML data into DOM objects
c) Both a and b
d) None of the above
Answer: c) Both a and b
42. Can AJAX be used for file uploads?
a) No, AJAX is not suitable for file uploads
b) Yes, by using FormData and XMLHttpRequest
c) Yes, but only with images
d) Yes, using the FileUpload() method
Answer: b) Yes, by using FormData and XMLHttpRequest
43. What is a common error handler for AJAX?
a) try...catch block
b) errorHandler()
c) onexception()
d) catchError()
Answer: a) try...catch block
44. What is the role of onload event handler in AJAX?
a) It runs when the request is completed successfully
b) It runs before the request is sent
c) It runs when the server is unreachable
d) It handles the response status
Answer: a) It runs when the request is completed successfully
45. How do you send a PUT request using AJAX?
a) Set the method type to PUT using the open() method and use send()
b) Use request() with the PUT method
c) Use open() method with PUT as a parameter and post() method
d) Use PUT() method
Answer: a) Set the method type to PUT using the open() method and use send()
46. What is the purpose of AJAX in a RESTful API?
a) To asynchronously send and receive data between the client and server
b) To manage API authentication
c) To encrypt data before sending it
d) To cache API responses
Answer: a) To asynchronously send and receive data between the client and server
47. Which of the following can be used to handle the success of an AJAX
request in jQuery?
a) success() method
b) onSuccess() method
c) complete() method
d) responseSuccess()
Answer: a) success() method
48. How do you handle asynchronous errors in AJAX using XMLHttpRequest?
a) Using onerror event handler
b) Using catch() method
c) Using oncomplete handler
d) Using fail() method
Answer: a) Using onerror event handler
49. Can you use AJAX with WebSockets for real-time communication?
a) Yes, both can be used for real-time data transmission
b) No, AJAX is not suitable for real-time communication
c) Yes, but only with HTTP requests
d) No, WebSockets replace AJAX
Answer: a) Yes, both can be used for real-time data transmission
50. What is the main advantage of AJAX over traditional synchronous
requests?
a) It allows non-blocking, asynchronous communication
b) It is easier to implement
c) It reduces server load
d) It prevents server errors
Answer: a) It allows non-blocking, asynchronous communication
XML
1. What does XML stand for?
a) Extensible Markup Language
b) External Markup Language
c) Extra Markup Language
d) Extended Markup Language
Answer: a) Extensible Markup Language
2. Which of the following is the correct syntax for an XML document?
a) <book><title>XML for Beginners</title></book>
b) <book><title>XML for Beginners</title></book>
c) <book><title>XML for Beginners</title>
d) book><title>XML for Beginners/title></book>
Answer: b) <book><title>XML for Beginners</title></book>
3. What is the root element in an XML document?
a) The top-level element that contains all other elements
b) The element that holds attributes
c) The element that contains text content
d) The element that defines the structure
Answer: a) The top-level element that contains all other elements
4. Which of the following is NOT a valid XML tag?
a) <xml>
b) <book>
c) <1book>
d) <title>
Answer: c) <1book>
5. Which of the following is the correct way to define an attribute in XML?
a) <book title="XML for Beginners">
b) <book title="XML for Beginners">
c) <book="title:XML for Beginners">
d) <book "title=XML for Beginners">
Answer: b) <book title="XML for Beginners">
6. What is the primary purpose of XML?
a) To define the presentation of data
b) To store and transport data
c) To style data
d) To connect data to a database
Answer: b) To store and transport data
7. Which of the following is NOT an advantage of XML?
a) Self-descriptive data structure
b) Platform-independent
c) Limited data types
d) Human-readable
Answer: c) Limited data types
8. What is the XML declaration used for?
a) To specify the version of the XML document
b) To define the XML version and encoding
c) To declare the root element
d) To define the content type
Answer: b) To define the XML version and encoding
9. What is the correct syntax for an XML declaration?
a) <xml version="1.0" encoding="UTF-8">
b) <?xml version="1.0" encoding="UTF-8"?>
c) <xml version="1.0"?>
d) <?xml version="UTF-8"?>
Answer: b) <?xml version="1.0" encoding="UTF-8"?>
10. Which of the following is a valid XML comment?
a) <!-- This is a comment -->
b) <!-- This is a comment
c) <!-- This is a comment -->
d) <-- This is a comment -->
Answer: a) <!-- This is a comment -->
11. What is an XML schema used for?
a) To define the structure and data types of XML documents
b) To style the XML content
c) To store XML documents in a database
d) To provide an interface for XML data
Answer: a) To define the structure and data types of XML documents
12. Which of the following is an example of a well-formed XML document?
a) <book><title>XML for Beginners</book>
b) <book><title>XML for Beginners</title></book>
c) <book><title>XML for Beginners</title></book>
d) <book><title>XML for Beginners</book></title>
Answer: c) <book><title>XML for Beginners</title></book>
13. Which of the following is true about XML tags?
a) XML tags are case-sensitive
b) XML tags are case-insensitive
c) XML tags cannot have attributes
d) XML tags must be written in lowercase
Answer: a) XML tags are case-sensitive
14. What is the maximum number of attributes an element can have in XML?
a) 1
b) 10
c) Unlimited
d) 100
Answer: c) Unlimited
15. Which of the following is the correct syntax for self-closing an XML tag?
a) <book/>
b) <book/>
c) <book></book>
d) <book><book/>
Answer: b) <book/>
16. Which of the following is a valid XML element name?
a) 1book
b) book1
c) #book
d) book-1
Answer: b) book1
17. Which of the following characters is not allowed in XML element names?
a) Letter
b) Number
c) Space
d) Hyphen
Answer: c) Space
18. How is data typically transmitted in XML format?
a) As a URL
b) As plain text
c) As binary data
d) As a form submission
Answer: b) As plain text
19. Which of the following is the correct way to represent data in XML
format?
a) <data value="10">
b) <value>10</value>
c) <value>10</value>
d) <data>10</data>
Answer: c) <value>10</value>
20. What does it mean for an XML document to be well-formed?
a) It contains no syntax errors and follows XML rules
b) It follows all rules for XML and has a valid structure
c) It includes an XML schema
d) It has valid data types and values
Answer: a) It contains no syntax errors and follows XML rules
21. What does XML stand for?
a) Extensible Markup Language
b) Extended Markup Language
c) External Markup Language
d) Extra Markup Language
Answer: a) Extensible Markup Language
22. Which is the correct way to define an attribute in XML?
a) <book title="XML for Beginners">
b) <book title="XML for Beginners">
c) <book="title:XML for Beginners">
d) <book "title=XML for Beginners">
Answer: b) <book title="XML for Beginners">
23. Which of the following is an example of an XML element?
a) <book>
b) <book>
c) <title>
d) <p>
Answer: b) <book>
24. How does XML differ from HTML?
a) XML is used to define the structure of a document, while HTML is used for
presentation
b) XML focuses on data storage, while HTML focuses on document structure
c) XML is used to style documents, while HTML is used for structure
d) There is no difference
Answer: a) XML is used to define the structure of a document, while HTML is used for
presentation
25. What is the purpose of XML namespaces?
a) To define the content of an XML document
b) To avoid name conflicts in XML documents
c) To encode data into XML format
d) To make XML documents smaller
Answer: b) To avoid name conflicts in XML documents
26. Which of the following is true about XML?
a) It is used to style documents
b) It is used to store and transport data
c) It is used for creating web pages
d) It is used to generate dynamic content
Answer: b) It is used to store and transport data
27. Which of the following is a valid XML tag?
a) <1book>
b) book><title>
c) <book><title>XML for Beginners</title></book>
d) <book><title>XML for Beginners</book>
Answer: c) <book><title>XML for Beginners</title></book>
28. How is an XML element's value represented?
a) By using attributes
b) By enclosing the data within opening and closing tags
c) By encoding the data into hexadecimal
d) By using a comment
Answer: b) By enclosing the data within opening and closing tags
29. How does XML ensure data validity?
a) By using HTML tags
b) By using XML schema definitions (XSD)
c) By validating against CSS
d) By using DTDs (Document Type Definitions)
Answer: b) By using XML schema definitions (XSD)
30. Which of the following is an example of a valid XML comment?
a) <!-- This is a comment -->
b) <!-- This is a comment -->
c) <!-- This is a comment
d) <-- This is a comment -->
Answer: a) <!-- This is a comment -->
31. What is the role of the <!DOCTYPE> declaration in XML?
a) To specify the character encoding
b) To define the document type
c) To validate the data structure
d) To format the data
Answer: b) To define the document type
32. What is the correct way to close an XML tag?
a) <book></book>
b) <book/><book>
c) <book></book>
d) book><book>
Answer: a) <book></book>
33. What is a well-formed XML document?
a) A document that follows XML syntax rules without errors
b) A document with valid elements
c) A document that uses XML schema
d) A document with an XML declaration
Answer: a) A document that follows XML syntax rules without errors
34. How can you format XML data for human readability?
a) Using CSS
b) By adding proper indentation and line breaks
c) By adding comments
d) By using XML parsers
Answer: b) By adding proper indentation and line breaks
35. Which of the following is a key feature of XML?
a) It is extensible and allows the definition of custom tags
b) It is only used for web pages
c) It is not case-sensitive
d) It is limited to certain data types
Answer: a) It is extensible and allows the definition of custom tags
36. Which of the following is an example of an XML entity?
a) <
b) <
c) &xml;
d) &xmlsymbol;
Answer: b) <
37. Which of the following is used to validate an XML document?
a) XML Schema (XSD)
b) HTML validator
c) DTD validator
d) CSS validator
Answer: a) XML Schema (XSD)
38. What is the purpose of an XML namespace?
a) To avoid element name conflicts
b) To define the character encoding
c) To specify the format of the data
d) To validate the document
Answer: a) To avoid element name conflicts
39. What is the role of the XML parser?
a) To read and convert XML data into a usable structure
b) To validate XML documents
c) To generate dynamic content
d) To convert XML to HTML
Answer: a) To read and convert XML data into a usable structure
40. How do you indicate an empty element in XML?
a) By using a self-closing tag
b) By omitting the closing tag
c) By setting the element value to "empty"
d) By using a comment
Answer: a) By using a self-closing tag
41. What is an XML entity used for?
a) To represent special characters like < or >
b) To store binary data
c) To format XML data
d) To encode XML documents
Answer: a) To represent special characters like < or >
42. Which of the following is a valid way to define a comment in XML?
a) /* This is a comment */
b) <!-- This is a comment -->
c) -- This is a comment --
d) <comment>This is a comment</comment>
Answer: b) <!-- This is a comment -->
43. What is the role of a DTD (Document Type Definition) in XML?
a) To define the legal structure and rules for an XML document
b) To specify the XML version
c) To validate the XML document
d) To declare the namespace
Answer: a) To define the legal structure and rules for an XML document
44. Which of the following is used to extract data from an XML document in
JavaScript?
a) getElementById()
b) getElementsByTagName()
c) getElementsByTagName()
d) getAttribute()
Answer: b) getElementsByTagName()
45. How do you define an attribute in XML?
a) <book name="XML for Beginners">
b) <book title="XML for Beginners">
c) <book>title="XML for Beginners"</book>
d) <book title="XML for Beginners" />
Answer: b) <book title="XML for Beginners">
46. What is the purpose of the XML declaration?
a) To specify the XML version and encoding
b) To define the root element
c) To declare the data type
d) To specify the structure of the document
Answer: a) To specify the XML version and encoding
47. Which of the following statements about XML tags is correct?
a) XML tags must be properly nested
b) XML tags are case-insensitive
c) XML tags must use only uppercase letters
d) XML tags cannot have attributes
Answer: a) XML tags must be properly nested
48. What is the default encoding for XML documents?
a) ASCII
b) UTF-8
c) ISO-8859-1
d) UTF-16
Answer: b) UTF-8
49. What does it mean for XML to be self-descriptive?
a) It defines how the document is presented
b) It uses custom tags that describe the data
c) It is only readable by computers
d) It can automatically convert into HTML
Answer: b) It uses custom tags that describe the data
50. Which of the following is true about XML and its content?
a) XML can only contain text
b) XML can store data in any format
c) XML can only store numeric data
d) XML is used only for web pages
Answer: b) XML can store data in any format
WEB SERVERS
1. What is the primary role of a web server?
a) To serve web pages to users' browsers
b) To run client-side scripts
c) To store data on a database
d) To connect devices to the internet
Answer: a) To serve web pages to users' browsers
2. Which of the following is an example of a popular web server software?
a) MySQL
b) Apache HTTP Server
c) PHP
d) MongoDB
Answer: b) Apache HTTP Server
3. Which HTTP method is used to retrieve data from a web server?
a) GET
b) POST
c) PUT
d) DELETE
Answer: a) GET
4. What does the acronym "HTTP" stand for?
a) Hypertext Transfer Protocol
b) Hyper Transfer Text Protocol
c) Hyperlink Transfer Protocol
d) High Transfer Text Protocol
Answer: a) Hypertext Transfer Protocol
5. What does the "www" in a web URL refer to?
a) Web World Wide
b) World Wide Web
c) Web Workgroup
d) World Wide Website
Answer: b) World Wide Web
6. Which of the following is NOT a type of web server?
a) Apache HTTP Server
b) Java Server Pages (JSP)
c) Nginx
d) Microsoft IIS
Answer: b) Java Server Pages (JSP)
7. What is the purpose of a reverse proxy server?
a) To block malicious traffic
b) To cache web pages
c) To forward client requests to another server
d) To serve dynamic content
Answer: c) To forward client requests to another server
8. Which of the following web servers is open-source?
a) Apache HTTP Server
b) Microsoft IIS
c) Oracle WebLogic
d) IBM HTTP Server
Answer: a) Apache HTTP Server
9. Which of the following is a common web server port?
a) 25
b) 80
c) 443
d) 21
Answer: b) 80
10. What protocol does HTTPS use to encrypt data?
a) FTP
b) SSL/TLS
c) HTTP
d) SSH
Answer: b) SSL/TLS
11. What is the main advantage of using a web server like Nginx over Apache?
a) Nginx supports SSL by default
b) Nginx is more efficient in handling concurrent connections
c) Nginx uses fewer system resources
d) Nginx is better suited for dynamic content
Answer: b) Nginx is more efficient in handling concurrent connections
12. What is an SSL certificate used for in a web server?
a) To increase the speed of the server
b) To secure communications between the server and client
c) To monitor server performance
d) To enhance server storage capacity
Answer: b) To secure communications between the server and client
13. Which of the following is a static web server file extension?
a) .html
b) .php
c) .asp
d) .js
Answer: a) .html
14. Which server software is typically used for Windows servers?
a) Nginx
b) Microsoft IIS
c) Apache HTTP Server
d) Lighttpd
Answer: b) Microsoft IIS
15. What does the "Document Root" refer to in a web server?
a) The root directory where user files are stored
b) The folder where the server's web files are stored
c) The root of the server's operating system
d) The server's main log files location
Answer: b) The folder where the server's web files are stored
16. What is the default port number for HTTPS?
a) 21
b) 443
c) 80
d) 8080
Answer: b) 443
17. Which web server feature allows the distribution of traffic to multiple
servers?
a) Content Management System (CMS)
b) Load balancing
c) Firewall filtering
d) Access control
Answer: b) Load balancing
18. Which web server is known for its high performance and low resource
usage?
a) Apache HTTP Server
b) Nginx
c) Microsoft IIS
d) LiteSpeed
Answer: b) Nginx
19. What is a web server's "log file" used for?
a) To store website content
b) To store server data
c) To record server activities and errors
d) To manage database transactions
Answer: c) To record server activities and errors
20. What is a typical feature of a "dedicated web server"?
a) It is used by only one client
b) It serves multiple websites on a single server
c) It provides email services
d) It handles external data storage
Answer: a) It is used by only one client
21. What does the term "Virtual Hosting" mean in web servers?
a) Hosting multiple websites on a single server
b) Hosting a website on multiple servers
c) Hosting websites on a cloud infrastructure
d) Hosting a single website in multiple locations
Answer: a) Hosting multiple websites on a single server
22. Which of the following can a web server do?
a) Handle client requests and serve content
b) Execute JavaScript on the client-side
c) Run desktop applications
d) Edit and compile code
Answer: a) Handle client requests and serve content
23. What is the main advantage of using a CDN (Content Delivery Network)
with a web server?
a) To store data locally on the web server
b) To distribute content globally and reduce latency
c) To host dynamic web applications
d) To increase the web server's disk space
Answer: b) To distribute content globally and reduce latency
24. What is a "web application firewall" used for in relation to web servers?
a) To protect the server from malicious traffic and attacks
b) To prevent access to static files
c) To encrypt traffic between the server and client
d) To cache content for faster delivery
Answer: a) To protect the server from malicious traffic and attacks
25. What kind of web server is used for serving dynamic web content?
a) FTP Server
b) Application Server
c) DNS Server
d) Cache Server
Answer: b) Application Server
26. What is an example of a dynamic content generation method used by web
servers?
a) Static HTML files
b) PHP scripts
c) Image files
d) XML files
Answer: b) PHP scripts
27. What is the function of an "Apache worker" process?
a) It handles incoming client requests in Apache HTTP Server
b) It stores static content in cache
c) It monitors server performance
d) It encrypts client-server communication
Answer: a) It handles incoming client requests in Apache HTTP Server
28. Which of the following is a disadvantage of shared hosting?
a) High cost
b) Limited server resources
c) Easy to scale
d) Complete control over the server
Answer: b) Limited server resources
29. What is "caching" in the context of web servers?
a) Storing copies of web content to reduce server load
b) Compressing content to save bandwidth
c) Encrypting web traffic
d) Distributing content across multiple servers
Answer: a) Storing copies of web content to reduce server load
30. What is the role of a web server in the HTTP request-response cycle?
a) To handle incoming requests and send back responses
b) To process user input from forms
c) To store and manage databases
d) To execute client-side scripts
Answer: a) To handle incoming requests and send back responses
31. Which of the following is true about the difference between a web server
and a database server?
a) A web server serves web pages, while a database server manages databases
b) A web server stores data, while a database server serves web pages
c) A web server and a database server perform the same functions
d) A web server handles HTTP requests, and a database server handles HTTPS
requests
Answer: a) A web server serves web pages, while a database server manages databases
32. Which HTTP status code indicates a successful request?
a) 500
b) 200
c) 404
d) 301
Answer: b) 200
33. What is a "404 error" in a web server response?
a) Server error
b) Page not found
c) Unauthorized access
d) Forbidden access
Answer: b) Page not found
34. What does "URL rewriting" on a web server do?
a) Changes the layout of a website
b) Modifies the URL path for SEO or functionality reasons
c) Redirects traffic to another website
d) Blocks malicious traffic
Answer: b) Modifies the URL path for SEO or functionality reasons
35. Which web server is preferred for static websites due to its efficiency?
a) Nginx
b) Microsoft IIS
c) Apache HTTP Server
d) Tomcat
Answer: a) Nginx
36. Which of the following web servers is designed to handle high traffic
websites?
a) Microsoft IIS
b) Nginx
c) Apache HTTP Server
d) WAMP
Answer: b) Nginx
37. What is the "load balancer" feature in web servers used for?
a) To distribute client requests across multiple servers
b) To increase the server's speed
c) To limit the traffic to a server
d) To store backups of web data
Answer: a) To distribute client requests across multiple servers
38. How do web servers typically handle SSL/TLS encryption?
a) Through a dedicated hardware device
b) By installing an SSL certificate
c) Through a proxy server
d) By using HTTP/2
Answer: b) By installing an SSL certificate
39. Which web server can be used for Java-based web applications?
a) Microsoft IIS
b) Apache Tomcat
c) Nginx
d) LiteSpeed
Answer: b) Apache Tomcat
40. What does "HTTPS" signify in a web server's URL?
a) The connection is encrypted
b) The website is dynamic
c) The server is running HTTP/2
d) The server is running HTTP
Answer: a) The connection is encrypted
41. Which of the following is true about static web servers?
a) They generate dynamic content in real-time
b) They serve fixed content that doesn't change
c) They process user input
d) They use a database for content generation
Answer: b) They serve fixed content that doesn't change
42. What does a web server log file typically contain?
a) A list of database transactions
b) Information about client requests and errors
c) A copy of the website content
d) Information about server configuration
Answer: b) Information about client requests and errors
43. Which of the following server types typically handles server-side
scripting?
a) Application servers
b) DNS servers
c) Web servers
d) Proxy servers
Answer: a) Application servers
44. What is the "Keep-Alive" feature in web servers used for?
a) To keep the connection open for multiple requests
b) To send periodic status updates
c) To refresh the server automatically
d) To encrypt client-server communication
Answer: a) To keep the connection open for multiple requests
45. What is the default behavior of a web server when it encounters a 500
error?
a) Redirects to another page
b) Returns an internal server error
c) Returns a page not found error
d) Redirects to a maintenance page
Answer: b) Returns an internal server error
46. Which of the following is used to configure a web server?
a) Configuration files (e.g., httpd.conf for Apache)
b) Web browser settings
c) Client-side scripts
d) URL structure
Answer: a) Configuration files (e.g., httpd.conf for Apache)
47. What is the role of a "proxy server" in web hosting?
a) It stores static files for faster delivery
b) It acts as an intermediary between client and web server
c) It caches dynamic content
d) It encrypts server traffic
Answer: b) It acts as an intermediary between client and web server
48. What is the typical method for securing a web server against malicious
attacks?
a) Installing security patches and using firewalls
b) Using open-source software
c) Increasing server speed
d) Storing sensitive data in the database
Answer: a) Installing security patches and using firewalls
49. Which of the following is a feature of a web server in a content
management system (CMS)?
a) It delivers content based on user requests
b) It compiles the CMS code
c) It manages database operations
d) It executes scripts
Answer: a) It delivers content based on user requests
50. What is the primary purpose of a DNS server in relation to web servers?
a) To resolve domain names to IP addresses
b) To manage website content
c) To deliver dynamic content
d) To serve as a backup server
Answer: a) To resolve domain names to IP addresses
SERVER PROGRAMMING LANGUAGE
1. Which of the following is the primary feature of Java in server-side
programming?
a) Cross-platform compatibility
b) Multithreading support
c) Rich graphical interfaces
d) Limited scalability
Answer: b) Multithreading support
2. Which Java framework is primarily used for building web applications on
the server side?
a) Hibernate
b) Spring
c) JavaFX
d) Swing
Answer: b) Spring
3. What is the role of a Servlet in Java server programming?
a) To handle database connections
b) To process HTTP requests and generate HTTP responses
c) To manage user authentication
d) To compile Java code
Answer: b) To process HTTP requests and generate HTTP responses
4. Which of the following is used to manage database connections in Java?
a) JDBC (Java Database Connectivity)
b) JDK
c) JavaMail
d) JavaFX
Answer: a) JDBC (Java Database Connectivity)
5. Which Java class is used to create a HTTP server socket?
a) Socket
b) ServerSocket
c) HttpServlet
d) HttpURLConnection
Answer: b) ServerSocket
6. What does JSP (JavaServer Pages) allow you to do?
a) Create server-side applications in Java
b) Embed Java code in HTML pages
c) Manage Java database connections
d) Create graphical user interfaces
Answer: b) Embed Java code in HTML pages
7. Which of the following is NOT a Java server-side technology?
a) Servlets
b) JavaFX
c) JSP
d) EJB (Enterprise JavaBeans)
Answer: b) JavaFX
8. Which of the following Java technologies is used for distributed computing?
a) JSP
b) RMI (Remote Method Invocation)
c) JDBC
d) JSP
Answer: b) RMI (Remote Method Invocation)
9. What does the @WebServlet annotation do in Java?
a) It marks a class as a servlet
b) It defines a JSP page
c) It configures a database connection
d) It defines a server endpoint
Answer: a) It marks a class as a servlet
10. Which Java framework simplifies web application development with MVC
(Model-View-Controller) architecture?
a) Spring MVC
b) EJB
c) JavaFX
d) Hibernate
Answer: a) Spring MVC
11. What is the purpose of the doGet() method in a Servlet?
a) To process HTTP POST requests
b) To process HTTP GET requests
c) To initialize the servlet
d) To close the servlet
Answer: b) To process HTTP GET requests
12. Which of the following is used to configure a web application in Java?
a) web.xml
b) .java
c) JSP
d) .class
Answer: a) web.xml
13. What is the main advantage of using EJB (Enterprise JavaBeans)?
a) They provide a graphical user interface for servers
b) They simplify the development of distributed applications
c) They are used for client-side programming
d) They enable database access directly
Answer: b) They simplify the development of distributed applications
14. Which of the following methods are part of the Servlet interface?
a) doGet() and doPost()
b) init() and destroy()
c) doPut() and doDelete()
d) handleRequest() and generateResponse()
Answer: b) init() and destroy()
15. Which Java class is used to connect to a database in JDBC?
a) Connection
b) Statement
c) Driver
d) ResultSet
Answer: a) Connection
16. Which of the following is an annotation-based approach in Java for
dependency injection?
a) @Autowired
b) @Inject
c) @Bean
d) @Entity
Answer: a) @Autowired
17. What is the default scope of a Spring bean?
a) Singleton
b) Prototype
c) Request
d) Session
Answer: a) Singleton
18. Which of the following protocols is primarily used in Java for server-side
communication?
a) FTP
b) HTTP
c) SMTP
d) Telnet
Answer: b) HTTP
19. What is a major feature of Java EE (Enterprise Edition)?
a) It is focused on creating desktop applications
b) It is focused on developing large-scale, distributed applications
c) It supports only web-based applications
d) It does not support databases
Answer: b) It is focused on developing large-scale, distributed applications
20. Which Java class is used to read input from the user in a server-side
application?
a) BufferedReader
b) PrintWriter
c) Scanner
d) StringReader
Answer: a) BufferedReader
21. In which file do you typically configure a Spring Boot application?
a) application.properties
b) spring.xml
c) config.yml
d) app.js
Answer: a) application.properties
22. What is the primary role of the doPost() method in a servlet?
a) To handle requests from a database
b) To process HTTP POST requests
c) To handle errors in the server
d) To initialize a session
Answer: b) To process HTTP POST requests
23. Which Java framework is used for ORM (Object-Relational Mapping)?
a) Hibernate
b) Spring
c) JSP
d) Struts
Answer: a) Hibernate
24. What is the default file extension for a Java servlet?
a) .java
b) .class
c) .jsp
d) .html
Answer: a) .java
25. What is the use of the @Entity annotation in Java?
a) It marks a class as a Spring component
b) It marks a class as a JPA (Java Persistence API) entity
c) It marks a method as a transaction
d) It marks a service class in Spring
Answer: b) It marks a class as a JPA (Java Persistence API) entity
26. What is the function of session.getAttribute() in a Java servlet?
a) To set a session variable
b) To retrieve a session attribute
c) To initialize a session
d) To remove a session attribute
Answer: b) To retrieve a session attribute
27. Which of the following is a method in the java.sql.Statement class used for
executing SQL queries?
a) executeQuery()
b) executeUpdate()
c) execute()
d) All of the above
Answer: d) All of the above
28. What is the role of the Spring @RestController annotation?
a) It marks a class for database operations
b) It marks a controller class in RESTful services
c) It marks a class for GUI development
d) It configures HTTP security
Answer: b) It marks a controller class in RESTful services
29. Which Java library is used to create web services?
a) JavaFX
b) JAX-RS (Java API for RESTful Web Services)
c) JavaMail
d) JUnit
Answer: b) JAX-RS (Java API for RESTful Web Services)
30. What is the purpose of the @Service annotation in Spring?
a) To mark a class as a REST endpoint
b) To mark a class as a service layer component
c) To define an entity in JPA
d) To mark a method as a transaction
Answer: b) To mark a class as a service layer component
31. What is the primary role of the Java ExecutorService?
a) To manage and execute concurrent tasks
b) To handle database transactions
c) To manage HTTP requests
d) To create threads manually
Answer: a) To manage and execute concurrent tasks
32. What is the @RequestMapping annotation in Spring used for?
a) To bind a method to an HTTP request
b) To define the URL mapping for controller methods
c) To perform authentication checks
d) To initialize a database
Answer: b) To define the URL mapping for controller methods
33. Which of the following Java methods is used to commit a transaction in
JDBC?
a) commit()
b) commitTransaction()
c) beginTransaction()
d) executeUpdate()
Answer: a) commit()
34. Which of the following Java constructs is used to implement a RESTful
web service?
a) JAX-RS (Java API for RESTful Web Services)
b) Spring Boot
c) EJB
d) RMI
Answer: a) JAX-RS (Java API for RESTful Web Services)
35. What is the purpose of the @Transactional annotation in Spring?
a) To define transaction boundaries in methods
b) To enable authentication
c) To define a REST endpoint
d) To inject dependencies
Answer: a) To define transaction boundaries in methods
36. Which of the following is the default method for sending HTTP requests in
Java?
a) HttpURLConnection
b) ServerSocket
c) HttpRequest
d) HttpResponse
Answer: a) HttpURLConnection
37. Which Java class is used for reading data from a file in a server-side
application?
a) BufferedWriter
b) BufferedReader
c) FileWriter
d) FileReader
Answer: b) BufferedReader
38. What is the function of the @Repository annotation in Spring?
a) To define a service class
b) To mark a class as a data access component
c) To enable transaction management
d) To configure the application's database
Answer: b) To mark a class as a data access component
39. What is the purpose of the @Component annotation in Spring?
a) To define a database entity
b) To mark a class as a Spring bean
c) To configure a service method
d) To define a REST controller
Answer: b) To mark a class as a Spring bean
40. What is the use of PreparedStatement in JDBC?
a) To execute batch queries
b) To execute precompiled SQL statements efficiently
c) To manage database transactions
d) To handle errors
Answer: b) To execute precompiled SQL statements efficiently
41. What is the role of the @Bean annotation in Spring?
a) To define a controller method
b) To define a Spring bean explicitly
c) To handle HTTP requests
d) To mark a method for dependency injection
Answer: b) To define a Spring bean explicitly
42. What is the role of a Java Session object in web applications?
a) To store database connections
b) To store client-specific data between requests
c) To manage server connections
d) To handle user authentication
Answer: b) To store client-specific data between requests
43. Which of the following Java classes is used for session management in a
web application?
a) HttpSession
b) SessionManager
c) ServerSession
d) UserSession
Answer: a) HttpSession
44. What is the primary purpose of the @RestController annotation in Spring?
a) To create a RESTful web service
b) To define a controller class
c) To configure the application context
d) To define a transaction
Answer: a) To create a RESTful web service
45. Which of the following best describes Java's role in web applications?
a) It provides client-side scripting
b) It provides server-side programming capabilities
c) It builds user interfaces
d) It handles database transactions
Answer: b) It provides server-side programming capabilities
46. What is the purpose of the @Autowired annotation in Spring?
a) To automatically inject dependencies
b) To define a service layer component
c) To handle HTTP requests
d) To enable database connections
Answer: a) To automatically inject dependencies
47. Which of the following is used to perform server-side validation in Java?
a) JavaBeans Validation API
b) Swing
c) JSP
d) JUnit
Answer: a) JavaBeans Validation API
48. What is the function of the @Scope annotation in Spring?
a) To define the scope of a Spring bean
b) To handle HTTP requests
c) To define a data access object
d) To mark a method for transaction management
Answer: a) To define the scope of a Spring bean
49. What is the main feature of a Java application server like Apache
Tomcat?
a) It runs Java-based web applications
b) It compiles Java code
c) It stores session data
d) It handles security measures
Answer: a) It runs Java-based web applications
50. Which of the following is a commonly used container for Java web
applications?
a) Servlet Container
b) Application Server
c) WebSocket
d) JUnit
Answer: a) Servlet Container
PHP
1. What does PHP stand for?
a) Hypertext Preprocessor
b) Personal Home Page
c) Preprocessor Hypertext Page
d) Programable Hypertext Processor
Answer: a) Hypertext Preprocessor
2. Which of the following is the correct syntax to declare a PHP variable?
a) var $name;
b) variable name;
c) $name;
d) variable $name;
Answer: c) $name;
3. Which of the following PHP functions is used to send an HTTP header to a
client?
a) sendHeader()
b) header()
c) send()
d) httpHeader()
Answer: b) header()
4. How do you write a single-line comment in PHP?
a) <!-- This is a comment -->
b) // This is a comment
c) # This is a comment
d) /* This is a comment */
Answer: b) // This is a comment
5. Which function is used to check if a file exists in PHP?
a) file_exists()
b) is_file()
c) check_file()
d) is_readable()
Answer: a) file_exists()
6. How can you access the value of a GET variable in PHP?
a) $_GET[]
b) $_GET['variable_name']
c) $_POST[]
d) $_POST['variable_name']
Answer: b) $_GET['variable_name']
7. How do you declare an array in PHP?
a) array('apple', 'banana', 'cherry')
b) $fruits = array('apple', 'banana', 'cherry');
c) array = ('apple', 'banana', 'cherry')
d) $fruits = ['apple', 'banana', 'cherry'];
Answer: b) $fruits = array('apple', 'banana', 'cherry');
8. Which of the following PHP functions is used to get the length of a string?
a) strlen()
b) strlen()
c) string_length()
d) count()
Answer: a) strlen()
9. What is the correct way to start a PHP session?
a) session_start()
b) start_session()
c) session_begin()
d) session_open()
Answer: a) session_start()
10. How can you combine two strings in PHP?
a) concat("Hello ", "world!")
b) "Hello " . "world!"
c) "Hello " + "world!"
d) "Hello ".concat("world!")
Answer: b) "Hello " . "world!"
11. Which of the following is a correct way to include an external PHP file?
a) include_file('file.php')
b) require('file.php')
c) include('file.php')
d) import('file.php')
Answer: c) include('file.php')
12. What does the isset() function do in PHP?
a) Checks if a variable is null
b) Checks if a variable is set and not null
c) Checks if a variable has an empty value
d) Checks if a variable is defined
Answer: b) Checks if a variable is set and not null
13. How do you connect to a MySQL database in PHP?
a) mysql_connect("localhost", "username", "password");
b) mysqli_connect("localhost", "username", "password");
c) db_connect("localhost", "username", "password");
d) connect_db("localhost", "username", "password");
Answer: b) mysqli_connect("localhost", "username", "password");
14. How can you retrieve the current date and time in PHP?
a) date('Y-m-d H:i:s')
b) current_date()
c) now()
d) get_current_time()
Answer: a) date('Y-m-d H:i:s')
15. What is the correct way to declare a constant in PHP?
a) const NAME = "John";
b) define("NAME", "John");
c) constant NAME = "John";
d) define NAME = "John";
Answer: b) define("NAME", "John");
16. Which PHP function is used to find the position of the first occurrence of a
substring in a string?
a) strpos()
b) indexOf()
c) find()
d) substringIndex()
Answer: a) strpos()
17. How do you prevent SQL injection in PHP?
a) Use the mysql_escape_string() function
b) Use prepared statements with bound parameters
c) Use htmlspecialchars()
d) Use escape_string()
Answer: b) Use prepared statements with bound parameters
18. Which PHP function is used to get the value of a cookie?
a) cookie_get()
b) $_COOKIE['cookie_name']
c) get_cookie()
d) cookie_value()
Answer: b) $_COOKIE['cookie_name']
19. Which of the following functions is used to redirect to another page in
PHP?
a) redirect()
b) header('Location: page.php');
c) header('Location: page.php');
d) goTo('page.php');
Answer: b) header('Location: page.php');
20. What is the purpose of the $_SERVER superglobal in PHP?
a) Stores server-side data
b) Contains information about the server environment and client requests
c) Holds session data
d) Manages form data
Answer: b) Contains information about the server environment and client requests
21. Which of the following is NOT a valid data type in PHP?
a) object
b) array
c) boolean
d) string
Answer: a) object
22. Which function is used to get the current session ID in PHP?
a) session_id()
b) get_session()
c) current_session()
d) session_token()
Answer: a) session_id()
23. Which of the following is correct to destroy a session in PHP?
a) session_destroy()
b) destroy_session()
c) clear_session()
d) session_end()
Answer: a) session_destroy()
24. Which function is used to read from a file in PHP?
a) fread()
b) read_file()
c) file_read()
d) get_file()
Answer: a) fread()
25. What does the $_FILES superglobal do in PHP?
a) Handles file uploads
b) Stores session data
c) Stores form data
d) Stores cookie data
Answer: a) Handles file uploads
26. Which of the following PHP functions is used to start a file upload?
a) upload_file()
b) start_upload()
c) move_uploaded_file()
d) upload_start()
Answer: c) move_uploaded_file()
27. Which of the following functions is used to sort an array in PHP?
a) sort_array()
b) sort()
c) array_sort()
d) order_array()
Answer: b) sort()
28. How do you include a PHP file at the beginning of a script?
a) include_before('file.php');
b) include_first('file.php');
c) include('file.php');
d) import('file.php');
Answer: c) include('file.php');
29. What does the PHP function mysql_fetch_assoc() do?
a) Fetches a row from a result set and returns it as an associative array
b) Fetches a row from a result set and returns it as an associative array
c) Fetches all rows from the result set
d) Fetches a column from a result set
Answer: b) Fetches a row from a result set and returns it as an associative array
30. Which of the following is used to define the action when a form is
submitted in PHP?
a) form_action="submit.php"
b) action="submit.php"
c) submit_action="submit.php"
d) action="post.php"
Answer: b) action="submit.php"
(Continued in next response)
4o mini
You said:
YES
ChatGPT said:
ChatGPT
Here is the continuation of the PHP MCQs:
31. How do you retrieve the current timestamp in PHP?
a) time()
b) time()
c) current_time()
d) get_timestamp()
Answer: b) time()
32. Which PHP function is used to remove white spaces from both ends of a
string?
a) strip_tags()
b) trim()
c) clean()
d) sanitize()
Answer: b) trim()
33. How do you add a comment in a PHP block of code?
a) /* This is a comment */
b) /* This is a comment */
c) // This is a comment
d) <!-- This is a comment -->
Answer: b) /* This is a comment */
34. Which function is used to remove an element from an array in PHP?
a) remove()
b) unset()
c) delete()
d) array_pop()
Answer: b) unset()
35. How can you prevent a PHP file from being accessed directly?
a) By using .htaccess to restrict access
b) By using exit() at the start of the PHP file
c) By setting a session variable
d) By using ob_start()
Answer: a) By using .htaccess to restrict access
36. How do you get the number of elements in an array in PHP?
a) count_elements()
b) count()
c) array_count()
d) length()
Answer: b) count()
37. Which PHP function is used to format a number as currency?
a) currency_format()
b) number_format()
c) format_currency()
d) to_currency()
Answer: b) number_format()
38. Which of the following functions is used to send an email in PHP?
a) mail()
b) mail()`
c) email()
d) send_mail()
Answer: a) mail()
39. How can you prevent a user from submitting a form multiple times in
PHP?
a) By using cookies
b) By using a session variable to track form submission
c) By using an HTML disabled attribute
d) By using a reload() method
Answer: b) By using a session variable to track form submission
40. Which of the following PHP functions is used to escape special characters
in a string for use in an SQL query?
a) mysql_real_escape_string()
b) sql_escape()
c) escape()
d) string_escape()
Answer: a) mysql_real_escape_string()
41. Which PHP function is used to upload a file to the server?
a) upload_file()
b) move_uploaded_file()
c) send_file()
d) file_upload()
Answer: b) move_uploaded_file()
42. How do you declare a function in PHP?
a) function myFunction() {}
b) function myFunction() {}
c) declare function myFunction() {}
d) func myFunction() {}
Answer: b) function myFunction() {}`
43. How can you make a variable global in PHP?
a) global $variable;
b) global $variable;
c) $GLOBALS['variable'];
d) declare global $variable;
Answer: b) global $variable;
44. Which of the following is the correct way to define an associative array in
PHP?
a) array("key1" => "value1", "key2" => "value2")
b) array("key1" => "value1", "key2" => "value2")
c) array("key1", "value1", "key2", "value2")
d) array("key1", "key2", "value1", "value2")
Answer: b) array("key1" => "value1", "key2" => "value2")
45. How do you close a connection to a MySQL database in PHP?
a) mysqli_close()
b) db_close()
c) close_connection()
d) mysql_disconnect()
Answer: a) mysqli_close()
46. How do you include a file at the beginning of a PHP script?
a) include("file.php");
b) include("file.php");
c) require("file.php");
d) import("file.php");
Answer: a) include("file.php");
47. Which of the following is the correct way to start a session in PHP?
a) session_start();
b) session_start();
c) start_session();
d) begin_session();
Answer: b) session_start();
48. How do you display an error message in PHP?
a) error_display('Message');
b) echo 'Message';
c) print_error('Message');
d) show_error('Message');
Answer: b) echo 'Message';
49. Which of the following is used for database interaction in PHP?
a) MySQLi
b) DBConnection
c) MySQL
d) PDO
Answer: a) MySQLi
50. Which of the following PHP functions is used to redirect the user to
another page?
a) go_to()
b) change_location()
c) header("Location: new_page.php");
d) redirect_page("new_page.php");
Answer: c) header("Location: new_page.php");
PYTHON
1. Which of the following is the correct extension of Python files?
a) .pyt
b) .py
c) .python
d) .pyp
Answer: b) .py
2. What is the correct syntax to output "Hello, World" in Python?
a) echo("Hello, World")
b) print("Hello, World")
c) output("Hello, World")
d) println("Hello, World")
Answer: b) print("Hello, World")
3. Which of the following data types are immutable in Python?
a) List
b) Dictionary
c) Tuple
d) Set
Answer: c) Tuple
4. How do you create a list in Python?
a) list = (1, 2, 3)
b) list = [1, 2, 3]
c) list = {1, 2, 3}
d) list = <1, 2, 3>
Answer: b) list = [1, 2, 3]
5. Which method is used to add an element at the end of a list in Python?
a) append()
b) append()
c) insert()
d) add()
Answer: b) append()
6. Which of the following is used for defining a function in Python?
a) function()
b) def
c) func
d) method()
Answer: b) def
7. What is the output of print(3 * 'abc') in Python?
a) abcabcabc
b) abcabcabc
c) 3abc
d) Error
Answer: b) abcabcabc
8. What is the output of print(2 + 3 * 5) in Python?
a) 25
b) 17
c) 17
d) 35
Answer: b) 17
9. Which of the following is not a valid Python variable name?
a) _var
b) var_1
c) 1var
d) 1var
Answer: c) 1var
10. What is the output of print(type(5 / 2)) in Python?
a) <class 'int'>
b) <class 'float'>
c) <class 'double'>
d) <class 'integer'>
Answer: b) <class 'float'>
11. What does the len() function do in Python?
a) Returns the length of a string
b) Returns the number of elements in a list
c) Returns the length of an object
d) All of the above
Answer: d) All of the above
12. Which of the following is used to create a dictionary in Python?
a) dict = (1: "a", 2: "b")
b) dict = {1: "a", 2: "b"}
c) dict = [1: "a", 2: "b"]
d) dict = (1, "a", 2, "b")
Answer: b) dict = {1: "a", 2: "b"}
13. How do you check the type of a variable in Python?
a) type(variable)
b) type(variable)
c) checktype(variable)
d) variable.type()
Answer: b) type(variable)
14. How do you convert a string to an integer in Python?
a) int("string")
b) int("string")
c) str("string")
d) integer("string")
Answer: b) int("string")
15. What is the output of print(bool("False")) in Python?
a) False
b) True
c) 0
d) None
Answer: b) True
16. Which of the following is the correct syntax for a while loop in Python?
a) while x > 10:
b) while x > 10:
c) while (x > 10):
d) while (x > 10) do:
Answer: b) while x > 10:
17. What does the break statement do in Python?
a) Breaks the program
b) Exits the current loop
c) Exits the function
d) None of the above
Answer: b) Exits the current loop
18. What is the correct way to define a class in Python?
a) class MyClass:
b) class MyClass:
c) MyClass class:
d) define class MyClass:
Answer: b) class MyClass:
19. Which method can be used to sort a list in Python?
a) list.sort()
b) list.sort()`
c) sort(list)
d) list.sorted()
Answer: b) list.sort()
20. How do you handle exceptions in Python?
a) try...catch
b) try...except
c) try...finally
d) catch...finally
Answer: b) try...except
21. What is the output of print(2 == 3) in Python?
a) True
b) False
c) Error
d) None
Answer: b) False
22. Which of the following is used to read input from the user in Python?
a) input()
b) input()
c) scan()
d) read()
Answer: b) input()
23. What is the result of 5 / 2 in Python 3?
a) 2
b) 2.5
c) 2.0
d) Error
Answer: b) 2.5
24. What is the keyword used to exit a function in Python?
a) end
b) return
c) stop
d) exit
Answer: b) return
25. Which of the following is used to create a set in Python?
a) set = []
b) set = {1, 2, 3}
c) set = ()
d) set = [1, 2, 3]
Answer: b) set = {1, 2, 3}
26. How do you concatenate two strings in Python?
a) concat("hello", "world")
b) "hello" + "world"
c) concat("hello" + "world")
d) "hello" . "world"
Answer: b) "hello" + "world"
27. Which of the following is the correct syntax for importing a module in
Python?
a) import module_name
b) import(module_name)
c) import from module_name
d) include module_name
Answer: a) import module_name
28. What is the result of print(10 % 3) in Python?
a) 1
b) 1
c) 0
d) 3
Answer: b) 1
29. How do you create a new Python virtual environment?
a) python3 -m venv
b) python3 -m venv myenv
c) python -m venv
d) python venv
Answer: b) python3 -m venv myenv
30. How do you define an empty tuple in Python?
a) tuple = ()
b) tuple = {}
c) tuple = []
d) tuple = [None]
Answer: a) tuple = ()
31. How can you check if a key exists in a dictionary?
a) key in dict
b) key in dict
c) dict.key()
d) dict.contains(key)
Answer: b) key in dict
32. Which of the following Python libraries is used for data analysis?
a) NumPy
b) Pandas
c) SciPy
d) TensorFlow
Answer: b) Pandas
33. Which of the following is the correct way to declare a comment in Python?
a) // Comment
b) /* Comment */
c) # Comment
d) <!-- Comment -->
Answer: c) # Comment
34. What will the following code print?
python
Copy code
x = [1, 2, 3, 4]
x.pop(1)
print(x)
a) [1, 3, 4]
b) [1, 3, 4]
c) [2, 3, 4]
d) [1, 2, 3]
Answer: b) [1, 3, 4]
35. Which of the following is not a valid Python data type?
a) list
b) vector
c) tuple
d) dict
Answer: b) vector
36. Which of the following is used to install a Python package?
a) install
b) pip install package_name
c) python install package_name
d) setup.py install
Answer: b) pip install package_name
37. How do you define a class in Python?
a) class MyClass:
b) class MyClass:
c) define MyClass:
d) create class MyClass:
Answer: b) class MyClass:
38. How do you generate random numbers in Python?
a) import random
b) import rand
c) import math
d) import numbers
Answer: a) import random
39. Which of the following is the method to get the length of a string in
Python?
a) len()
b) len()`
c) str.length()
d) string_length()
Answer: b) len()
40. How do you handle exceptions in Python?
a) try...except
b) try...except
c) try...catch
d) catch...finally
Answer: b) try...except
41. What is the correct way to define a constant in Python?
a) CONST = 10
b) CONST = 10
c) const CONST = 10
d) define CONST 10
Answer: b) CONST = 10
42. Which of the following methods is used to combine two lists?
a) combine()
b) extend()
c) concat()
d) add()
Answer: b) extend()
43. Which of the following can be used to create a generator in Python?
a) []
b) ()
c) {}
d) <>
Answer: b) ()
44. What is the output of print(5 == 5.0) in Python?
a) True
b) True
c) False
d) None
Answer: b) True
45. Which of the following is the correct way to open a file in Python?
a) open("file.txt", "r")
b) open("file.txt", "r")
c) open("file.txt", "read")
d) open("file.txt")
Answer: b) open("file.txt", "r")
46. How do you make a Python script executable on Linux?
a) chmod +x script.py
b) chmod +x script.py
c) chmod +r script.py
d) chmod 777 script.py
Answer: b) chmod +x script.py
47. What is the result of list(range(3)) in Python?
a) [0, 1, 2]
b) [0, 1, 2]
c) [1, 2, 3]
d) Error
Answer: b) [0, 1, 2]
48. How do you remove an item from a list by value in Python?
a) remove()
b) remove()`
c) delete()
d) pop()
Answer: b) remove()
49. How do you create an empty set in Python?
a) set = {}
b) set = set()`
c) set = []
d) set = ()
Answer: b) set = set()`
50. How do you define an empty dictionary in Python?
a) dict = {}
b) dict = {}`
c) dict = []
d) dict = ()
Answer: b) dict = {}`
WEBDESIGN TOOLS
1. Which of the following is a popular web design tool used for creating
layouts?
a) Adobe Dreamweaver
b) Microsoft Word
c) Paint
d) Notepad
Answer: a) Adobe Dreamweaver
2. What is the primary function of a code editor like Sublime Text in web
design?
a) Write and edit code
b) Create website graphics
c) Write business logic
d) Preview websites
Answer: a) Write and edit code
3. Which web design tool is known for its vector graphics capabilities and is
often used for designing logos?
a) Adobe Illustrator
b) Microsoft Word
c) Adobe Photoshop
d) Notepad++
Answer: a) Adobe Illustrator
4. What is the purpose of Adobe Photoshop in web design?
a) Designing graphics and images
b) Writing HTML code
c) Designing databases
d) Coding in JavaScript
Answer: a) Designing graphics and images
5. Which of the following tools is specifically used for responsive web design?
a) Bootstrap
b) Visual Studio
c) Adobe XD
d) GIMP
Answer: a) Bootstrap
6. Which tool allows designers to create interactive user interfaces and
prototypes?
a) Adobe XD
b) Visual Studio Code
c) Notepad++
d) Microsoft Excel
Answer: a) Adobe XD
7. What type of software is WordPress?
a) Content Management System (CMS)
b) Image editor
c) Code editor
d) Database management system
Answer: a) Content Management System (CMS)
8. Which of the following is a free, open-source web design tool for creating
web pages?
a) Microsoft FrontPage
b) WordPress
c) Adobe Dreamweaver
d) Microsoft Paint
Answer: b) WordPress
9. Which software is mainly used for web design and also for web
development through integration with HTML, CSS, and JavaScript?
a) Adobe Dreamweaver
b) Notepad++
c) Adobe Illustrator
d) GIMP
Answer: a) Adobe Dreamweaver
10. What is the purpose of Figma in web design?
a) Collaborative design tool
b) Code editing tool
c) Image manipulation tool
d) Content management system
Answer: a) Collaborative design tool
11. What type of tool is Sketch in the context of web design?
a) UI/UX design tool
b) Code editor
c) Content management system
d) Animation tool
Answer: a) UI/UX design tool
12. What does the web design tool "GIMP" stand for?
a) GNU Image Manipulation Program
b) General Image Manipulation Program
c) Global Image Management Program
d) Great Image Maker Program
Answer: a) GNU Image Manipulation Program
13. What is the primary function of the tool Adobe Illustrator?
a) Vector graphic design
b) Code writing
c) Website publishing
d) Video editing
Answer: a) Vector graphic design
14. Which of the following web design tools is most associated with
wireframing?
a) Microsoft Excel
b) Balsamiq
c) Photoshop
d) Dreamweaver
Answer: b) Balsamiq
15. What is the main purpose of the tool InVision in web design?
a) Prototyping and collaboration
b) Image editing
c) Writing JavaScript
d) Web hosting
Answer: a) Prototyping and collaboration
16. Which of the following is a key feature of the web design tool Webflow?
a) Visual web design and development
b) Content management
c) Image editing
d) Database management
Answer: a) Visual web design and development
17. Which tool is best known for its responsive web design framework?
a) Bootstrap
b) WordPress
c) Figma
d) Dreamweaver
Answer: a) Bootstrap
18. What is the function of a tool like Notepad++ for web design?
a) Image creation
b) Text and code editing
c) Website publishing
d) Video editing
Answer: b) Text and code editing
19. Which web design tool is known for its powerful animation and interactive
design capabilities?
a) Adobe Animate
b) Figma
c) WordPress
d) GIMP
Answer: a) Adobe Animate
20. Which tool is used for collaborative interface design and prototyping?
a) Figma
b) Adobe Illustrator
c) Notepad++
d) Adobe Premiere Pro
Answer: a) Figma
21. What is the primary function of the tool Sublime Text in web design?
a) Code editing
b) Image manipulation
c) Website hosting
d) Database design
Answer: a) Code editing
22. Which tool allows you to easily create forms, buttons, and layouts with
drag-and-drop features for web design?
a) Webflow
b) Dreamweaver
c) Sublime Text
d) Sketch
Answer: a) Webflow
23. Which web design tool helps in creating and managing CSS stylesheets
visually?
a) Adobe Dreamweaver
b) Microsoft Word
c) Notepad++
d) GIMP
Answer: a) Adobe Dreamweaver
24. What is the feature of the tool Adobe XD?
a) UI/UX design and prototyping
b) Video editing
c) Coding HTML
d) File compression
Answer: a) UI/UX design and prototyping
25. Which tool can be used to export a high-fidelity design prototype into
code?
a) Webflow
b) GIMP
c) Figma
d) Adobe Photoshop
Answer: a) Webflow
26. What type of projects can Adobe Illustrator be used for?
a) Vector-based graphics and logos
b) Code writing
c) Video production
d) 3D rendering
Answer: a) Vector-based graphics and logos
27. Which web design tool is used to test and debug websites?
a) Sublime Text
b) Google Chrome Developer Tools
c) Dreamweaver
d) Adobe Illustrator
Answer: b) Google Chrome Developer Tools
28. What is the main feature of the tool GIMP?
a) Image manipulation and editing
b) Code writing
c) Web hosting
d) Database management
Answer: a) Image manipulation and editing
29. Which of the following is an open-source web design tool?
a) GIMP
b) Adobe Photoshop
c) Adobe Illustrator
d) Sketch
Answer: a) GIMP
30. Which web design tool is used for creating dynamic content such as
animations and interactive graphics?
a) Adobe Animate
b) WordPress
c) Dreamweaver
d) Sublime Text
Answer: a) Adobe Animate
31. What is the primary advantage of using WordPress as a web design tool?
a) Ease of use and pre-designed templates
b) Advanced coding features
c) Image editing capabilities
d) 3D rendering
Answer: a) Ease of use and pre-designed templates
32. Which tool is used for designing mobile-friendly websites with responsive
design features?
a) Dreamweaver
b) Bootstrap
c) Notepad++
d) Microsoft Word
Answer: b) Bootstrap
33. Which tool is used to create web design prototypes for testing and
feedback?
a) InVision
b) GIMP
c) Adobe Illustrator
d) Notepad++
Answer: a) InVision
34. What is the primary function of Canva in web design?
a) Graphic design for websites
b) Web development
c) Text editing
d) Database management
Answer: a) Graphic design for websites
35. Which tool is used for the design of modern websites and web applications
using CSS, HTML, and JavaScript?
a) Webflow
b) GIMP
c) Adobe Illustrator
d) Microsoft Paint
Answer: a) Webflow
36. Which tool is specifically for building and testing APIs in web
development?
a) Sublime Text
b) Postman
c) Figma
d) Sketch
Answer: b) Postman
37. Which web design tool offers features for real-time collaboration on
designs?
a) Adobe Photoshop
b) Figma
c) Notepad++
d) Sublime Text
Answer: b) Figma
38. What is the main feature of Wix as a web design tool?
a) Drag-and-drop website builder
b) Advanced code editing
c) Image manipulation
d) Video production
Answer: a) Drag-and-drop website builder
39. Which of the following tools is best suited for web and app prototyping?
a) Axure RP
b) GIMP
c) Adobe Premiere Pro
d) Sublime Text
Answer: a) Axure RP
40. Which software is used for detailed design of website elements like buttons
and icons?
a) Adobe Illustrator
b) Sublime Text
c) WordPress
d) Notepad++
Answer: a) Adobe Illustrator
41. What is the key feature of the tool Balsamiq?
a) Wireframing for UI/UX design
b) Image editing
c) Video editing
d) Content management
Answer: a) Wireframing for UI/UX design
42. What is a major advantage of using a tool like Webflow?
a) No need to write code
b) Only for graphic design
c) For managing databases
d) Video editing
Answer: a) No need to write code
43. Which of the following tools is used to create and manage databases for
web applications?
a) Sublime Text
b) phpMyAdmin
c) Adobe XD
d) Figma
Answer: b) phpMyAdmin
44. What does the tool “Brackets” do in web design?
a) Code editor for web development
b) Wireframing tool
c) Graphic design tool
d) Project management
Answer: a) Code editor for web development
45. Which tool is primarily used for designing and testing dynamic content on
websites?
a) Adobe Animate
b) Microsoft Excel
c) Sketch
d) WordPress
Answer: a) Adobe Animate
46. What is the primary use of the tool Sketch in web design?
a) Creating vector-based UI designs
b) Coding
c) Animating graphics
d) Image editing
Answer: a) Creating vector-based UI designs
47. Which web design tool is best for creating high-quality illustrations and
icons for websites?
a) Adobe Illustrator
b) GIMP
c) Figma
d) WordPress
Answer: a) Adobe Illustrator
48. What is the main advantage of using Figma for web design?
a) Real-time collaboration on design projects
b) Image manipulation
c) Database management
d) Content writing
Answer: a) Real-time collaboration on design projects
49. Which tool is best for building interactive wireframes and prototypes?
a) Axure RP
b) Adobe XD
c) Sketch
d) GIMP
Answer: a) Axure RP
50. What is the primary feature of the tool Webflow?
a) Drag-and-drop web design without code
b) Image editing
c) Code compilation
d) Video production
Answer: a) Drag-and-drop web design without code
MAIL CLIENTS
1. Which of the following is a popular mail client for both personal and
business use?
a) Microsoft Outlook
b) Adobe Photoshop
c) Notepad++
d) GIMP
Answer: a) Microsoft Outlook
2. What type of software is Thunderbird?
a) Mail client
b) Web browser
c) Database management tool
d) Graphics editor
Answer: a) Mail client
3. Which of the following email services is typically used with the Gmail mail
client?
a) IMAP
b) FTP
c) SMTP
d) DNS
Answer: a) IMAP
4. Which protocol is commonly used for sending emails from a mail client?
a) SMTP
b) IMAP
c) POP3
d) HTTP
Answer: a) SMTP
5. What does POP3 stand for in email systems?
a) Post Office Protocol version 3
b) Personal Online Protocol 3
c) Private Online Platform 3
d) Post Options Protocol 3
Answer: a) Post Office Protocol version 3
6. Which mail client is commonly used for sending and receiving emails
through Gmail?
a) Google Mail App
b) Thunderbird
c) Apple Mail
d) Microsoft Outlook
Answer: a) Google Mail App
7. What is the main advantage of using IMAP over POP3 for email clients?
a) Allows syncing across multiple devices
b) It works offline
c) It sends faster emails
d) It saves space on the server
Answer: a) Allows syncing across multiple devices
8. Which of the following is a free, open-source email client developed by
Mozilla?
a) Thunderbird
b) Microsoft Outlook
c) Apple Mail
d) Gmail
Answer: a) Thunderbird
9. What is the primary feature of the mail client Apple Mail?
a) Email management for Apple devices
b) Web development
c) Cloud storage management
d) Video conferencing
Answer: a) Email management for Apple devices
10. Which of the following is a popular email client for Windows operating
systems?
a) Microsoft Outlook
b) Adobe Acrobat
c) Google Chrome
d) VLC Media Player
Answer: a) Microsoft Outlook
11. Which email client is integrated into the Microsoft Office Suite?
a) Microsoft Outlook
b) Thunderbird
c) Apple Mail
d) Postbox
Answer: a) Microsoft Outlook
12. What is the full form of the acronym "SMTP" used in email services?
a) Simple Mail Transfer Protocol
b) Simple Message Transmission Protocol
c) Secure Mail Transfer Protocol
d) Sending Mail Transaction Protocol
Answer: a) Simple Mail Transfer Protocol
13. Which of the following protocols does IMAP allow for email clients to use?
a) Access to email messages on multiple devices
b) Email message sending
c) Secure email encryption
d) File sharing
Answer: a) Access to email messages on multiple devices
14. Which of these email clients offers a "Focus" mode to prioritize important
messages?
a) Microsoft Outlook
b) Thunderbird
c) Gmail
d) Apple Mail
Answer: a) Microsoft Outlook
15. What is the function of an email client like Microsoft Outlook?
a) Managing and sending/receiving emails
b) Creating websites
c) Video streaming
d) Photo editing
Answer: a) Managing and sending/receiving emails
16. Which of the following email clients can be installed on mobile devices?
a) Gmail App
b) Adobe Acrobat
c) Windows Media Player
d) WinRAR
Answer: a) Gmail App
17. What does IMAP allow you to do with your email?
a) Access email from multiple devices
b) Permanently delete messages from the server
c) Send emails only
d) Encrypt your emails
Answer: a) Access email from multiple devices
18. Which email client is known for its ease of use and integration with
Windows operating systems?
a) Microsoft Outlook
b) Thunderbird
c) Gmail
d) Apple Mail
Answer: a) Microsoft Outlook
19. Which protocol is used for retrieving email from an email server to a
client?
a) POP3
b) SMTP
c) IMAP
d) HTTP
Answer: a) POP3
20. Which of the following email clients supports encrypted email messages?
a) Microsoft Outlook
b) Mozilla Firefox
c) Google Chrome
d) Windows Media Player
Answer: a) Microsoft Outlook
21. Which mail client is typically used with macOS and iOS devices?
a) Apple Mail
b) Microsoft Outlook
c) Mozilla Thunderbird
d) Gmail
Answer: a) Apple Mail
22. What does the term "client" refer to in the context of email?
a) Software that accesses and manages emails
b) The email server
c) The email encryption protocol
d) The sender of the email
Answer: a) Software that accesses and manages emails
23. Which of the following email clients provides integration with Microsoft
Exchange servers?
a) Microsoft Outlook
b) Gmail
c) Thunderbird
d) Yahoo Mail
Answer: a) Microsoft Outlook
24. What feature does the email client "Mailbird" offer?
a) Unified inbox for managing multiple email accounts
b) Cloud storage
c) Social media management
d) Video editing
Answer: a) Unified inbox for managing multiple email accounts
25. What is the key difference between POP3 and IMAP?
a) IMAP syncs emails across devices, POP3 downloads them
b) IMAP does not support attachments
c) POP3 works only with Gmail
d) IMAP is an email encryption method
Answer: a) IMAP syncs emails across devices, POP3 downloads them
26. What does "CC" stand for in email communication?
a) Carbon Copy
b) Critical Copy
c) Confidential Content
d) Copy Control
Answer: a) Carbon Copy
27. Which of the following email clients supports the use of "smart folders"?
a) Microsoft Outlook
b) Gmail
c) Yahoo Mail
d) Mozilla Thunderbird
Answer: a) Microsoft Outlook
28. Which feature allows you to organize and filter your emails based on
certain criteria in email clients?
a) Rules or Filters
b) SMTP
c) Address Book
d) Contact Groups
Answer: a) Rules or Filters
29. Which email client supports the integration of third-party add-ins for
extended functionality?
a) Microsoft Outlook
b) Thunderbird
c) Yahoo Mail
d) Gmail
Answer: a) Microsoft Outlook
30. What is the purpose of "Spam" filters in mail clients?
a) To identify and filter unwanted emails
b) To manage storage space
c) To create folders
d) To send out newsletters
Answer: a) To identify and filter unwanted emails
31. What is the advantage of using cloud-based mail clients like Gmail over
traditional desktop mail clients?
a) Access to emails from any device with an internet connection
b) Better offline functionality
c) Enhanced security features
d) Faster email sending
Answer: a) Access to emails from any device with an internet connection
32. Which email client has the feature of “Focused Inbox” to help prioritize
important emails?
a) Microsoft Outlook
b) Mozilla Thunderbird
c) Gmail
d) Apple Mail
Answer: a) Microsoft Outlook
33. Which mail client is provided as part of the Microsoft Office suite?
a) Microsoft Outlook
b) Thunderbird
c) Apple Mail
d) Mozilla Firefox
Answer: a) Microsoft Outlook
34. What is the key purpose of the email client "Postbox"?
a) Manage multiple email accounts
b) Design websites
c) Send large files
d) Edit graphics
Answer: a) Manage multiple email accounts
35. Which of the following email clients is most commonly used for accessing
Yahoo Mail?
a) Yahoo Mail App
b) Apple Mail
c) Microsoft Outlook
d) Mozilla Thunderbird
Answer: a) Yahoo Mail App
36. What is the primary use of the "Archive" function in Gmail and other
mail clients?
a) Store emails without deleting them
b) Mark emails as spam
c) Send emails automatically
d) Flag emails for follow-up
Answer: a) Store emails without deleting them
37. Which of the following email clients has the feature of "Smart Compose"
for writing emails?
a) Gmail
b) Microsoft Outlook
c) Yahoo Mail
d) Apple Mail
Answer: a) Gmail
38. Which email client is designed for managing a business’s emails and
calendars?
a) Microsoft Outlook
b) Gmail
c) Mozilla Thunderbird
d) Yahoo Mail
Answer: a) Microsoft Outlook
39. What does the email client "Postbox" specialize in?
a) Managing multiple email accounts
b) Web design
c) Video conferencing
d) Document editing
Answer: a) Managing multiple email accounts
40. What is the primary function of the "Auto-Reply" feature in email clients?
a) Send automated responses when you are unavailable
b) Mark emails as read
c) Block unwanted senders
d) Move emails to trash
Answer: a) Send automated responses when you are unavailable
41. Which email client supports two-factor authentication for added security?
a) Gmail
b) Yahoo Mail
c) Microsoft Outlook
d) Thunderbird
Answer: a) Gmail
42. Which of the following email clients allows for the creation of custom
email signatures?
a) Microsoft Outlook
b) Mozilla Thunderbird
c) Gmail
d) Yahoo Mail
Answer: a) Microsoft Outlook
43. What is the function of the "Send Later" option in email clients like
Gmail?
a) Schedule emails to be sent at a later time
b) Automatically draft responses
c) Save emails as drafts
d) Forward emails to another account
Answer: a) Schedule emails to be sent at a later time
44. Which email client is designed specifically for people using Apple's
ecosystem?
a) Apple Mail
b) Gmail
c) Microsoft Outlook
d) Yahoo Mail
Answer: a) Apple Mail
45. Which of the following is a key feature of the Outlook email client?
a) Integration with Microsoft Exchange
b) Built-in photo editing tools
c) Free cloud storage
d) Video chat support
Answer: a) Integration with Microsoft Exchange
46. What does "BCC" stand for in email communication?
a) Blind Carbon Copy
b) Basic Contact Copy
c) Big Cloud Copy
d) Binary Content Copy
Answer: a) Blind Carbon Copy
47. Which mail client allows you to filter emails by subject, sender, and other
criteria?
a) Microsoft Outlook
b) Apple Mail
c) Mozilla Thunderbird
d) Gmail
Answer: a) Microsoft Outlook
48. Which email client is primarily used for corporate email systems?
a) Microsoft Outlook
b) Yahoo Mail
c) Gmail
d) Apple Mail
Answer: a) Microsoft Outlook
49. Which mail client offers a calendar and task management feature along
with email?
a) Microsoft Outlook
b) Gmail
c) Yahoo Mail
d) Thunderbird
Answer: a) Microsoft Outlook
50. Which email client offers integration with third-party services such as
Slack and Trello?
a) Microsoft Outlook
b) Gmail
c) Yahoo Mail
d) Thunderbird
Answer: a) Microsoft Outlook
DNS AND WEB HOSTING
1. What does DNS stand for?
a) Domain Name System
b) Digital Name Server
c) Data Network System
d) Domain Name Service
Answer: a) Domain Name System
2. What is the purpose of DNS in web hosting?
a) To store website files
b) To translate domain names into IP addresses
c) To manage web traffic
d) To protect websites from hacking
Answer: b) To translate domain names into IP addresses
3. Which of the following is the primary function of a domain name registrar?
a) To register domain names
b) To host websites
c) To secure the web server
d) To create content
Answer: a) To register domain names
4. What is a web hosting service used for?
a) To manage DNS records
b) To store and serve website files
c) To create website designs
d) To send email messages
Answer: b) To store and serve website files
5. Which DNS record type is used to point a domain to an IP address?
a) A Record
b) CNAME
c) MX
d) TXT
Answer: a) A Record
6. What is the function of the "MX" record in DNS?
a) To direct email traffic
b) To translate domain names
c) To point to a website’s IP address
d) To store security information
Answer: a) To direct email traffic
7. What is the primary purpose of a web hosting provider?
a) To create web content
b) To register domain names
c) To provide the infrastructure to host websites
d) To encrypt email messages
Answer: c) To provide the infrastructure to host websites
8. What does a CDN (Content Delivery Network) do in web hosting?
a) Encrypts web data
b) Distributes website content across multiple servers worldwide
c) Hosts databases
d) Manages DNS settings
Answer: b) Distributes website content across multiple servers worldwide
9. Which type of hosting involves sharing server resources with other
websites?
a) Shared hosting
b) VPS hosting
c) Dedicated hosting
d) Cloud hosting
Answer: a) Shared hosting
10. Which DNS record type is used to associate a domain with a mail server?
a) MX record
b) A record
c) CNAME
d) TXT record
Answer: a) MX record
11. What is the main advantage of using a Virtual Private Server (VPS) over
shared hosting?
a) More control over the server
b) No need for an internet connection
c) Free domain registration
d) Unlimited bandwidth
Answer: a) More control over the server
12. Which of the following is true about DNS propagation?
a) It can take up to 48 hours for DNS changes to take effect globally
b) DNS changes take effect immediately
c) DNS propagation only applies to email services
d) Propagation is not necessary for website hosting
Answer: a) It can take up to 48 hours for DNS changes to take effect globally
13. What is the primary difference between shared hosting and dedicated
hosting?
a) Dedicated hosting offers a server exclusively for one website
b) Shared hosting is more expensive
c) Dedicated hosting is slower
d) Shared hosting is for personal use only
Answer: a) Dedicated hosting offers a server exclusively for one website
14. What is an "A Record" in DNS used for?
a) To route email messages
b) To point a domain name to an IP address
c) To store text information
d) To create subdomains
Answer: b) To point a domain name to an IP address
15. What does "web hosting" typically include?
a) Server space, bandwidth, and security features
b) A domain name
c) A web design tool
d) Email services only
Answer: a) Server space, bandwidth, and security features
16. Which type of hosting allows a website to scale resources based on traffic
demand?
a) Shared hosting
b) VPS hosting
c) Dedicated hosting
d) Cloud hosting
Answer: d) Cloud hosting
17. Which of the following is a DNS record used for domain verification?
a) TXT record
b) A record
c) CNAME record
d) MX record
Answer: a) TXT record
18. What does "SSL" stand for in web hosting?
a) Secure Sockets Layer
b) Server Security Layer
c) Single Source Link
d) Secure System Language
Answer: a) Secure Sockets Layer
19. Which hosting type allows full control over the server and is suitable for
large businesses?
a) Dedicated hosting
b) Shared hosting
c) VPS hosting
d) Cloud hosting
Answer: a) Dedicated hosting
20. What does a CNAME record do in DNS?
a) Points a domain to another domain
b) Points a domain to an IP address
c) Stores email settings
d) Encrypts the domain
Answer: a) Points a domain to another domain
21. What does the term "domain propagation" refer to?
a) The time it takes for DNS changes to update across the internet
b) The time it takes to set up a hosting account
c) The time it takes to upload a website to a server
d) The time it takes to secure a website
Answer: a) The time it takes for DNS changes to update across the internet
22. Which of the following is an example of a domain registrar?
a) GoDaddy
b) BlueHost
c) HostGator
d) Amazon Web Services
Answer: a) GoDaddy
23. Which DNS record type is used to define a subdomain’s destination?
a) CNAME record
b) A record
c) MX record
d) TXT record
Answer: a) CNAME record
24. Which of the following is a primary benefit of using Cloud Hosting?
a) Scalable resources and high availability
b) Unlimited storage space
c) No need for DNS configuration
d) Free domain registration
Answer: a) Scalable resources and high availability
25. Which of the following DNS record types is used for defining the name of
the mail server for a domain?
a) A record
b) MX record
c) CNAME record
d) TXT record
Answer: b) MX record
26. What is "shared hosting"?
a) Hosting where multiple websites share the same server
b) Hosting where one website has exclusive use of the server
c) Hosting with unlimited bandwidth
d) Hosting with cloud infrastructure
Answer: a) Hosting where multiple websites share the same server
27. Which of the following is used to manage web hosting resources like
storage, bandwidth, and databases?
a) Control panel (e.g., cPanel)
b) Email client
c) Web browser
d) Domain registrar
Answer: a) Control panel (e.g., cPanel)
28. Which hosting type allows websites to run on a virtual machine?
a) Shared hosting
b) VPS hosting
c) Dedicated hosting
d) Cloud hosting
Answer: b) VPS hosting
29. What does the "TTL" (Time to Live) value in DNS settings control?
a) How long DNS information is cached before it is refreshed
b) The speed of the website
c) How much space is allocated to the server
d) The amount of storage used by emails
Answer: a) How long DNS information is cached before it is refreshed
30. Which of the following web hosting types is most cost-effective for small
businesses?
a) Dedicated hosting
b) Shared hosting
c) VPS hosting
d) Cloud hosting
Answer: b) Shared hosting
31. Which DNS record is used to provide information about a domain’s
security?
a) TXT record
b) CNAME record
c) A record
d) MX record
Answer: a) TXT record
32. What is the main advantage of using a CDN in web hosting?
a) Faster loading times by serving content from multiple global locations
b) Free domain registration
c) Unlimited email storage
d) Secure the email server
Answer: a) Faster loading times by serving content from multiple global locations
33. Which DNS record is typically used to associate a domain with an SSL
certificate?
a) A record
b) TXT record
c) MX record
d) CNAME record
Answer: b) TXT record
34. What is a "name server"?
a) A server that hosts the DNS records for a domain
b) A server that hosts website files
c) A server for sending email
d) A server for storing databases
Answer: a) A server that hosts the DNS records for a domain
35. What is the main advantage of using a dedicated server for hosting?
a) Complete control over server resources and configuration
b) Low-cost hosting
c) Limited traffic handling
d) Shared resources with other websites
Answer: a) Complete control over server resources and configuration
36. What is the primary difference between VPS hosting and shared hosting?
a) VPS hosting provides isolated resources, while shared hosting shares resources
b) VPS hosting has unlimited bandwidth
c) VPS hosting is free, while shared hosting is not
d) VPS hosting is slower
Answer: a) VPS hosting provides isolated resources, while shared hosting shares
resources
37. What is the main function of a web hosting provider's "bandwidth"?
a) To control the amount of data transferred to and from the website
b) To store website files
c) To create a backup of the website
d) To manage email services
Answer: a) To control the amount of data transferred to and from the website
38. What is the primary role of a "domain registrar"?
a) To manage domain name registrations and renewals
b) To provide email services
c) To provide website design tools
d) To host websites
Answer: a) To manage domain name registrations and renewals
39. Which of the following services is typically included with most web hosting
plans?
a) Email accounts and domain registration
b) Video editing software
c) Cloud storage only
d) Video streaming
Answer: a) Email accounts and domain registration
40. Which type of web hosting offers resources that are spread across multiple
servers?
a) Cloud hosting
b) Dedicated hosting
c) VPS hosting
d) Shared hosting
Answer: a) Cloud hosting
41. Which type of DNS record points a subdomain to another domain?
a) A record
b) CNAME record
c) MX record
d) TXT record
Answer: b) CNAME record
42. What is a "dedicated IP address" in web hosting?
a) An IP address exclusively assigned to a single website
b) An IP address shared by multiple websites
c) An IP address for email servers
d) An IP address for DNS servers
Answer: a) An IP address exclusively assigned to a single website
43. What is the main disadvantage of shared hosting?
a) Limited resources and performance due to sharing with other websites
b) Unlimited storage
c) Full server control
d) Expensive pricing
Answer: a) Limited resources and performance due to sharing with other websites
44. What is a web hosting "control panel"?
a) A graphical interface for managing web hosting settings
b) A server for storing website data
c) A backup solution for emails
d) A domain registrar
Answer: a) A graphical interface for managing web hosting settings
45. What is the primary function of a DNS resolver?
a) To query DNS records and return the appropriate IP address
b) To store website data
c) To create subdomains
d) To encrypt DNS traffic
Answer: a) To query DNS records and return the appropriate IP address
46. What does the term "domain name" refer to?
a) The unique address used to identify a website
b) A collection of email addresses
c) A type of website theme
d) A web hosting plan
Answer: a) The unique address used to identify a website
47. What is the role of an "A Record" in DNS?
a) To map a domain to an IP address
b) To handle email routing
c) To set domain name security
d) To define subdomains
Answer: a) To map a domain to an IP address
48. Which of the following is an example of a DNS server?
a) Google Public DNS
b) Apache HTTP Server
c) Microsoft IIS
d) FileZilla
Answer: a) Google Public DNS
49. What type of hosting is recommended for websites that expect
unpredictable traffic?
a) Shared hosting
b) Cloud hosting
c) Dedicated hosting
d) VPS hosting
Answer: b) Cloud hosting
50. What is the primary benefit of using a DNS hosting provider?
a) To increase website traffic
b) To ensure fast and reliable domain resolution
c) To create website content
d) To store website data
Answer: b) To ensure fast and reliable domain resolution
STATIC AND DYNAMIC WEB DEVELOPMENT
1. What is the primary difference between static and dynamic websites?
a) Static websites have fixed content, while dynamic websites can change content
based on user interaction
b) Static websites are faster than dynamic websites
c) Dynamic websites require no programming
d) Static websites can include interactive elements
Answer: a) Static websites have fixed content, while dynamic websites can change
content based on user interaction
2. Which of the following is a feature of static web development?
a) Fixed content that doesn’t change unless manually updated
b) Can interact with databases
c) Content is generated by server-side scripts
d) Requires a content management system
Answer: a) Fixed content that doesn’t change unless manually updated
3. Which technology is commonly used for dynamic web development?
a) HTML
b) PHP
c) CSS
d) Static HTML
Answer: b) PHP
4. Which type of website is generally easier to develop and host?
a) Dynamic websites
b) Static websites
c) Both are equally easy
d) Neither is easy to develop
Answer: b) Static websites
5. What is required for a dynamic website to function properly?
a) A server-side scripting language
b) A server-side scripting language and a database
c) Only HTML and CSS
d) A content management system
Answer: b) A server-side scripting language and a database
6. Which is the main advantage of a static website over a dynamic one?
a) Faster load times
b) Ability to interact with users
c) Requires a server-side database
d) Easier to manage content dynamically
Answer: a) Faster load times
7. Which of the following is an example of a dynamic website?
a) A blog that updates its content based on user input
b) A landing page with fixed content
c) A product page with fixed text
d) A homepage with an embedded image
Answer: a) A blog that updates its content based on user input
8. Which language is primarily used to create dynamic websites?
a) JavaScript
b) HTML
c) CSS
d) XML
Answer: a) JavaScript
9. What does a static website consist of?
a) HTML and CSS files that remain constant unless manually updated
b) Dynamic content generated by scripts
c) Content stored in a database
d) A content management system
Answer: a) HTML and CSS files that remain constant unless manually updated
10. Which of the following is a characteristic of dynamic web pages?
a) Content is generated in real-time based on user interactions
b) Content remains the same across all users
c) Cannot use a database
d) Requires minimal server-side programming
Answer: a) Content is generated in real-time based on user interactions
11. Which of the following is a tool commonly used to develop dynamic
websites?
a) HTML5
b) WordPress
c) CSS3
d) Bootstrap
Answer: b) WordPress
12. Which type of website is typically more complex to maintain?
a) Dynamic websites
b) Static websites
c) Both are equally complex
d) Neither requires maintenance
Answer: a) Dynamic websites
13. Which of the following is a common backend language for dynamic
websites?
a) PHP
b) HTML
c) JavaScript
d) CSS
Answer: a) PHP
14. What is the role of JavaScript in dynamic websites?
a) To provide styling
b) To add interactivity and dynamic content to the page
c) To store website data
d) To handle server requests
Answer: b) To add interactivity and dynamic content to the page
15. What is a CMS (Content Management System)?
a) A tool to manage website traffic
b) A system to track user behavior
c) A system to manage content on dynamic websites
d) A protocol for website security
Answer: c) A system to manage content on dynamic websites
16. Which of the following is a feature of dynamic websites?
a) Ability to generate content based on database data
b) Content is fixed and cannot be changed by the user
c) No server-side scripting is required
d) Content is written in HTML and CSS only
Answer: a) Ability to generate content based on database data
17. What is the main disadvantage of static websites?
a) They require more maintenance if content changes frequently
b) They are slower to load
c) They cannot use databases
d) They are not compatible with JavaScript
Answer: a) They require more maintenance if content changes frequently
18. Which of the following is an example of a static website?
a) A portfolio website with fixed pages and content
b) An e-commerce website with product listings
c) A website with user authentication
d) A website with comments and user interaction
Answer: a) A portfolio website with fixed pages and content
19. What is the purpose of server-side scripting in dynamic websites?
a) To generate content on the server based on user requests
b) To handle client-side animations
c) To style the web pages
d) To create static HTML content
Answer: a) To generate content on the server based on user requests
20. Which of the following would require a dynamic website?
a) A personal blog with fixed content
b) An online store that updates inventory and prices
c) A homepage with a static image
d) A landing page with text and images
Answer: b) An online store that updates inventory and prices
21. What does it mean when a website is referred to as "dynamic"?
a) It has content that can change or update based on user actions
b) It has fixed content only
c) It doesn’t require a server-side language
d) It is a very simple website
Answer: a) It has content that can change or update based on user actions
22. What kind of database is commonly used with dynamic websites?
a) MySQL
b) Microsoft Word
c) Excel
d) XML files
Answer: a) MySQL
23. What is the benefit of using dynamic content?
a) It allows real-time updates and personalized content
b) It is less resource-intensive
c) It requires no server-side code
d) It is cheaper to develop
Answer: a) It allows real-time updates and personalized content
24. What is the main role of CSS in web development?
a) To create content dynamically
b) To style the appearance of web pages
c) To handle backend database queries
d) To run JavaScript code
Answer: b) To style the appearance of web pages
25. What is the function of HTML in a static website?
a) To structure the content of the web page
b) To add interactivity
c) To style the web page
d) To process server-side requests
Answer: a) To structure the content of the web page
26. Which of the following is a limitation of static websites?
a) Cannot easily update content without manual intervention
b) Cannot use CSS for styling
c) Require a CMS
d) Do not work with JavaScript
Answer: a) Cannot easily update content without manual intervention
27. What kind of content does a dynamic website typically display?
a) User-generated content that changes frequently
b) Fixed, static content only
c) Content stored in a text file
d) Content created with HTML and CSS only
Answer: a) User-generated content that changes frequently
28. Which of the following is a typical feature of static websites?
a) They are faster to load compared to dynamic websites
b) They allow content to be updated dynamically
c) They can interact with databases
d) They require server-side scripting
Answer: a) They are faster to load compared to dynamic websites
29. Which of the following technologies is used in the backend of dynamic
websites?
a) PHP, Python, Ruby
b) HTML, CSS, and JavaScript
c) XML and JSON
d) Google Analytics
Answer: a) PHP, Python, Ruby
30. What is a major drawback of dynamic websites?
a) They require more resources and server power
b) They are too simple to develop
c) They have no interactivity
d) They don’t require databases
Answer: a) They require more resources and server power
31. What is a common use of a static website?
a) Personal portfolios and informational pages
b) E-commerce websites
c) Websites with dynamic user interaction
d) Websites with frequent updates
Answer: a) Personal portfolios and informational pages
32. Which of the following does not require server-side processing?
a) Static website
b) Online shopping cart
c) Content management system
d) Blog with dynamic posts
Answer: a) Static website
33. Which programming language is used to add interactivity to a website's
frontend?
a) JavaScript
b) PHP
c) Python
d) HTML
Answer: a) JavaScript
34. What does a dynamic website allow users to do?
a) View content only
b) Interact with content and generate dynamic responses
c) Browse a collection of static pages
d) View unchanging information
Answer: b) Interact with content and generate dynamic responses
35. What makes dynamic websites more flexible than static websites?
a) They can change content based on user inputs and interactions
b) They don’t require a database
c) They use simpler code
d) They require less server maintenance
Answer: a) They can change content based on user inputs and interactions
36. What does CMS stand for in web development?
a) Custom Management System
b) Content Management System
c) Creative Marketing Software
d) Code Management Solution
Answer: b) Content Management System
37. Which type of website usually requires more complex hosting setups?
a) Static websites
b) Dynamic websites
c) Both require similar setups
d) None require hosting
Answer: b) Dynamic websites
38. Which type of website typically loads faster?
a) Dynamic websites
b) Static websites
c) Both load equally fast
d) Dynamic websites with cache
Answer: b) Static websites
39. What is a disadvantage of using static websites for e-commerce?
a) They cannot update products dynamically without manual updates
b) They require a server-side database
c) They are too interactive
d) They need to use server-side scripting
Answer: a) They cannot update products dynamically without manual updates
40. What is an example of a dynamic content management tool?
a) WordPress
b) Notepad++
c) Sublime Text
d) FileZilla
Answer: a) WordPress
41. Which scripting language is often used for frontend dynamic content?
a) JavaScript
b) PHP
c) Ruby
d) Java
Answer: a) JavaScript
42. What type of website typically requires a database?
a) Dynamic websites
b) Static websites
c) Both types of websites
d) Neither type of website
Answer: a) Dynamic websites
43. Which of the following makes a website dynamic?
a) The use of external links
b) User interaction with the website that changes its content
c) Static HTML content
d) A blog with fixed posts
Answer: b) User interaction with the website that changes its content
44. What is the main benefit of dynamic web pages?
a) They offer personalized content
b) They are cheaper to host
c) They don't require a server
d) They use less bandwidth
Answer: a) They offer personalized content
45. Which type of website uses a backend database to store content?
a) Static websites
b) Dynamic websites
c) Both static and dynamic websites
d) None
Answer: b) Dynamic websites
46. Which of the following is an example of dynamic content?
a) A user’s profile page that updates with new posts
b) A homepage with static images and text
c) A video embedded from YouTube
d) A downloadable PDF
Answer: a) A user’s profile page that updates with new posts
47. What is an advantage of using a dynamic website for a business?
a) It allows businesses to update their offerings in real time
b) It requires less server power
c) It is more secure
d) It is easier to design
Answer: a) It allows businesses to update their offerings in real time
48. Which of the following is a common tool for building dynamic websites?
a) Drupal
b) Flash
c) Photoshop
d) Dreamweaver
Answer: a) Drupal
49. Which part of a dynamic website typically requires server-side
programming?
a) The part that interacts with the database
b) The style of the website
c) The images displayed
d) The frontend interface
Answer: a) The part that interacts with the database
50. What is a common feature of dynamic websites?
a) They can include forms that process user input
b) They don’t use JavaScript
c) They are always hosted on shared servers
d) They have static HTML content
Answer: a) They can include forms that process user input
RESPONSIVE WEB DESIGN
1. What is responsive web design?
a) A design approach where the layout adapts to the size of the screen
b) A design approach that ensures websites are mobile-friendly
c) A design for desktop-only websites
d) A method of designing for large screens only
Answer: b) A design approach that ensures websites are mobile-friendly
2. What is the main benefit of using responsive web design?
a) It ensures the website is accessible across devices with varying screen sizes
b) It makes the website look good only on desktop computers
c) It requires the website to be rewritten for each device
d) It makes the website faster to load
Answer: a) It ensures the website is accessible across devices with varying screen sizes
3. Which CSS property is commonly used to create a responsive layout?
a) media queries
b) background-image
c) z-index
d) font-size
Answer: a) media queries
4. Which of the following is an essential part of responsive web design?
a) Fluid grid layouts
b) Fixed-width containers
c) Static images only
d) Large font sizes for all devices
Answer: a) Fluid grid layouts
5. What is a media query in CSS?
a) A tool for making websites mobile-friendly
b) A CSS rule that applies styles based on the characteristics of the device
c) A rule used to apply different styles based on screen size and device type
d) A plugin for web development
Answer: c) A rule used to apply different styles based on screen size and device type
6. Which HTML element is used to make images responsive?
a) <img> with max-width: 100%
b) <div> with height: 100%
c) <span> with max-height: 100%
d) <picture> with static width
Answer: a) <img> with max-width: 100%
7. In responsive design, what does "fluid grid" refer to?
a) A grid with fixed dimensions
b) A grid that uses percentages rather than pixels for layout
c) A layout that only works on mobile devices
d) A grid that doesn't change with screen size
Answer: b) A grid that uses percentages rather than pixels for layout
8. Which of the following is a common break-point for media queries?
a) 768px
b) 1024px
c) 2560px
d) 512px
Answer: a) 768px
9. What is the purpose of the viewport meta tag in responsive web design?
a) To set the size of the website’s font
b) To define the width of the content
c) To control the layout on mobile devices by setting the viewport width
d) To add JavaScript functionality
Answer: c) To control the layout on mobile devices by setting the viewport width
10. How does a responsive web design adapt to different screen sizes?
a) It changes font sizes only
b) It uses media queries and flexible layouts
c) It adjusts the layout, images, and content based on the screen size
d) It limits content based on device resolution
Answer: c) It adjusts the layout, images, and content based on the screen size
11. Which of the following CSS properties is used for making a flexible
layout?
a) flexbox
b) grid-template-columns
c) float
d) display:inline
Answer: a) flexbox
12. What is the role of "em" units in responsive web design?
a) They are relative units used to scale elements based on the font size
b) They represent fixed sizes
c) They define margins for text
d) They are used to create non-resizable images
Answer: a) They are relative units used to scale elements based on the font size
13. What is the purpose of the "rem" unit in CSS?
a) To set a fixed margin
b) To set the font size relative to the root element's font size
c) To make the website interactive
d) To specify the width of an element
Answer: b) To set the font size relative to the root element's font size
14. What is one advantage of using responsive design over a separate mobile
site?
a) You only need to maintain one website
b) It allows more content to be shown on mobile devices
c) It is easier to create separate mobile sites for different devices
d) It reduces the cost of hosting multiple sites
Answer: a) You only need to maintain one website
15. What is the typical layout pattern used in responsive web design?
a) Fixed-width design
b) Fluid layout with flexible grids and images
c) Parallax scrolling
d) Horizontal scrolling
Answer: b) Fluid layout with flexible grids and images
16. How can you make text more legible on mobile devices?
a) By increasing the font size using pixels
b) By using relative units like "em" and "rem"
c) By making all text uppercase
d) By decreasing the line-height
Answer: b) By using relative units like "em" and "rem"
17. What is a mobile-first approach in responsive web design?
a) Designing the desktop version first, then adapting to mobile
b) Designing for mobile devices first, then scaling up for larger devices
c) Making the website compatible only with smartphones
d) Designing a separate version for each device
Answer: b) Designing for mobile devices first, then scaling up for larger devices
18. Which of the following is the correct media query for targeting screens
with a width of 600px or less?
a) @media (max-width: 600px) { ... }
b) @media (min-width: 600px) { ... }
c) @media (device-width: 600px) { ... }
d) @media (width: 600px) { ... }
Answer: a) @media (max-width: 600px) { ... }
19. What is the typical width of the viewport on mobile devices?
a) 1280px
b) 1920px
c) 320px to 480px
d) 1024px
Answer: c) 320px to 480px
20. What does the term "adaptive design" refer to in web design?
a) A design that doesn't adapt to any device
b) A design that always has the same layout across devices
c) A design approach where the layout adjusts based on predefined screen sizes
d) A design focused only on the desktop version
Answer: c) A design approach where the layout adjusts based on predefined screen sizes
21. Which of the following is a key feature of responsive web design?
a) Fixed layouts for each device
b) Dynamic content resizing based on the viewport
c) Reduced text for mobile devices
d) Static, non-interactive elements
Answer: b) Dynamic content resizing based on the viewport
22. Which CSS property is used to create flexible boxes in a layout?
a) display: block
b) display: flex
c) position: absolute
d) position: relative
Answer: b) display: flex
23. Which of the following design patterns is typically used in responsive web
design?
a) Two-column fixed-width layout
b) Single-column fluid layout
c) A full-screen image layout
d) Fixed-width three-column layout
Answer: b) Single-column fluid layout
24. What is the role of "viewport width (vw)" in responsive design?
a) It is a relative unit based on the width of the viewport
b) It is a fixed pixel width
c) It determines the width of images
d) It defines the width of navigation bars
Answer: a) It is a relative unit based on the width of the viewport
25. How can media queries be combined for different screen sizes?
a) By using only one media query for all screen sizes
b) By stacking multiple media queries for various device widths
c) By using inline styles for each screen size
d) By disabling media queries for small screens
Answer: b) By stacking multiple media queries for various device widths
26. Which of the following makes images more responsive?
a) Setting a fixed pixel width
b) Using the CSS max-width property
c) Setting the image width to 1000px
d) Using fixed-width containers for images
Answer: b) Using the CSS max-width property
27. What is a responsive layout?
a) A layout that remains fixed
b) A layout that adjusts dynamically to different screen sizes
c) A layout that requires no code
d) A layout that uses high-quality images only
Answer: b) A layout that adjusts dynamically to different screen sizes
28. Why should you use relative units like percentages, em, or rem in
responsive web design?
a) To ensure that elements scale according to the screen size and resolution
b) To reduce the file size of the website
c) To create fixed widths
d) To increase the speed of the website
Answer: a) To ensure that elements scale according to the screen size and resolution
29. What type of design layout is typically avoided in responsive design?
a) Flexible grid layouts
b) Fixed-width layouts
c) Fluid layouts
d) Fluid image layouts
Answer: b) Fixed-width layouts
30. How can you optimize a website for mobile devices in responsive design?
a) By using larger font sizes and fixed layouts
b) By making the content only accessible on mobile browsers
c) By designing with touch-friendly features and optimizing media queries
d) By adding more images for better appearance
Answer: c) By designing with touch-friendly features and optimizing media queries
31. What is the main goal of responsive web design?
a) To make websites look the same on all devices
b) To create desktop-only websites
c) To ensure the website content adjusts smoothly across devices and screen sizes
d) To reduce the use of CSS in web development
Answer: c) To ensure the website content adjusts smoothly across devices and screen
sizes
32. Which of the following is NOT a benefit of responsive design?
a) It provides a consistent experience across different screen sizes
b) It improves SEO by making the website mobile-friendly
c) It saves time and effort by maintaining one website for all devices
d) It ensures websites load faster on desktop computers
Answer: d) It ensures websites load faster on desktop computers
33. Which of the following is typically used to make a layout responsive?
a) Fixed-width grids
b) Flexible grid layouts using percentages
c) Static images
d) Horizontal scrolling
Answer: b) Flexible grid layouts using percentages
34. What is a common strategy for optimizing images in responsive design?
a) Use very large images to improve quality
b) Use image resizing techniques or the srcset attribute for responsive images
c) Use only PNG images
d) Set images to a fixed size for all devices
Answer: b) Use image resizing techniques or the srcset attribute for responsive images
35. What does the CSS property "max-width: 100%" do for images in a
responsive layout?
a) It allows the image to scale down if the container is too small
b) It sets a fixed size for images
c) It prevents images from scaling at all
d) It allows the image to scale down proportionally but not exceed its container’s
width
Answer: d) It allows the image to scale down proportionally but not exceed its
container’s width
36. Which device is most likely to use the "small" breakpoint in a responsive
layout?
a) Smartphone
b) Desktop computer
c) Tablet
d) Laptop
Answer: a) Smartphone
37. Which of the following is a common issue when using responsive web
design?
a) The layout appears broken on smaller screens
b) Slow load times due to large images and unoptimized content
c) The website becomes non-interactive
d) Inconsistent font rendering
Answer: b) Slow load times due to large images and unoptimized content
38. What type of CSS layout module is used to create flexible, responsive page
layouts in CSS3?
a) Flexbox
b) Grid
c) Float
d) Table layout
Answer: a) Flexbox
39. What is a common breakpoint for tablets in responsive web design?
a) 320px
b) 480px
c) 768px
d) 1024px
Answer: c) 768px
40. What is the benefit of the "srcset" attribute in responsive web design?
a) It allows the browser to choose the appropriate image based on the device's
resolution and size
b) It makes images static across devices
c) It sets the width of the image on all devices
d) It ensures images are compressed for faster loading
Answer: a) It allows the browser to choose the appropriate image based on the device's
resolution and size
41. What does the term "fluid typography" refer to in responsive design?
a) Adjusting font sizes based on the viewport width
b) Making font sizes fixed for all screen sizes
c) Changing font styles for different screen sizes
d) Setting font sizes using pixels only
Answer: a) Adjusting font sizes based on the viewport width
42. How can responsive design improve SEO?
a) By providing a mobile-friendly experience, which is a ranking factor for
search engines
b) By limiting the amount of content on the page
c) By using larger images to improve page ranking
d) By reducing the number of hyperlinks on the site
Answer: a) By providing a mobile-friendly experience, which is a ranking factor for
search engines
43. Which of the following is an example of a flexible layout in responsive
design?
a) A layout that adjusts its columns based on the screen size
b) A layout that only displays in one column
c) A layout with fixed widths for each column
d) A layout with content that doesn’t change
Answer: a) A layout that adjusts its columns based on the screen size
44. Which of the following is NOT typically recommended for responsive web
design?
a) Using large, uncompressed images for all devices
b) Using relative units like "em" and "rem" for font sizes
c) Implementing media queries for different screen sizes
d) Designing touch-friendly interfaces
Answer: a) Using large, uncompressed images for all devices
45. How can media queries be used to adjust text sizes in responsive design?
a) By using pixels to set font size
b) By using relative units like em and rem inside media queries
c) By keeping font size the same across all screen sizes
d) By adding fixed pixel sizes in the CSS file
Answer: b) By using relative units like em and rem inside media queries
46. What is the role of "min-width" in media queries?
a) It targets screens that are equal to or wider than the specified width
b) It targets only small screens
c) It targets screens with a width less than the specified value
d) It adjusts the content to be larger than the screen
Answer: a) It targets screens that are equal to or wider than the specified width
47. What does a mobile-first approach to responsive design prioritize?
a) Designing for desktop users first
b) Designing for tablets first
c) Designing for mobile users first, then scaling up for larger devices
d) Designing for large screens first
Answer: c) Designing for mobile users first, then scaling up for larger devices
48. How do flexible grids improve responsiveness?
a) By making the layout fixed and unchangeable
b) By using percentage-based widths for columns and containers
c) By limiting the number of columns
d) By using fixed units like pixels for the container width
Answer: b) By using percentage-based widths for columns and containers
49. Which of the following is a common breakpoint for larger screens like
desktops?
a) 320px
b) 1024px
c) 480px
d) 768px
Answer: b) 1024px
50. What is the importance of the viewport meta tag in responsive web
design?
a) It prevents users from zooming in on mobile devices
b) It sets the color scheme for the website
c) It controls the layout and scaling of content on mobile devices
d) It forces the website to only be viewed in landscape mode
Answer: c) It controls the layout and scaling of content on mobile devices
API / WEB SERVICES
1. What does API stand for?
a) Application Process Integration
b) Application Programming Interface
c) Advanced Programming Interface
d) Automated Process Integration
Answer: b) Application Programming Interface
2. What is the main purpose of a Web Service?
a) To allow different applications to communicate with each other over the web
b) To encrypt user data
c) To store large amounts of data
d) To speed up a website’s loading time
Answer: a) To allow different applications to communicate with each other over the
web
3. Which protocol is commonly used for web services communication?
a) FTP
b) HTTP/HTTPS
c) SMTP
d) SSH
Answer: b) HTTP/HTTPS
4. Which of the following is an example of a Web Service?
a) REST API
b) Local server
c) DNS server
d) FTP server
Answer: a) REST API
5. What is SOAP in the context of web services?
a) A protocol for transferring binary data
b) A protocol for exchanging structured information in the implementation of
web services
c) A programming language
d) A database management system
Answer: b) A protocol for exchanging structured information in the implementation of
web services
6. What does REST stand for in web services?
a) Representational State Transfer
b) Random Access Storage Transfer
c) Regional Service Transport
d) Remote Event State Transmission
Answer: a) Representational State Transfer
7. What is the most commonly used format for data exchange in RESTful
APIs?
a) JSON
b) XML
c) CSV
d) YAML
Answer: a) JSON
8. Which of the following is true about REST APIs?
a) REST APIs only support XML data format
b) REST APIs are stateless, meaning each request is independent
c) REST APIs use SOAP as their messaging protocol
d) REST APIs are only for client-server communication
Answer: b) REST APIs are stateless, meaning each request is independent
9. What HTTP method is used to retrieve data from a server in REST API?
a) POST
b) GET
c) PUT
d) DELETE
Answer: b) GET
10. Which of the following HTTP methods is used to update existing data on a
server?
a) GET
b) POST
c) PUT
d) DELETE
Answer: c) PUT
11. What is JSON used for in web services?
a) Data interchange format between client and server
b) Defining the structure of a database
c) Storing configuration settings
d) Encrypting user data
Answer: a) Data interchange format between client and server
12. What does the "Status Code 200" indicate in an HTTP response?
a) The request was invalid
b) The request was successful
c) The resource is temporarily unavailable
d) The server has encountered an error
Answer: b) The request was successful
13. What is the primary advantage of using Web Services in application
development?
a) It allows for platform-independent communication
b) It improves security by encrypting data
c) It reduces the overall complexity of applications
d) It helps reduce server load
Answer: a) It allows for platform-independent communication
14. What is the main difference between REST and SOAP?
a) SOAP is simpler than REST
b) REST uses XML while SOAP uses JSON
c) REST is more lightweight and uses HTTP methods directly
d) SOAP is faster than REST
Answer: c) REST is more lightweight and uses HTTP methods directly
15. Which HTTP status code represents "Resource not found"?
a) 200
b) 400
c) 404
d) 500
Answer: c) 404
16. Which of the following is NOT a type of Web Service?
a) REST
b) WIS
c) SOAP
d) GraphQL
Answer: b) WIS
17. Which technology is typically used for authentication in Web APIs?
a) SSL
b) OAuth
c) SSH
d) FTP
Answer: b) OAuth
18. What does WSDL stand for in SOAP Web Services?
a) Web Service Description Language
b) Web Structured Data Language
c) Web Service Data Layer
d) Web Security Description Layer
Answer: a) Web Service Description Language
19. What is an endpoint in the context of a Web API?
a) The location where the client sends requests to interact with the server
b) The specific URL or URI where the web service is accessed
c) The format of the data returned by the server
d) The security key used for API access
Answer: b) The specific URL or URI where the web service is accessed
20. What is the purpose of the "Authorization" header in HTTP requests to
an API?
a) To define the content type of the request
b) To provide authentication credentials for accessing protected resources
c) To specify the type of data the client wants to receive
d) To set the server's response timeout
Answer: b) To provide authentication credentials for accessing protected resources
21. What is an API Gateway?
a) A database used for storing API keys
b) A firewall that protects API data
c) A server that manages and routes API requests to the appropriate backend
services
d) A tool for analyzing API performance
Answer: c) A server that manages and routes API requests to the appropriate backend
services
22. Which of the following protocols is NOT used in Web Services?
a) FTP
b) HTTP
c) SOAP
d) SMTP
Answer: a) FTP
23. What is an API Key used for?
a) To authenticate and authorize access to an API
b) To track API usage statistics
c) To encrypt data being sent to the API
d) To ensure the integrity of data
Answer: a) To authenticate and authorize access to an API
24. What is an XML-based messaging protocol used in Web Services?
a) REST
b) SOAP
c) JSON
d) YAML
Answer: b) SOAP
25. What is the purpose of the "Content-Type" header in HTTP requests?
a) To define the server’s type
b) To indicate the media type of the resource or request body
c) To specify the client’s device type
d) To set the response status code
Answer: b) To indicate the media type of the resource or request body
26. What does the term "Web Service Interoperability" mean?
a) Web services cannot communicate with each other
b) Web services are platform-dependent
c) Web services from different vendors can work together and communicate
d) Web services are not secure
Answer: c) Web services from different vendors can work together and communicate
27. Which of the following is an HTTP method used to create resources in
REST APIs?
a) GET
b) POST
c) PUT
d) DELETE
Answer: b) POST
28. Which of the following is true about SOAP Web Services?
a) They are based on REST architecture
b) They do not require XML for communication
c) They rely on XML for both message formatting and communication
d) They use HTTP for communication only
Answer: c) They rely on XML for both message formatting and communication
29. What is the role of a RESTful API?
a) To enforce strict security protocols
b) To allow client-server communication using HTTP methods
c) To convert XML to JSON
d) To provide a stateless and lightweight communication model over HTTP
Answer: d) To provide a stateless and lightweight communication model over HTTP
30. How can you handle errors in REST API responses?
a) By using "200 OK" for all responses
b) By using a custom error code system
c) By using standard HTTP status codes (e.g., 404 for not found, 500 for server
error)
d) By ignoring errors and continuing
Answer: c) By using standard HTTP status codes (e.g., 404 for not found, 500 for server
error)
31. What is the main difference between RESTful and SOAP web services?
a) SOAP is lighter and easier to implement than REST
b) SOAP is protocol-based and REST is architecture-based
c) SOAP does not use HTTP
d) REST requires XML for all communications
Answer: b) SOAP is protocol-based and REST is architecture-based
32. What does the HTTP status code "500" indicate in a web service
response?
a) Resource not found
b) Request was successful
c) Internal server error
d) Unauthorized access
Answer: c) Internal server error
33. Which of the following is a key feature of a RESTful web service?
a) Uses HTTP methods like GET, POST, PUT, and DELETE
b) Requires a specific client-side programming language
c) Always returns XML
d) Only works with a particular web browser
Answer: a) Uses HTTP methods like GET, POST, PUT, and DELETE
34. What is an advantage of using JSON over XML in APIs?
a) JSON is more secure than XML
b) JSON is more compact and easier to parse
c) JSON can only be used for GET requests
d) JSON has better support for multimedia content
Answer: b) JSON is more compact and easier to parse
35. Which of the following is true about RESTful APIs?
a) REST APIs require stateful communication
b) REST APIs cannot be cached
c) REST APIs are stateless and can be cached
d) REST APIs use only XML for data transfer
Answer: c) REST APIs are stateless and can be cached
36. Which HTTP status code indicates that a resource has been successfully
created?
a) 400
b) 201
c) 404
d) 500
Answer: b) 201
37. What is the main function of the 'Accept' header in an HTTP request?
a) It specifies the media type the client expects from the server
b) It defines the request timeout
c) It stores the request body data
d) It defines the language preference
Answer: a) It specifies the media type the client expects from the server
38. Which of the following is a type of Web Service that uses REST
architecture?
a) WSDL
b) RESTful API
c) SOAP API
d) HTTP
Answer: b) RESTful API
39. Which of the following tools can be used for testing Web APIs?
a) Postman
b) WordPress
c) MySQL
d) Apache Server
Answer: a) Postman
40. What does the term "stateless" mean in the context of RESTful APIs?
a) The server maintains the session between requests
b) Each request is independent, and no session is stored between requests
c) The client must send a session ID with each request
d) The server stores data on the client’s device
Answer: b) Each request is independent, and no session is stored between requests
41. What does "CORS" stand for in Web API security?
a) Cross-Origin Resource Sharing
b) Centralized Open Resource Service
c) Common Origin Resource Service
d) Cross-Origin Return Service
Answer: a) Cross-Origin Resource Sharing
42. In the context of web services, what is "Rate Limiting"?
a) Preventing unauthorized access
b) Limiting the number of API requests a client can make in a given time period
c) Caching API responses for faster access
d) Encrypting API request and response data
Answer: b) Limiting the number of API requests a client can make in a given time
period
43. Which of the following methods is typically used to authenticate API
requests?
a) API Keys
b) OAuth tokens
c) Base64 encoding
d) SHA256 hashing
Answer: b) OAuth tokens
44. What does the "Cache-Control" header do in an API response?
a) It encrypts the response data
b) It sets the content type for the response
c) It controls how long the response data can be cached by the client or
intermediary servers
d) It prevents unauthorized access to the response data
Answer: c) It controls how long the response data can be cached by the client or
intermediary servers
45. Which of the following is true about WebSockets in relation to Web
Services?
a) WebSockets enable full-duplex communication channels over a single, long-
lived connection
b) WebSockets are only used for HTTP requests
c) WebSockets are used for one-time data exchange only
d) WebSockets are not supported by REST APIs
Answer: a) WebSockets enable full-duplex communication channels over a single, long-
lived connection
46. Which of the following is a primary benefit of using Web Services?
a) It allows integration between different systems regardless of programming
language or platform
b) It simplifies database management
c) It reduces the size of the web pages
d) It improves network security
Answer: a) It allows integration between different systems regardless of programming
language or platform
47. Which HTTP status code represents an unauthorized access attempt to a
resource?
a) 200
b) 401
c) 404
d) 500
Answer: b) 401
48. What is a common use case for Web Services?
a) To manage database transactions
b) To enable communication between different applications over the internet
c) To store large datasets in a centralized database
d) To handle file compression
Answer: b) To enable communication between different applications over the internet
49. Which method is used in REST APIs to delete a resource?
a) GET
b) POST
c) DELETE
d) PUT
Answer: c) DELETE
50. What is the purpose of Swagger in Web API development?
a) To create a real-time API communication system
b) To provide documentation and testing tools for APIs
c) To handle API requests
d) To monitor the security of APIs
Answer: b) To provide documentation and testing tools for APIs
W3C STANDARDS
1. What does W3C stand for?
a) Web Worldwide Community
b) Web World Council
c) World Wide Web Consortium
d) Web Services Collaboration
Answer: c) World Wide Web Consortium
2. Who is the founder of W3C?
a) Tim Berners-Lee
b) Vint Cerf
c) Mark Zuckerberg
d) Steve Jobs
Answer: a) Tim Berners-Lee
3. What is the primary goal of the W3C?
a) To create the best web browsers
b) To promote the development of cloud services
c) To develop open standards for the web
d) To regulate the usage of social media
Answer: c) To develop open standards for the web
4. Which of the following is a W3C standard for structuring web pages?
a) HTML (Hypertext Markup Language)
b) CSS (Cascading Style Sheets)
c) JavaScript
d) PHP
Answer: a) HTML (Hypertext Markup Language)
5. What does the W3C's "HTML5" standard refer to?
a) A new web browser
b) The fifth revision of the HTML standard used to create and display web pages
c) A tool for web page optimization
d) A protocol for secure data exchange
Answer: b) The fifth revision of the HTML standard used to create and display web
pages
6. Which of the following is NOT a part of the W3C specifications?
a) XMLHttpRequest
b) SOAP
c) CSS3
d) SVG
Answer: a) XMLHttpRequest
7. What does the W3C's "CSS" standard define?
a) The style and layout of web pages
b) The structure of HTML tags
c) The logic of JavaScript execution
d) The interaction between users and websites
Answer: a) The style and layout of web pages
8. What is the main purpose of the W3C's "WCAG" guidelines?
a) To improve the performance of web browsers
b) To ensure accessibility for users with disabilities
c) To create mobile-friendly websites
d) To protect web servers from cyber-attacks
Answer: b) To ensure accessibility for users with disabilities
9. Which of the following is an example of a W3C standard for describing
vector graphics?
a) HTML
b) SVG (Scalable Vector Graphics)
c) JavaScript
d) JPEG
Answer: b) SVG (Scalable Vector Graphics)
10. What is the primary purpose of the W3C's "XML" standard?
a) To define webpage styles
b) To allow the encoding and sharing of data between different systems
c) To optimize images for the web
d) To improve webpage performance
Answer: b) To allow the encoding and sharing of data between different systems
11. What does the W3C's "DOM" standard define?
a) A programming interface for web documents
b) A method for controlling web server data
c) The layout of web content on a browser
d) A protocol for communicating with databases
Answer: a) A programming interface for web documents
12. Which of the following standards is used to create interactive forms on
websites?
a) HTML Forms
b) SVG
c) XML
d) CSS3
Answer: a) HTML Forms
13. What does the W3C standard "ARIA" stand for?
a) Advanced Renderable Interactive Architecture
b) Accessible Rich Internet Applications
c) Accessible Resource Information
d) Adaptive Renderable Internet Architecture
Answer: b) Accessible Rich Internet Applications
14. What is the role of the "W3C Validation Service"?
a) To verify website security
b) To check if web pages conform to W3C standards
c) To optimize webpage load times
d) To detect malware in web pages
Answer: b) To check if web pages conform to W3C standards
15. What is the goal of the W3C's "Open Web Platform"?
a) To create proprietary technologies for web development
b) To make web technologies closed-source
c) To provide a common framework for building rich web applications
d) To establish the fastest web browsers
Answer: c) To provide a common framework for building rich web applications
16. Which of the following is true about the W3C's "HTML5" standard?
a) It was released in 1999
b) It is only used for web pages in mobile browsers
c) It introduces new features for multimedia and graphics
d) It does not support multimedia content
Answer: c) It introduces new features for multimedia and graphics
17. Which organization is responsible for managing W3C standards?
a) The United Nations
b) The European Commission
c) The World Wide Web Consortium (W3C)
d) The World Bank
Answer: c) The World Wide Web Consortium (W3C)
18. What is the "W3C Markup Validation Service" used for?
a) To validate the security of a website
b) To check the syntax of HTML and XHTML code against W3C standards
c) To track the performance of a website
d) To optimize images on the website
Answer: b) To check the syntax of HTML and XHTML code against W3C standards
19. What is the W3C's "CORS" standard related to?
a) File compression
b) Cross-Origin Resource Sharing (to allow web pages to make requests across
different domains)
c) Server-side rendering
d) Image optimization
Answer: b) Cross-Origin Resource Sharing (to allow web pages to make requests across
different domains)
20. What is the purpose of W3C's "Mobile Web Best Practices"?
a) To improve web browser speed
b) To optimize websites for mobile devices
c) To secure mobile applications
d) To improve website SEO
Answer: b) To optimize websites for mobile devices
21. Which of the following W3C standards supports the creation of web fonts?
a) SVG
b) Web Open Font Format (WOFF)
c) HTTP
d) WebAssembly
Answer: b) Web Open Font Format (WOFF)
22. What is the goal of the W3C's "HTTP/2" standard?
a) To improve the performance of web pages by reducing latency
b) To secure web communications
c) To store data in web pages
d) To optimize HTML for faster loading
Answer: a) To improve the performance of web pages by reducing latency
23. What is the "W3C Web Content Accessibility Guidelines (WCAG)" used
for?
a) To define HTML syntax
b) To improve web accessibility for people with disabilities
c) To validate the performance of a website
d) To optimize web design for mobile devices
Answer: b) To improve web accessibility for people with disabilities
24. What is the purpose of the "W3C's Web Platform Tests"?
a) To track the SEO performance of a website
b) To test if web technologies conform to W3C standards
c) To detect malicious code in websites
d) To monitor website downtime
Answer: b) To test if web technologies conform to W3C standards
25. What is the W3C "DOM Level 2" standard related to?
a) Defining the structure of XML files
b) The interaction between HTML or XML documents and programming
languages like JavaScript
c) Optimizing CSS for web pages
d) Managing web server settings
Answer: b) The interaction between HTML or XML documents and programming
languages like JavaScript
26. Which of the following is the W3C standard for writing styles for web
pages?
a) JavaScript
b) CSS (Cascading Style Sheets)
c) HTML
d) JSON
Answer: b) CSS (Cascading Style Sheets)
27. What is the role of W3C's "Schema.org"?
a) To store user data in a web database
b) To define a common set of schemas for structured data on the web
c) To create secure connections for APIs
d) To define server-side scripting languages
Answer: b) To define a common set of schemas for structured data on the web
28. What does the W3C standard for "HTML5 Web Storage" allow?
a) Storing images on the server
b) Storing data locally on the user's browser
c) Encrypting data on the server
d) Compressing files for faster download
Answer: b) Storing data locally on the user's browser
29. What does the W3C's "WebRTC" standard enable?
a) Real-time communication between browsers (audio, video, and data sharing)
b) Improved search engine indexing
c) Web-based video editing
d) Enhanced website security
Answer: a) Real-time communication between browsers (audio, video, and data
sharing)
30. Which W3C standard is used for improving security on the web?
a) HTTPS
b) HTTP/1.1
c) HTML5
d) HTTP/2
Answer: a) HTTPS
31. What is the primary goal of the W3C’s "WAI-ARIA" standard?
a) To improve the speed of websites
b) To create interactive websites
c) To improve accessibility for people with disabilities
d) To optimize web pages for mobile devices
Answer: c) To improve accessibility for people with disabilities
32. What does the W3C's "Geolocation API" standard enable?
a) To store user data securely
b) To get the geographic location of a user
c) To authenticate users
d) To manage server-side requests
Answer: b) To get the geographic location of a user
33. Which W3C standard is used to define the rules for displaying multimedia
content on the web?
a) CSS
b) HTML5 Video and Audio
c) JavaScript
d) XML
Answer: b) HTML5 Video and Audio
34. Which of the following is a key feature of the W3C's "WebAssembly"
standard?
a) It improves the accessibility of web content
b) It allows high-performance code to run in browsers
c) It enhances video streaming capabilities
d) It enables better database management
Answer: b) It allows high-performance code to run in browsers
35. What is the W3C's "Mobile Web Best Practices" focused on?
a) Improving website aesthetics
b) Ensuring websites are optimized for mobile devices
c) Enhancing video resolution
d) Securing web applications
Answer: b) Ensuring websites are optimized for mobile devices
36. Which W3C specification is responsible for web security?
a) Web Security Guidelines
b) Mobile Web Best Practices
c) XML Encryption
d) WebRTC
Answer: a) Web Security Guidelines
37. What is the W3C’s "JSON-LD" standard used for?
a) To encrypt JSON data
b) To structure JSON data for easier integration with Linked Data
c) To store large JSON files
d) To create multimedia content
Answer: b) To structure JSON data for easier integration with Linked Data
38. What is the W3C’s "SVG" standard used for?
a) To structure database queries
b) To create vector graphics for the web
c) To animate videos
d) To define the structure of HTML forms
Answer: b) To create vector graphics for the web
39. What does the W3C's "HTTP/2" standard improve?
a) Website security
b) The performance of HTTP connections
c) The structure of HTML tags
d) File compression techniques
Answer: b) The performance of HTTP connections
40. What does the W3C’s "Content Security Policy (CSP)" standard help
with?
a) Preventing cross-site scripting (XSS) attacks
b) Managing multimedia content
c) Storing content securely
d) Monitoring server traffic
Answer: a) Preventing cross-site scripting (XSS) attacks
41. Which of the following best describes the W3C’s "HTML5 Web Storage"?
a) A way to store data locally in a web browser for later use
b) A method of encrypting sensitive data
c) A service to manage database access
d) A way to improve web page loading speed
Answer: a) A way to store data locally in a web browser for later use
42. What is the W3C’s "CORS" policy used for?
a) Allowing resources to be requested from a different domain
b) Optimizing server-side operations
c) Structuring data for web storage
d) Improving content delivery on mobile
Answer: a) Allowing resources to be requested from a different domain
43. What is the purpose of the W3C's "HTML5 Canvas" element?
a) To store images
b) To draw graphics and animations on a web page
c) To display multimedia content
d) To animate videos
Answer: b) To draw graphics and animations on a web page
44. Which W3C standard is focused on enabling rich internet applications
through the web?
a) HTML5
b) CSS3
c) JavaScript
d) WebAssembly
Answer: a) HTML5
45. What is the W3C's "Internationalization" standard focused on?
a) Website aesthetics
b) Making websites and web applications accessible to users from different
cultures and languages
c) Web browser development
d) Content security
Answer: b) Making websites and web applications accessible to users from different
cultures and languages
46. What is the role of the W3C’s "Web Payments" standard?
a) To secure user login data
b) To enable payments on the web
c) To improve content delivery on mobile devices
d) To manage website security
Answer: b) To enable payments on the web
47. Which of the following is true about the W3C’s "Web of Things (WoT)"
standard?
a) It connects everyday physical objects to the web
b) It is focused on improving website aesthetics
c) It allows users to make secure online payments
d) It improves mobile app compatibility
Answer: a) It connects everyday physical objects to the web
48. What is the W3C's "Digital Publishing" standard designed to support?
a) Data encryption
b) The creation and distribution of digital books and publications
c) Video streaming services
d) Web server management
Answer: b) The creation and distribution of digital books and publications
49. Which W3C standard supports the creation of web APIs?
a) RESTful Web Services
b) SOAP
c) XML Schema
d) HTML5
Answer: a) RESTful Web Services
50. What is the W3C's "Web Annotation" standard used for?
a) Storing web content securely
b) Enabling annotations and comments on web content
c) Optimizing web server load
d) Generating rich media content
Answer: b) Enabling annotations and comments on web content