HTML MCQs
1. Which HTML element is used to specify a caption for a <table>? (advanced)
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
2. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
3. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
4. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
5. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
6. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
7. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
8. Which attribute makes a form element required before submission? (advanced)
A. validate
B. required
C. mandatory
D. pattern
Answer: B
9. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
10. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
11. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
12. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
13. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
14. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
15. Which input type allows the user to select a color in HTML5? (advanced)
A. text
B. color
C. picker
D. palette
Answer: B
16. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
17. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
18. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
19. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
20. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
21. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
22. What does the 'alt' attribute in <img> provide? (advanced)
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
23. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
24. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
25. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
26. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
27. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
28. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
29. Which HTML5 element is intended to contain navigation links? (advanced)
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
30. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
31. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
32. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
33. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
34. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
35. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
36. Which tag is used to include a JavaScript file in HTML? (advanced)
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
37. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
38. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
39. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
40. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
41. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
42. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
43. Which attribute is used to provide a unique identifier to an HTML element? (advanced)
A. class
B. id
C. key
D. data-id
Answer: B
44. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
45. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
46. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
47. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
48. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
49. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
50. Which semantic element represents self-contained content, e.g., a blog post? (advanced)
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
51. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
52. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
53. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
54. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
55. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
56. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
57. What is the purpose of the <meta name='viewport'> tag? (advanced)
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
58. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
59. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
60. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
61. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
62. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
63. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
64. Which HTML element is used for the largest heading? (advanced)
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
65. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
66. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
67. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
68. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
69. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
70. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
71. Which HTML element is used to specify a caption for a <table>? (advanced)
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
72. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
73. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
74. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
75. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
76. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
77. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
78. Which attribute makes a form element required before submission? (advanced)
A. validate
B. required
C. mandatory
D. pattern
Answer: B
79. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
80. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
81. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
82. What does the 'alt' attribute in <img> provide?
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
83. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
84. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
85. Which input type allows the user to select a color in HTML5? (advanced)
A. text
B. color
C. picker
D. palette
Answer: B
86. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
87. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
88. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
89. Which HTML5 element is intended to contain navigation links?
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
90. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
91. Which HTML element is used to specify a caption for a <table>?
A. <caption>
B. <label>
C. <thead>
D. <figcaption>
Answer: A
92. What does the 'alt' attribute in <img> provide? (advanced)
A. Alternate text for the image
B. Image alignment
C. Image URL
D. Tooltip text
Answer: A
93. Which attribute is used to provide a unique identifier to an HTML element?
A. class
B. id
C. key
D. data-id
Answer: B
94. Which HTML element is used for the largest heading?
A. <h1>
B. <header>
C. <head>
D. <title>
Answer: A
95. Which input type allows the user to select a color in HTML5?
A. text
B. color
C. picker
D. palette
Answer: B
96. Which tag is used to include a JavaScript file in HTML?
A. <script src='[Link]'>
B. <js src='[Link]'>
C. <link href='[Link]'>
D. <import src='[Link]'>
Answer: A
97. What is the purpose of the <meta name='viewport'> tag?
A. Set page character encoding
B. Control layout on mobile browsers
C. Add metadata for SEO
D. Include external CSS
Answer: B
98. Which attribute makes a form element required before submission?
A. validate
B. required
C. mandatory
D. pattern
Answer: B
99. Which HTML5 element is intended to contain navigation links? (advanced)
A. <nav>
B. <menu>
C. <section>
D. <aside>
Answer: A
100. Which semantic element represents self-contained content, e.g., a blog post?
A. <section>
B. <article>
C. <aside>
D. <div>
Answer: B
CSS MCQs
1. Which property controls the spacing between lines of text? (advanced)
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
2. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
3. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
4. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
5. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
6. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
7. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
8. What property would you use to hide overflow content and create scrollbars when needed?
(advanced)
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
9. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
10. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
11. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
12. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
13. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
14. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
15. Which CSS property is used to create flexible layouts? (advanced)
A. grid
B. float
C. flex
D. position
Answer: C
16. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
17. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
18. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
19. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
20. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
21. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
22. What does the 'z-index' property control? (advanced)
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
23. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
24. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
25. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
26. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
27. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
28. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
29. Which pseudo-class applies when an element receives focus? (advanced)
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
30. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
31. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
32. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
33. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
34. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
35. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
36. How do you center a block element horizontally using margin? (advanced)
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
37. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
38. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
39. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
40. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
41. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
42. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
43. Which display value makes an element a block-level element? (advanced)
A. inline
B. block
C. inline-block
D. flex
Answer: B
44. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
45. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
46. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
47. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
48. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
49. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
50. Which CSS function is used for transformations like rotate and scale? (advanced)
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
51. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
52. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
53. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
54. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
55. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
56. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
57. Which unit is relative to the root element font-size? (advanced)
A. em
B. rem
C. px
D. %
Answer: B
58. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
59. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
60. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
61. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
62. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
63. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
64. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
(advanced)
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
65. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
66. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
67. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
68. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
69. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
70. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
71. Which property controls the spacing between lines of text? (advanced)
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
72. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
73. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
74. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
75. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
76. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
77. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
78. What property would you use to hide overflow content and create scrollbars when needed?
(advanced)
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
79. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
80. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
81. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
82. What does the 'z-index' property control?
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
83. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
84. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
85. Which CSS property is used to create flexible layouts? (advanced)
A. grid
B. float
C. flex
D. position
Answer: C
86. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
87. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
88. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
89. Which pseudo-class applies when an element receives focus?
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
90. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
91. Which property controls the spacing between lines of text?
A. letter-spacing
B. word-spacing
C. line-height
D. text-spacing
Answer: C
92. What does the 'z-index' property control? (advanced)
A. Opacity of an element
B. Stacking order of positioned elements
C. Font size scaling
D. Animation speed
Answer: B
93. Which display value makes an element a block-level element?
A. inline
B. block
C. inline-block
D. flex
Answer: B
94. Which CSS selector targets elements with class 'btn' inside an element with id 'nav'?
A. #[Link]
B. #nav .btn
C. .btn #nav
D. nav .btn
Answer: B
95. Which CSS property is used to create flexible layouts?
A. grid
B. float
C. flex
D. position
Answer: C
96. How do you center a block element horizontally using margin?
A. margin: 0 auto;
B. margin: auto 0;
C. margin: center;
D. margin: 0 0 auto;
Answer: A
97. Which unit is relative to the root element font-size?
A. em
B. rem
C. px
D. %
Answer: B
98. What property would you use to hide overflow content and create scrollbars when needed?
A. overflow: hidden;
B. overflow: auto;
C. overflow: visible;
D. overflow: scroll;
Answer: B
99. Which pseudo-class applies when an element receives focus? (advanced)
A. :hover
B. :active
C. :focus
D. :visited
Answer: C
100. Which CSS function is used for transformations like rotate and scale?
A. transform()
B. translate()
C. matrix()
D. rotate()
Answer: A
JavaScript MCQs
1. Which statement correctly declares a block-scoped constant in ES6? (advanced)
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
2. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
3. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
4. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
5. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
6. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
7. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
8. In promises, which method is used to handle errors? (advanced)
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
9. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
10. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
11. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
12. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
13. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
14. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
15. Which keyword is used to handle exceptions in JavaScript? (advanced)
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
16. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
17. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
18. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
19. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
20. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
21. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
22. What is the result of typeof NaN in JavaScript? (advanced)
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
23. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
24. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
25. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
26. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
27. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
28. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
29. Which feature allows destructuring assignment for arrays and objects? (advanced)
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
30. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
31. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
32. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
33. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
34. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
35. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
36. What does '===' operator check for? (advanced)
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
37. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
38. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
39. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
40. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
41. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
42. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
43. Which method converts a JSON string into a JavaScript object? (advanced)
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
44. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
45. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
46. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
47. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
48. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
49. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
50. Which symbol is used to denote private class fields in modern JavaScript? (advanced)
A. _
B. #
C. $
D. *
Answer: B
51. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
52. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
53. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
54. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
55. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
56. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
57. Which function is used to schedule a function to run after delay? (advanced)
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
58. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
59. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
60. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
61. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
62. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
63. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
64. Which method adds one or more elements to the end of an array? (advanced)
A. unshift()
B. push()
C. append()
D. add()
Answer: B
65. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
66. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
67. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
68. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
69. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
70. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
71. Which statement correctly declares a block-scoped constant in ES6? (advanced)
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
72. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
73. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
74. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
75. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
76. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
77. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
78. In promises, which method is used to handle errors? (advanced)
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
79. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
80. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
81. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
82. What is the result of typeof NaN in JavaScript?
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
83. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
84. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
85. Which keyword is used to handle exceptions in JavaScript? (advanced)
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
86. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
87. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
88. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
89. Which feature allows destructuring assignment for arrays and objects?
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
90. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
91. Which statement correctly declares a block-scoped constant in ES6?
A. var x = 10;
B. let x = 10;
C. const x = 10;
D. constant x = 10;
Answer: C
92. What is the result of typeof NaN in JavaScript? (advanced)
A. 'number'
B. 'NaN'
C. 'undefined'
D. 'object'
Answer: A
93. Which method converts a JSON string into a JavaScript object?
A. [Link]()
B. [Link]()
C. parseJSON()
D. [Link]()
Answer: A
94. Which method adds one or more elements to the end of an array?
A. unshift()
B. push()
C. append()
D. add()
Answer: B
95. Which keyword is used to handle exceptions in JavaScript?
A. try/catch
B. throw/catch
C. error/handle
D. catch/throw
Answer: A
96. What does '===' operator check for?
A. value equality with type coercion
B. value equality without type coercion
C. assignment
D. reference equality only
Answer: B
97. Which function is used to schedule a function to run after delay?
A. setInterval()
B. setTimeout()
C. requestAnimationFrame()
D. schedule()
Answer: B
98. In promises, which method is used to handle errors?
A. .then()
B. .catch()
C. .finally()
D. .error()
Answer: B
99. Which feature allows destructuring assignment for arrays and objects? (advanced)
A. spread operator
B. destructuring
C. rest parameters
D. templating
Answer: B
100. Which symbol is used to denote private class fields in modern JavaScript?
A. _
B. #
C. $
D. *
Answer: B
React MCQs
1. What is the primary purpose of keys in React lists? (advanced)
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
2. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
3. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
4. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
5. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
6. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
7. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
8. What is the purpose of useEffect cleanup function? (advanced)
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
9. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
10. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
11. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
12. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
13. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
14. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
15. Which lifecycle method is called after a class component is inserted into the DOM?
(advanced)
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
16. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
17. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
18. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
19. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
20. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
21. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
22. Which hook is used for managing local component state? (advanced)
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
23. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
24. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
25. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
26. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
27. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
28. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
29. Which hook would you use for complex state logic with multiple sub-values? (advanced)
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
30. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
31. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
32. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
33. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
34. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
35. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
36. Which context API hook returns the current context value? (advanced)
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
37. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
38. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
39. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
40. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
41. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
42. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
43. What does JSX compile to under the hood? (advanced)
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
44. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
45. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
46. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
47. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
48. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
49. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
50. How do you create a ref to access a DOM element in a functional component? (advanced)
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
51. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
52. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
53. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
54. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
55. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
56. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
57. Which of these enables server-side rendering with React? (advanced)
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
58. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
59. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
60. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
61. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
62. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
63. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
64. How can you prevent a component from re-rendering when props haven't changed? (advanced)
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
65. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
66. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
67. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
68. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
69. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
70. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
71. What is the primary purpose of keys in React lists? (advanced)
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
72. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
73. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
74. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
75. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
76. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
77. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
78. What is the purpose of useEffect cleanup function? (advanced)
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
79. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
80. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
81. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
82. Which hook is used for managing local component state?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
83. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
84. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
85. Which lifecycle method is called after a class component is inserted into the DOM?
(advanced)
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
86. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
87. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
88. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
89. Which hook would you use for complex state logic with multiple sub-values?
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
90. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
91. What is the primary purpose of keys in React lists?
A. Style the list items
B. Identify items for reconciliation
C. Assign unique ids in DB
D. Enable drag-and-drop
Answer: B
92. Which hook is used for managing local component state? (advanced)
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B
93. What does JSX compile to under the hood?
A. HTML strings
B. [Link] calls
C. Template literals
D. DOM nodes directly
Answer: B
94. How can you prevent a component from re-rendering when props haven't changed?
A. Use shouldComponentUpdate or [Link]
B. Always use state
C. Use useEffect
D. Wrap in setTimeout
Answer: A
95. Which lifecycle method is called after a class component is inserted into the DOM?
A. componentWillMount
B. componentDidMount
C. componentWillUpdate
D. componentDidUpdate
Answer: B
96. Which context API hook returns the current context value?
A. useContext()
B. useValue()
C. getContext()
D. useProvide()
Answer: A
97. Which of these enables server-side rendering with React?
A. create-react-app
B. [Link]
C. CRA server
D. [Link] only
Answer: B
98. What is the purpose of useEffect cleanup function?
A. Render UI
B. Clean side effects on unmount/update
C. Memoize values
D. Fetch data
Answer: B
99. Which hook would you use for complex state logic with multiple sub-values? (advanced)
A. useState
B. useReducer
C. useMemo
D. useCallback
Answer: B
100. How do you create a ref to access a DOM element in a functional component?
A. [Link]()
B. useRef()
C. getRef()
D. createRefHook()
Answer: B
[Link] MCQs
1. Which global object provides information about the current [Link] process? (advanced)
A. process
B. global
C. env
D. os
Answer: A
2. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
3. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
4. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
5. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
6. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
7. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
8. Which stream type in [Link] is used for reading data? (advanced)
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
9. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
10. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
11. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
12. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
13. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
14. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
15. Which [Link] feature allows non-blocking I/O? (advanced)
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
16. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
17. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
18. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
19. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
20. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
21. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
22. Which module is used to work with the file system in [Link]? (advanced)
A. fs
B. file
C. system
D. io
Answer: A
23. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
24. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
25. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
26. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
27. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
28. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
29. Which method is used to import modules in CommonJS? (advanced)
A. import
B. require
C. include
D. load
Answer: B
30. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
31. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
32. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
33. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
34. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
35. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
36. Which built-in module helps with path manipulations? (advanced)
A. os
B. path
C. url
D. fs
Answer: B
37. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
38. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
39. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
40. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
41. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
42. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
43. Which method starts an HTTP server in [Link]? (advanced)
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
44. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
45. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
46. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
47. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
48. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
49. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
50. Which API provides worker threads in [Link] for parallelism? (advanced)
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
51. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
52. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
53. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
54. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
55. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
56. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
57. Which command initializes a new Node project and creates [Link]? (advanced)
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
58. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
59. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
60. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
61. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
62. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
63. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
64. Which package manager ships with [Link] by default (since Node 5.0+)? (advanced)
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
65. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
66. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
67. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
68. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
69. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
70. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
71. Which global object provides information about the current [Link] process? (advanced)
A. process
B. global
C. env
D. os
Answer: A
72. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
73. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
74. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
75. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
76. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
77. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
78. Which stream type in [Link] is used for reading data? (advanced)
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
79. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
80. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
81. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
82. Which module is used to work with the file system in [Link]?
A. fs
B. file
C. system
D. io
Answer: A
83. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
84. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
85. Which [Link] feature allows non-blocking I/O? (advanced)
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
86. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
87. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
88. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
89. Which method is used to import modules in CommonJS?
A. import
B. require
C. include
D. load
Answer: B
90. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
91. Which global object provides information about the current [Link] process?
A. process
B. global
C. env
D. os
Answer: A
92. Which module is used to work with the file system in [Link]? (advanced)
A. fs
B. file
C. system
D. io
Answer: A
93. Which method starts an HTTP server in [Link]?
A. [Link]()
B. [Link]().listen()
C. [Link]()
D. [Link]()
Answer: B
94. Which package manager ships with [Link] by default (since Node 5.0+)?
A. yarn
B. npm
C. pnpm
D. bower
Answer: B
95. Which [Link] feature allows non-blocking I/O?
A. Multi-threading
B. Asynchronous callbacks and event loop
C. Synchronous blocking calls
D. Forking processes
Answer: B
96. Which built-in module helps with path manipulations?
A. os
B. path
C. url
D. fs
Answer: B
97. Which command initializes a new Node project and creates [Link]?
A. npm init
B. npm start
C. node init
D. npm create
Answer: A
98. Which stream type in [Link] is used for reading data?
A. Writable
B. Readable
C. Duplex
D. Transform
Answer: B
99. Which method is used to import modules in CommonJS? (advanced)
A. import
B. require
C. include
D. load
Answer: B
100. Which API provides worker threads in [Link] for parallelism?
A. cluster
B. child_process
C. worker_threads
D. threads
Answer: C
[Link] MCQs
1. Which function creates an Express application? (advanced)
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
2. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
3. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
4. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
5. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
6. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
7. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
8. Which property contains query string parameters in Express request? (advanced)
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
9. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
10. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
11. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
12. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
13. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
14. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
15. Which middleware is commonly used to parse JSON request bodies? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
16. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
17. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
18. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
19. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
20. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
21. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
22. How do you define a middleware for all routes in Express? (advanced)
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
23. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
24. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
25. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
26. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
27. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
28. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
29. Which function ends the response without any data? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
30. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
31. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
32. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
33. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
34. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
35. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
36. How do you handle 404 not found in Express? (advanced)
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
37. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
38. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
39. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
40. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
41. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
42. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
43. Which method is used to send JSON response in Express? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
44. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
45. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
46. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
47. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
48. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
49. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
50. Which status code indicates resource created successfully? (advanced)
A. 200
B. 201
C. 400
D. 404
Answer: B
51. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
52. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
53. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
54. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
55. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
56. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
57. Which method mounts a router on a path? (advanced)
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
58. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
59. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
60. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
61. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
62. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
63. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
64. How do you define a route parameter named 'id'? (advanced)
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
65. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
66. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
67. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
68. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
69. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
70. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
71. Which function creates an Express application? (advanced)
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
72. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
73. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
74. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
75. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
76. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
77. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
78. Which property contains query string parameters in Express request? (advanced)
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
79. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
80. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
81. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
82. How do you define a middleware for all routes in Express?
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
83. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
84. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
85. Which middleware is commonly used to parse JSON request bodies? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
86. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
87. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
88. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
89. Which function ends the response without any data?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
90. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
91. Which function creates an Express application?
A. [Link]()
B. express()
C. new Express()
D. createExpress()
Answer: B
92. How do you define a middleware for all routes in Express? (advanced)
A. [Link]('/', middleware)
B. [Link](middleware)
C. [Link](middleware)
D. [Link](middleware)
Answer: B
93. Which method is used to send JSON response in Express?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
94. How do you define a route parameter named 'id'?
A. '/user/:id'
B. '/user/{id}'
C. '/user/?id'
D. '/user/*id'
Answer: A
95. Which middleware is commonly used to parse JSON request bodies?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
96. How do you handle 404 not found in Express?
A. [Link]((req,res)=>[Link](404).send())
B. [Link](404,...)
C. [Link](404,...)
D. [Link]()
Answer: A
97. Which method mounts a router on a path?
A. [Link]()
B. [Link]()
C. [Link]('/path', router)
D. [Link]('/path', router)
Answer: C
98. Which property contains query string parameters in Express request?
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Answer: C
99. Which function ends the response without any data? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A
100. Which status code indicates resource created successfully?
A. 200
B. 201
C. 400
D. 404
Answer: B
MongoDB MCQs
1. Which command inserts a document into a collection in MongoDB shell? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
2. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
3. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
4. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
5. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
6. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
7. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
8. Which command removes all documents from a collection but keeps indexes? (advanced)
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
9. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
10. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
11. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
12. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
13. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
14. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
15. Which command creates an index on a collection field? (advanced)
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
16. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
17. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
18. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
19. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
20. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
21. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
22. Which of these is a BSON data type used in MongoDB for unique identifiers? (advanced)
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
23. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
24. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
25. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
26. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
27. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
28. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
29. Which storage engine is the default for modern MongoDB versions? (advanced)
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
30. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
31. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
32. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
33. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
34. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
35. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
36. Which write concern acknowledges written data on the primary before returning? (advanced)
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
37. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
38. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
39. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
40. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
41. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
42. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
43. Which operator is used for matching documents where a field equals a value? (advanced)
A. $eq
B. $match
C. $where
D. $in
Answer: A
44. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
45. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
46. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
47. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
48. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
49. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
50. Which method updates a single document matching a filter? (advanced)
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
51. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
52. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
53. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
54. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
55. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
56. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
57. Which operator projects specified fields to include or exclude? (advanced)
A. $project
B. $select
C. $fields
D. $include
Answer: A
58. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
59. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
60. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
61. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
62. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
63. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
64. Which aggregation stage groups documents by a specified expression? (advanced)
A. $project
B. $group
C. $match
D. $sort
Answer: B
65. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
66. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
67. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
68. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
69. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
70. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
71. Which command inserts a document into a collection in MongoDB shell? (advanced)
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
72. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
73. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
74. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
75. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
76. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
77. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
78. Which command removes all documents from a collection but keeps indexes? (advanced)
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
79. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
80. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
81. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
82. Which of these is a BSON data type used in MongoDB for unique identifiers?
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
83. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
84. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
85. Which command creates an index on a collection field? (advanced)
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
86. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
87. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
88. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
89. Which storage engine is the default for modern MongoDB versions?
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
90. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
91. Which command inserts a document into a collection in MongoDB shell?
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B
92. Which of these is a BSON data type used in MongoDB for unique identifiers? (advanced)
A. UUID
B. ObjectId
C. GUID
D. BSONId
Answer: B
93. Which operator is used for matching documents where a field equals a value?
A. $eq
B. $match
C. $where
D. $in
Answer: A
94. Which aggregation stage groups documents by a specified expression?
A. $project
B. $group
C. $match
D. $sort
Answer: B
95. Which command creates an index on a collection field?
A. [Link]({field:1})
B. [Link](field)
C. [Link](field)
D. [Link](field)
Answer: A
96. Which write concern acknowledges written data on the primary before returning?
A. w:0
B. w:1
C. w:majority
D. w:all
Answer: B
97. Which operator projects specified fields to include or exclude?
A. $project
B. $select
C. $fields
D. $include
Answer: A
98. Which command removes all documents from a collection but keeps indexes?
A. [Link]()
B. [Link]({})
C. [Link]()
D. [Link]()
Answer: B
99. Which storage engine is the default for modern MongoDB versions? (advanced)
A. MMAPv1
B. WiredTiger
C. InMemory
D. RocksDB
Answer: B
100. Which method updates a single document matching a filter?
A. update()
B. updateOne()
C. replaceOne()
D. save()
Answer: B
SQL MCQs
1. Which SQL clause is used to filter groups created by GROUP BY? (advanced)
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
2. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
3. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
4. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
5. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
6. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
7. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
8. Which constraint ensures values in a column are unique across rows? (advanced)
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
9. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
10. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
11. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
12. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
13. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
14. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
15. Which clause is used to sort the result set? (advanced)
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
16. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
17. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
18. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
19. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
20. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
21. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
22. Which command removes a table and its data from the database? (advanced)
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
23. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
24. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
25. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
26. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
27. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
28. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
29. Which clause is used to combine rows from two or more SELECT statements? (advanced)
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
30. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
31. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
32. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
33. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
34. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
35. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
36. Which SQL keyword removes duplicates from the result set? (advanced)
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
37. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
38. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
39. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
40. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
41. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
42. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
43. Which JOIN returns only matching rows from both tables? (advanced)
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
44. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
45. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
46. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
47. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
48. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
49. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
50. Which index type is typically used for full-text search in many databases? (advanced)
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
51. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
52. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
53. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
54. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
55. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
56. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
57. Which command reverts uncommitted transactions to the last commit? (advanced)
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
58. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
59. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
60. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
61. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
62. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
63. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
64. Which function returns the number of rows in a result set? (advanced)
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
65. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
66. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
67. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
68. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
69. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
70. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
71. Which SQL clause is used to filter groups created by GROUP BY? (advanced)
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
72. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
73. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
74. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
75. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
76. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
77. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
78. Which constraint ensures values in a column are unique across rows? (advanced)
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
79. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
80. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
81. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
82. Which command removes a table and its data from the database?
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
83. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
84. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
85. Which clause is used to sort the result set? (advanced)
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
86. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
87. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
88. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
89. Which clause is used to combine rows from two or more SELECT statements?
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
90. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C
91. Which SQL clause is used to filter groups created by GROUP BY?
A. WHERE
B. HAVING
C. FILTER
D. GROUP
Answer: B
92. Which command removes a table and its data from the database? (advanced)
A. DELETE TABLE table_name;
B. DROP TABLE table_name;
C. REMOVE TABLE table_name;
D. TRUNCATE TABLE table_name;
Answer: B
93. Which JOIN returns only matching rows from both tables?
A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL JOIN
Answer: C
94. Which function returns the number of rows in a result set?
A. COUNT()
B. SUM()
C. ROWS()
D. TOTAL()
Answer: A
95. Which clause is used to sort the result set?
A. ORDER BY
B. SORT BY
C. GROUP BY
D. HAVING
Answer: A
96. Which SQL keyword removes duplicates from the result set?
A. UNIQUE
B. DISTINCT
C. FILTER
D. ONLY
Answer: B
97. Which command reverts uncommitted transactions to the last commit?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. REVERT
Answer: A
98. Which constraint ensures values in a column are unique across rows?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
Answer: B
99. Which clause is used to combine rows from two or more SELECT statements? (advanced)
A. JOIN
B. UNION
C. MERGE
D. COMBINE
Answer: B
100. Which index type is typically used for full-text search in many databases?
A. B-tree
B. Hash
C. GIN/GSER (varies)
D. Bitmap
Answer: C