1. What type of library is React?
A) Framework
B) Library
C) Plugin
D) Language
2. Which company invented Angular?
A) Facebook
B) Google
C) Microsoft
D) Apple
3. What is a prerequisite for using React?
A) Knowledge of Python
B) Knowledge of HTML, CSS, JavaScript, and Git
C) Knowledge of SQL
D) Knowledge of Java
4. What does React primarily create?
A) Server-side applications
B) User interface components
C) Databases
D) APIs
5. Which of the following is NOT a reason to choose React?
A) Easy to learn
B) Rich user interfaces
C) Slow development
D) Strong community support
6. What is JSX?
A) A programming language
B) A syntax extension for JavaScript
C) A database
D) A CSS framework
7. Which of the following companies does NOT use React?
A) Facebook
B) Tesla
C) Microsoft
D) Netflix
8. What is the first step to start using React?
A) Download Visual Studio Code
B) Install Node.js
C) Write HTML
D) Create a database
9. What is the purpose of the <div> tag in React?
A) To create a new component
B) To group elements together
C) To define a style
D) To create a link
10. How does React handle HTML and CSS?
A) Separately
B) Together in JavaScript
C) Only in CSS files
D) Only in HTML files
JavaScript Lecture Questions
11. When was JavaScript introduced?
A) 1990
B) 1995
C) 2000
D) 2005
12. What is the correct way to add external JavaScript to HTML?
A) <script src="file.js"></script>
B) <script file="file.js"></script>
C) <js src="file.js"></js>
D) <javascript src="file.js"></javascript>
13. Which of the following is NOT a way to add JavaScript to HTML?
A) Inline
B) Internal
C) External
D) Local
14. What does the alert() function do in JavaScript?
A) Writes to the document
B) Displays an alert box
C) Logs to the console
D) Changes the background color
15. What is the scope of a variable declared with var?
A) Block scope
B) Function scope
C) Global scope
D) Local scope
16. Which statement is used for conditional control in JavaScript?
A) if
B) for
C) while
D) switch
17. What does the let keyword do in JavaScript?
A) Declares a global variable
B) Declares a block-scoped variable
C) Declares a constant variable
D) Declares a function
18. Which loop is a compact form of looping in JavaScript?
A) For loop
B) While loop
C) Do-while loop
D) Infinite loop
19. What is the output of console.log(2 + 2)?
A) "22"
B) 4
C) "4"
D) 2 + 2
20. How do you declare an array in JavaScript?
A) var myArray = []
B) var myArray = {}
C) var myArray = ()
D) var myArray = <>
HTML & CSS Lecture Questions
21. What does the <fieldset> tag do in HTML?
A) Groups related form controls
B) Defines a table
C) Creates a link
D) Embeds a video
22. Which tag is used to add comments in HTML?
A) <!-- comment -->
B) // comment
C) /* comment */
D) # comment
23. What is the purpose of the <legend> tag?
A) To create a new section
B) To provide a caption for a <fieldset>
C) To define a link
D) To add an image
24. Which of the following is a block-level element?
A) <span>
B) <div>
C) <a>
D) <img>
25. What is the correct syntax for a video tag in HTML?
A) <video src="video.mp4"></video>
B) <video file="video.mp4"></video>
C) <video link="video.mp4"></video>
D) <video src="video.mp4" controls></video>
26. What does the <iframe> tag do?
A) Embeds another webpage
B) Creates a new section
C) Defines a table
D) Adds a comment
27. Which attribute is used to specify an alternative text for an image?
A) src
B) alt
C) title
D) href
28. What is the purpose of the <alt> attribute in images?
A) To define the image source
B) To provide a description of the image
C) To set the image size
D) To create a link
29. How do you create a hyperlink in HTML?
A) <link href="url">
B) <a href="url">
C) <hyperlink href="url">
D) <url href="url">
30. What is the purpose of the <table> element?
A) To create a list
B) To display tabular data
C) To define a section
D) To add a comment
General Web Development Questions
31. What is the role of a web browser?
A) To host websites
B) To access and display web pages
C) To create web pages
D) To store data
32. What does HTTP stand for?
A) HyperText Transfer Protocol
B) HyperText Transmission Protocol
C) HyperText Transfer Process
D) HyperText Transfer Program
33. What is the purpose of DNS?
A) To store web content
B) To translate domain names to IP addresses
C) To secure web pages
D) To create web applications
34. Which of the following is a rendering engine?
A) Chrome
B) Firefox
C) Safari
D) All of the above
35. What is the main purpose of CSS?
A) To structure web pages
B) To style web pages
C) To add interactivity
D) To store data
36. What does the <head> element contain?
A) The main content of the page
B) Metadata about the document
C) The footer of the page
D) The main navigation
37. What is the purpose of the <body> tag?
A) To define the document type
B) To contain the main content of the page
C) To add metadata
D) To create a link
38. Which of the following is NOT a valid HTML tag?
A) <div>
B) <span>
C) <link>
D) <text>
39. What is the correct way to create a comment in CSS?
A) // comment
B) /* comment */
C) <!-- comment -->
D) # comment
40. What is the purpose of the z-index property in CSS?
A) To set the font size
B) To control the stacking order of elements
C) To define margins
D) To set the background color
Advanced Questions
41. What is the difference between let and const in JavaScript?
A) let is block-scoped, const is function-scoped
B) let can be reassigned, const cannot
C) let is used for constants, const is used for variables
D) There is no difference
42. Which of the following is a valid way to declare a function in JavaScript?
A) function myFunction() {}
B) myFunction() = function {}
C) function: myFunction() {}
D) myFunction: function() {}
43. What is the purpose of the return statement in a function?
A) To end the function
B) To pass a value back to the caller
C) To define a variable
D) To create a loop
44. Which of the following is a valid array method in JavaScript?
A) array.add()
B) array.push()
C) array.insert()
D) array.append()
45. What does the map() function do in JavaScript?
A) Iterates over an array and returns a new array
B) Filters an array
C) Reduces an array to a single value
D) Sorts an array
46. What is the purpose of the filter() method in JavaScript?
A) To create a new array with elements that pass a test
B) To sort an array
C) To combine two arrays
D) To find an element in an array
47. Which of the following is a valid way to create an object in JavaScript?
A) var obj = {};
B) var obj = [];
C) var obj = () => {};
D) var obj = "";
48. What is the output of typeof null in JavaScript?
A) "object"
B) "null"
C) "undefined"
D) "string"
49. What does the this keyword refer to in JavaScript?
A) The global object
B) The current function
C) The current object
D) The parent object
50. What is the purpose of the async keyword in JavaScript?
A) To define a synchronous function
B) To define an asynchronous function
C) To create a promise
D) To handle errors
HTML & CSS Advanced Questions
51. What is the purpose of the viewport meta tag in HTML?
A) To set the character encoding
B) To control the layout on mobile browsers
C) To define the title of the page
D) To add a favicon
52. Which CSS property is used to change the text color?
A) color
B) text-color
C) font-color
D) background-color
53. What does the display: none; property do in CSS?
A) Hides the element
B) Shows the element
C) Makes the element invisible but still takes up space
D) Changes the element's color
54. Which of the following is a CSS preprocessor?
A) CSS3
B) SASS
C) HTML5
D) JavaScript
55. What is the purpose of the flexbox layout in CSS?
A) To create a grid layout
B) To align and distribute space among items in a container
C) To style text
D) To create animations
56. What does the position: absolute; property do in CSS?
A) Positions the element relative to its parent
B) Positions the element relative to the viewport
C) Positions the element in the normal document flow
D) Positions the element at the top of the page
57. Which of the following is a valid CSS selector?
A) #id
B) .class
C) element
D) All of the above
58. What is the purpose of the @media rule in CSS?
A) To define styles for different media types
B) To create animations
C) To import stylesheets
D) To define variables
59. What does the opacity property do in CSS?
A) Changes the color of an element
B) Sets the transparency level of an element
C) Changes the size of an element
D) Sets the position of an element
60. Which of the following is NOT a valid CSS unit?
A) px
B) em
C) rem
D) pt
Web Development Concepts Questions
61. What is the purpose of a web server?
A) To host websites
B) To create web applications
C) To store databases
D) To manage user sessions
62. What does the acronym API stand for?
A) Application Programming Interface
B) Application Protocol Interface
C) Application Programming Integration
D) Application Protocol Integration
63. What is the purpose of AJAX in web development?
A) To create animations
B) To send and receive data asynchronously
C) To style web pages
D) To manage databases
64. Which of the following is a JavaScript framework?
A) React
B) Bootstrap
C) jQuery
D) All of the above
65. What is the purpose of the fetch() function in JavaScript?
A) To retrieve data from a server
B) To send data to a server
C) To create a new object
D) To manipulate the DOM
66. What does the DOMContentLoaded event signify?
A) The entire page has loaded
B) The HTML has been completely loaded and parsed
C) All images have been loaded
D) The page is being unloaded
67. What is the purpose of the localStorage object in JavaScript?
A) To store data temporarily
B) To store data permanently in the browser
C) To manage user sessions
D) To create cookies
68. Which of the following is a valid way to create a promise in JavaScript?
A) new Promise()
B) Promise.create()
C) Promise()
D) createPromise()
69. What is the purpose of the async/await syntax in JavaScript?
A) To handle synchronous code
B) To simplify working with promises
C) To create new functions
D) To manage user input
70. What does the console.log() function do?
A) Displays output in the browser
B) Logs output to the console
C) Creates an alert box
D) Writes to the document
Final Questions
71. What is the purpose of the return statement in a function?
A) To end the function
B) To pass a value back to the caller
C) To define a variable
D) To create a loop
72. Which of the following is a valid way to declare a variable in JavaScript?
A) var myVar;
B) let myVar;
C) const myVar;
D) All of the above
73. What is the output of typeof NaN in JavaScript?
A) "number"
B) "NaN"
C) "undefined"
D) "object"
74. What does the slice() method do in JavaScript?
A) Removes elements from an array
B) Returns a shallow copy of a portion of an array
C) Sorts an array
D) Joins two arrays
75. What is the purpose of the join() method in JavaScript?
A) To combine elements of an array into a string
B) To split a string into an array
C) To add elements to an array
D) To remove elements from an array
76. Which of the following is a valid way to create a class in JavaScript?
A) class MyClass {}
B) function MyClass() {}
C) MyClass = class {}
D) All of the above
77. What is the purpose of the super keyword in JavaScript?
A) To call a parent class constructor
B) To define a new class
C) To create a new object
D) To manage user input
78. What does the map() function return in JavaScript?
A) A new array with the results of calling a function on every element
B) The original array
C) A single value
D) An object
79. What is the purpose of the reduce() method in JavaScript?
A) To create a new array
B) To filter an array
C) To reduce an array to a single value
D) To sort an array
80. What does the filter() method return in JavaScript?
A) A new array with elements that pass a test
B) The original array
C) A single value
D) An object
81. What is the purpose of the splice() method in JavaScript?
A) To add or remove elements from an array
B) To sort an array
C) To create a new array
D) To join two arrays
82. Which of the following is a valid way to create a promise in JavaScript?
A) new Promise((resolve, reject) => {})
B) Promise.create()
C) Promise()
D) createPromise()
83. What does the setTimeout() function do in JavaScript?
A) Executes a function after a specified number of milliseconds
B) Repeats a function at specified intervals
C) Stops the execution of a function
D) Creates a new promise
84. What is the output of Math.random() in JavaScript?
A) A random integer
B) A random floating-point number between 0 and 1
C) A random number between 1 and 100
D) A random string
85. What does the JSON.stringify() method do?
A) Converts a JavaScript object into a JSON string
B) Parses a JSON string into a JavaScript object
C) Validates a JSON string
D) Formats a JSON string
86. Which of the following is a valid way to handle errors in JavaScript?
A) try...catch
B) if...else
C) throw
D) Both A and C
87. What is the purpose of the Promise.all() method?
A) To execute multiple promises in parallel
B) To wait for all promises to resolve
C) To handle errors in promises
D) Both A and B
88. What does the localStorage.setItem() method do?
A) Stores a key-value pair in local storage
B) Retrieves a value from local storage
C) Removes a key-value pair from local storage
D) Clears all data from local storage
89. What is the output of console.log(0 == '0')?
A) true
B) false
C) undefined
D) TypeError
90. What does the window.onload event signify?
A) The DOM is fully loaded
B) All resources (images, scripts, etc.) are fully loaded
C) The page is being unloaded
D) The user has clicked a button
91. What is the purpose of the fetch() API?
A) To create a new HTTP request
B) To send and receive data from a server
C) To handle promises
D) To manipulate the DOM
92. Which of the following is a valid way to define a function in JavaScript?
A) function myFunction() {}
B) const myFunction = () => {};
C) myFunction: function() {};
D) Both A and B
93. What does the Array.isArray() method do?
A) Checks if a variable is an array
B) Creates a new array
C) Converts an array to a string
D) Sorts an array
94. What is the purpose of the Object.keys() method?
A) Returns an array of a given object's own enumerable property names
B) Creates a new object
C) Merges two objects
D) Deletes a property from an object
95. What does the slice() method do in JavaScript?
A) Returns a shallow copy of a portion of an array
B) Removes elements from an array
C) Sorts an array
D) Joins two arrays
96. What is the output of typeof [] in JavaScript?
A) "array"
B) "object"
C) "undefined"
D) "list"
97. What does the Math.floor() function do?
A) Rounds a number down to the nearest integer
B) Rounds a number up to the nearest integer
C) Rounds a number to the nearest integer
D) Returns the absolute value of a number
98. What is the purpose of the Promise.resolve() method?
A) Creates a resolved promise
B) Creates a rejected promise
C) Converts a value to a promise
D) Both A and C
99. What does the addEventListener() method do?
A) Attaches an event handler to an element
B) Removes an event handler from an element
C) Triggers an event
D) Creates a new event
Here are the answers to the 100 multiple-choice questions provided:
### **React Chapter Answers**
1. B) Library
2. B) Google
3. B) Knowledge of HTML, CSS, JavaScript, and Git
4. B) User interface components
5. C) Slow development
6. B) A syntax extension for JavaScript
7. C) Microsoft
8. B) Install Node.js
9. B) To group elements together
10. B) Together in JavaScript
### **JavaScript Lecture Answers**
11. B) 1995
12. A) `<script src="file.js"></script>`
13. D) Local
14. B) Displays an alert box
15. B) Function scope
16. A) if
17. B) Declares a block-scoped variable
18. A) For loop
19. B) 4
20. A) `var myArray = []`
### **HTML & CSS Lecture Answers**
21. A) Groups related form controls
22. A) `<!-- comment -->`
23. B) To provide a caption for a `<fieldset>`
24. B) `<div>`
25. D) `<video src="video.mp4" controls></video>`
26. A) Embeds another webpage
27. B) `alt`
28. B) To provide a description of the image
29. B) `<a href="url">`
30. B) To display tabular data
### **General Web Development Answers**
31. B) To access and display web pages
32. A) HyperText Transfer Protocol
33. B) To translate domain names to IP addresses
34. D) All of the above
35. B) To style web pages
36. B) Metadata about the document
37. B) To contain the main content of the page
38. D) `<text>`
39. B) `/* comment */`
40. B) To control the stacking order of elements
### **Advanced Questions Answers**
41. B) To define an asynchronous function
42. A) `function myFunction() {}`
43. B) To pass a value back to the caller
44. B) `array.push()`
45. A) Iterates over an array and returns a new array
46. A) To create a new array with elements that pass a test
47. A) `var obj = {};`
48. A) "object"
49. C) The current object
50. B) To simplify working with promises
### **HTML & CSS Advanced Answers**
51. B) To control the layout on mobile browsers
52. A) `color`
53. A) Hides the element
54. B) SASS
55. B) To align and distribute space among items in a container
56. A) Positions the element relative to its parent
57. D) All of the above
58. A) To define styles for different media types
59. B) Sets the transparency level of an element
60. D) pt
### **Web Development Concepts Answers**
61. A) To host websites
62. A) Application Programming Interface
63. B) To send and receive data asynchronously
64. A) React
65. A) To retrieve data from a server
66. B) The HTML has been completely loaded and parsed
67. B) To store data permanently in the browser
68. A) `new Promise()`
69. B) The original array
70. A) Returns an array of a given object's own enumerable property names
### **Final Questions Answers**
71. B) To pass a value back to the caller
72. D) All of the above
73. A) "number"
74. A) Executes a function after a specified number of milliseconds
75. A) Combines elements of an array into a string
76. A) `class MyClass {}`
77. A) To call a parent class constructor
78. A) A new array with the results of calling a function on every element
79. C) To reduce an array to a single value
80. A) A new array with elements that pass a test
81. A) To add or remove elements from an array
82. A) `new Promise((resolve, reject) => {})`
83. A) Executes a function after a specified number of milliseconds
84. B) A random floating-point number between 0 and 1
85. A) Converts a JavaScript object into a JSON string
86. D) Both A and C
87. D) Both A and B
88. A) Stores a key-value pair in local storage
89. A) true
90. B) All resources (images, scripts, etc.) are fully loaded
91. B) To send and receive data from a server
92. D) Both A and B
93. A) Checks if a variable is an array
94. A) Returns an array of a given object's own enumerable property names
95. A) Returns a shallow copy of a portion of an array
96. B) "object"
97. A) Rounds a number down to the nearest integer
98. A) Creates a resolved promise
99. A) Attaches an event handler to an element
100. B) "11"
.