FrontEnd Screening TestBy Collab Team Contributor / February 22, 2025 FrontEnd Screening Test 1 / 20 What is the purpose of React’s useState hook? To handle API requests To replace Redux To manage component state in function components To manage global state 2 / 20 What is the difference between .call() and .apply() in JavaScript? .apply() is used for defining class components .call() executes a function asynchronously .apply() is faster than .call() .call() passes arguments separately, .apply() takes an array of arguments 3 / 20 Which of the following is a CSS preprocessor? LESS SASS SCSS All of the above 4 / 20 What is the key benefit of using Virtual DOM in React? It allows using different programming languages It enables automatic CSS styling It directly modifies the real DOM It speeds up performance by reducing direct DOM manipulation 5 / 20 In JavaScript, what is the purpose of the bind() method? To prevent function execution To modify function parameters To bind a function to a specific this context To execute a function immediately 6 / 20 What is the difference between var, let, and const? const can be reassigned var is function-scoped, let and const are block-scoped let is globally available var cannot be reassigned, let and const can 7 / 20 What will be the output of console.log(0.1 + 0.2 === 0.3)? false undefined true NaN 8 / 20 What is the primary difference between == and === in JavaScript? === is faster than == There is no difference == compares values, === compares values and types == checks only data type, while === checks only value 9 / 20 What will be the output of console.log(typeof NaN)? Null Undefined Number NaN 10 / 20 In CSS, which unit is relative to the width of the viewport? em px vh rem 11 / 20 What is a closure in JavaScript? A function that has access to variables from its outer scope A function that is executed immediately A function with no parameters A function that returns another function 12 / 20 How do you prevent a default event behavior in JavaScript? event.stopPropagation() event.preventDefault() event.stop() event.cancelEvent() 13 / 20 In CSS Grid, what does grid-template-columns: repeat(3, 1fr); do? Creates a responsive design Creates a flexible column layout All of the above Creates 3 columns of equal width 14 / 20 Which HTTP status code represents a successful request? 400 302 500 200 15 / 20 Which of the following will NOT change the original array in JavaScript? pop() push() splice() map() 16 / 20 What is the difference between localStorage and sessionStorage? localStorage persists data even after the browser is closed localStorage can store larger data than sessionStorage Both store data permanently sessionStorage stores data permanently 17 / 20 What is the purpose of React's useEffect hook? To modify the state To directly manipulate the DOM To manage side effects in functional components To replace setState 18 / 20 In React, which lifecycle method is invoked right after a component is inserted into the DOM? componentDidMount componentDidUpdate shouldComponentUpdate componentWillUnmount 19 / 20 Which of the following is NOT a valid JavaScript data type? Boolean Character Undefined Symbol 20 / 20 What is the purpose of a service worker in a PWA? To execute server-side logic To handle offline capabilities and caching A) To manage CSS styling B)C) D) To replace JavaScript Your score isThe average score is 57% 0% Restart quiz