CR_MS_Assessment1 CR_MS_Assessment1 CR_MS_Assessment1 The number of attempts remaining is 4 1 / 30 1. Which Flexbox property controls whether items move to the next row when space is insufficient? a. flex-wrap b. align-items c. flex-direction d. justify-content 2 / 30 2. A developer updates the DOM inside a loop thousands of times, causing performance issues in the browser. Which approach would improve performance? a. Update each iteration b. Use inline styles c. Increase delay d. Use Document Fragment 3 / 30 3. In the CSS Box Model, which property adds space inside the border? a. spacing b. outline c. padding d. margin 4 / 30 4. What will be the output? let x = 5; let y = "5"; console.log(x == y); console.log(x === y); a. true false b. false true c. false false d. true true 5 / 30 5. What will be the output? setTimeout(() => { console.log("A"); }, 0); console.log("B"); a. B A b. B only c. A only d. A B 6 / 30 6. Which media query is best suited for targeting mobile devices? a. Tablets only b. Large displays only c. Mobile and smaller screens d. Desktop screens only 7 / 30 7. A card component should smoothly enlarge slightly when hovered by the user. Which CSS property combination is most appropriate? a. transition + transform b. overflow + padding c. float + margin d. display + position 8 / 30 8. Which CSS unit is generally preferred for scalable and accessible typography? a. cm b. vh c. px d. rem 9 / 30 9. Which position value keeps an element fixed relative to the browser viewport even during scrolling? a. fixed b. sticky c. absolute d. relative 10 / 30 10. Which method is used to add an event listener in modern JavaScript? a. addListener() b. addEventListener() c. eventListener() d. attachEvent() 11 / 30 11. a. Improve SEO ranking b. Compress image size automatically c. Load different images for responsive screens d. Add image animations 12 / 30 12. A developer wants to update the text of a paragraph dynamically after a button click. Which combination is required? a. Arrays + Loops b. Event handling + DOM Manipulation c. Objects + Closures d. API + Async/Await 13 / 30 13. A search API is being called on every keypress in an input field, causing too many API requests. Which technique is most suitable to optimize this? a. Hoisting b. Recursion c. Debouncing d. Destructuring 14 / 30 14. A sidebar should remain visible after the user scrolls past it, but behave normally before reaching that point. Which CSS position value is most suitable? a. absolute b. fixed c. relative d. sticky 15 / 30 15. A form reloads the page automatically when the submit button is clicked, but the developer wants to validate data using JavaScript before submission. Which method should be used? a. removeEventListener() b. preventDefault() c. stopImmediatePropagation() d. stopPropagation() 16 / 30 16. Your team notices that search engines are unable to understand the structure of your webpage properly. Which practice would improve this the most? a. Adding more <div> tags b. Using semantic HTML tags c. Using larger fonts d. Using inline CSS 17 / 30 17. In Flexbox, which property aligns items vertically when flex-direction: row? a. align-content b. align-items c. justify-content d. flex-wrap 18 / 30 18. Which HTML tag is best suited for displaying tabular data with column headings? a. <data> b. <table> c. <grid> d. <list> 19 / 30 19. What will be the output? const numbers = [1, 2, 3, 4]; const result = numbers.map(num => num * 2); console.log(result); a. [2,4,6,8] b. 8 c. undefined d. [1,2,3,4] 20 / 30 20. What will happen if an element has z-index: 9999 but no positioning applied? a. Becomes fixed b. Element disappears c. z-index will not work d. Always on top 21 / 30 21. Which VS Code extension is commonly used to automatically refresh the browser during front-end development? a. IntelliCode b. Prettier c. Code Runner d. Live Server 22 / 30 22. A webpage becomes slow because multiple click events are attached repeatedly inside another event. What is the likely issue? a. Memory leak b. Event bubbling c. Callback hell d. Variable hoisting 23 / 30 23. a. type="reset" b. type="submit" c. type="button" d. type="click" 24 / 30 24. Which CSS Grid property is used to define the number and size of columns? a. grid-template-rows b. grid-template-columns c. grid-column-gap d. grid-auto-flow 25 / 30 25. Which attribute improves accessibility by associating a label with an input field? a. id b. placeholder c. name d. for 26 / 30 26. Which operator checks both value and data type in JavaScript? a. = b. = = = c. != d. = = 27 / 30 27. What is the output? const user = { name: "Anu" }; const { name } = user; console.log(name); a. undefined b. user c. Anu d. Error 28 / 30 28. A developer fetches user data from an API using fetch(). Sometimes the API takes time to respond, and the UI freezes while waiting. Which approach is best to handle this situation efficiently? a. Synchronous loops b. Reload page c. async/await or Promises d. console.log() 29 / 30 29. Which semantic tag is most appropriate for a standalone blog post on a webpage? a. <main> b. <aside> c. <article> d. <section> 30 / 30 30. Which additional attribute is required with autoplay for video in modern browsers? a. muted b. poster c. controls d. loop Your score is