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