
























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Designed for experienced developers, this certification covers full-stack web development, including JavaScript frameworks, server-side scripting (e.g., PHP, Node.js), databases (SQL/NoSQL), APIs, and secure coding practices.
Typology: Exams
1 / 96
This page cannot be seen from the preview
Don't miss anything!

























































































Question 1. Which protocol is primarily responsible for encrypting data transmitted between a web browser and a server? A) HTTP B) FTP C) HTTPS D) TCP Answer: C Explanation: HTTPS (HTTP Secure) uses TLS/SSL to encrypt HTTP traffic, protecting data from eavesdropping and tampering. Question 2. In a client-server architecture, which component typically initiates a request for a web page? A) Server B) Router C) Client D) DNS server Answer: C Explanation: The client (usually a web browser) sends an HTTP request to the server, which then responds with the requested resources. Question 3. What does the HTML5 `` declaration do? A) Links to an external stylesheet B) Specifies the character set of the document C) Triggers standards-mode rendering in browsers D) Defines a JavaScript module Answer: C
Explanation: The simple declaration tells browsers to render the page in standards mode, ensuring consistent behavior across browsers. **Question 4. Which meta tag correctly sets the character encoding to UTF-8?** A) B) C) D) Answer: B Explanation: The HTML5 syntax is the recommended way to declare UTF-8 encoding. Question 5. Which HTML5 element is most appropriate for containing navigation links? A) B) C) D) Answer: B Explanation: The `` element semantically represents a block of navigation links, improving accessibility and SEO. Question 6. When should you use the <strong> tag instead of <b>? A) When you want bold visual style only
Explanation: type="email" triggers HTML5 validation that the entered value matches the general pattern of an email address. Question 9. What is the primary difference between the GET and POST methods in HTML forms? A) GET encrypts data, POST does not B) GET appends data to the URL, POST sends data in the request body C) GET can only send text, POST can send files D) GET is used for login forms, POST for search forms Answer: B Explanation: GET appends form data to the URL query string, making it visible and limited in length; POST includes data in the request body, allowing larger and more secure submissions. Question 10. Which CSS selector targets every <p> element that is a direct child of a </p>? A) div p B) div > p C) div + p D) p > div Answer: B Explanation: The child combinator (>) selects elements that are immediate children of the specified parent. Question 11. In the CSS cascade, which rule has the highest specificity? A) p {} B) .highlight {}
C) #main {} D) article .intro {} Answer: C Explanation: ID selectors (#main) have higher specificity than class or element selectors. Question 12. What does the CSS property box-sizing: border-box; change? A) It adds a border around the element automatically B) It includes padding and border in the element’s total width and height calculations C) It forces the element to be displayed as a block D) It hides overflow content Answer: B Explanation: border-box makes the width/height of an element include its padding and border, simplifying layout calculations. Question 13. Which of the following values makes an element invisible but still takes up space in the layout? A) display: none; B) visibility: hidden; C) opacity: 0; D) position: absolute; Answer: B Explanation: visibility: hidden hides the element visually while preserving its allocated layout space; display:none removes it from the flow.
D) grid-auto-flow Answer: B Explanation: grid-template-columns specifies the track sizes for columns, establishing the column count. Question 17. Which media query targets devices with a viewport width of 768 px or less? A) @media (max-width: 768px) {} B) @media (min-width: 768px) {} C) @media (width: 768px) {} D) @media (device-width: 768px) {} Answer: A Explanation: max-width sets an upper limit; the rule applies when the viewport is 768 px wide or narrower. Question 18. Which JavaScript keyword creates a block-scoped variable that cannot be reassigned? A) var B) let C) const D) static Answer: C Explanation: const declares a constant reference; the variable cannot be reassigned after its initial definition, and it is block-scoped. Question 19. What will typeof NaN return in JavaScript?
A) "number" B) "NaN" C) "undefined" D) "object" Answer: A Explanation: In JavaScript, NaN (Not-a-Number) is still of type number. Question 20. Which array method creates a new array containing only the elements that pass a test function? A) map() B) filter() C) reduce() D) forEach() Answer: B Explanation: filter() iterates over an array and returns a new array with elements for which the callback returns true. Question 21. Which loop is guaranteed to execute its body at least once? A) for B) while C) do...while D) forEach Answer: C Explanation: do...while evaluates its condition after executing the loop body, ensuring at least one iteration.
D) getElementById() Answer: C Explanation: querySelector() returns the first matching element; querySelectorAll() returns a NodeList of all matches. Question 25. In JavaScript, what does event.preventDefault() do inside an event handler? A) Stops the event from bubbling up the DOM tree B) Cancels the default action associated with the event (e.g., following a link) C) Removes the event listener after execution D) Logs the event object to the console Answer: B Explanation: preventDefault() stops the browser’s default behavior for that event, such as submitting a form or navigating to a link. Question 26. Which HTML attribute is used to provide alternative text for an image? A) title B) alt C) src D) placeholder Answer: B Explanation: The alt attribute supplies descriptive text for images, improving accessibility and SEO. Question 27. Which image format supports lossless compression and transparency without a separate alpha channel file?
D) WebP Answer: C Explanation: PNG offers lossless compression and an integrated alpha channel for full transparency. **Question 28. What is the purpose of the srcset attribute on a element?** A) To define fallback text when the image cannot load B) To specify multiple image sources for different display densities or viewport sizes C) To set the image’s CSS class D) To embed video content inside an image tag Answer: B Explanation: `srcset` (and) lets the browser choose the most appropriate image source based on device resolution and layout constraints. **Question 29. Which of the following is a valid CSS color expressed in HSL? ** A) hsl(120, 100%, 50%) B) rgb(120, 255, 0) C) #78ff00 D) cmyk(0,100,100,0) Answer: A
B) C) D) Answer: B Explanation: represents an independent, reusable piece of content such as a blog post, news story, or forum entry. Question 33. In a Git-based workflow, which command records changes to the local repository? A) git push B) git commit C) git merge D) git clone Answer: B Explanation: git commit creates a new commit object containing the staged changes, storing them in the local repository. Question 34. Which HTTP status code indicates that the requested resource has been permanently moved to a new URL? A) 301 B) 302 C) 404 D) 500 Answer: A Explanation: 301 (Moved Permanently) tells clients and search engines that the resource’s new location is permanent.
Question 35. Which attribute on a `` element specifies where the form data should be sent? A) method B) action C) enctype D) target Answer: B Explanation: The action attribute contains the URL that will receive the form submission. Question 36. Which JavaScript method can be used to convert an array-like object (e.g., NodeList) into a true array? A) Array.from() B) Object.values() C) Array.slice() D) NodeList.toArray() Answer: A Explanation: Array.from() creates a new array instance from an iterable or array-like object. Question 37. Which CSS property allows you to create a smooth transition when a property changes? A animation B transition C transform
A) Makes the element invisible B) Prevents scrolling and clips any content that exceeds the element’s box C) Allows content to overflow outside the element D) Adds a scrollbar automatically Answer: B Explanation: overflow: hidden hides any part of the content that exceeds the element’s dimensions, cutting it off without scrollbars. Question 41. Which HTML element should be used to embed a video file that can be played natively in browsers? A) B) C) D) Answer: C Explanation: The `` element provides native playback controls and supports multiple source formats. Question 42. In CSS Grid, what does the value auto-fill do when used with repeat()? A) Creates a fixed number of tracks B) Fills the container with as many tracks as will fit, even if they are empty C) Automatically adjusts the size of each track to fill remaining space D) Stops the grid from rendering altogether Answer: B
Explanation: repeat(auto-fill, minmax(200px, 1fr)) repeats the track definition as many times as possible within the container, creating empty tracks if needed. Question 43. Which JavaScript feature allows you to write asynchronous code that looks synchronous? A) Callbacks B) Promises C) Async/Await D) setTimeout Answer: C Explanation: async functions combined with await pause execution until a promise resolves, making asynchronous code appear linear. **Question 44. Which HTTP header controls caching behavior for a response? ** A) Authorization B) Cache-Control C) Content-Type D) User-Agent Answer: B Explanation: Cache-Control directives (e.g., max-age, no-store) tell browsers and intermediaries how to cache the response. Question 45. Which of the following is a correct way to declare a JavaScript object literal with properties name and age? A) let person = new Object(); person.name = "John"; person.age = 30;
Explanation: Progressive enhancement ensures core functionality works everywhere, while richer experiences are layered on for capable browsers. Question 48. Which HTML attribute can be used to make a `` element apply only when the device’s viewport is 600 px wide or less? A) media="(max-width: 600px)" B) type="media" C) rel="media" D) href="(max-width:600px)" Answer: A Explanation: The media attribute contains a media query that determines when the linked stylesheet is applied. Question 49. In JavaScript, which method removes the last element from an array and returns it? A) pop() B) shift() C) splice() D) slice() Answer: A Explanation: pop() mutates the original array by removing its last element and returns that element. Question 50. Which of the following is a valid way to create a CSS custom property (variable) for a primary color? A) --primary-color: #0066ff; B) $primary-color: #0066ff;
C) @primary-color: #0066ff; D) color-primary: #0066ff; Answer: A Explanation: CSS custom properties start with -- and are defined within a selector (commonly :root). Question 51. Which HTML element is used to define a set of navigation links that are related to the main content of a page? A) B) C) D) Answer: A Explanation: `` semantically groups primary navigation links, aiding accessibility and SEO. Question 52. Which of the following HTTP methods is considered “safe” because it does not modify server state? A) POST B) PUT C) DELETE D) GET Answer: D Explanation: GET requests retrieve data without causing side effects, making them safe and idempotent.