11.) What is lazy loading in performance optimization?
A) Loading all assets upfront.
B) Delaying loading of resources until they are needed.
C) Preloading all images in the background.
D) Minimizing HTTP requests.
12.) Which tool is used for regression testing in JavaScript?
A) Webpack
B) Puppeteer
C) Mocha
D) Cypress
13.) What is the purpose of minifying JavaScript files?
A) To reduce file size for faster loading.
B) To improve code readability.
C) To add comments to the code.
D) To detect syntax errors.
14.) How can you optimize the rendering performance of a web application?
A) Use synchronous JavaScript everywhere.
B) Minimize DOM manipulations and reflows.
C) Disable browser caching.
D) Increase CSS file size.
15.) Which of the following helps identify rendering performance issues?
A) Lighthouse
B) Heap snapshots
C) Console tab
D) Call stack
16.) What is the main purpose of console.trace() in debugging?
A) To stop code execution.
B) To display the stack trace of a function call.
C) To log all variables in scope.
D) To measure execution time.
17.) Which API is used to measure page load times?
A) Event Loop API
B) Web Animations API
C) Performance API
D) MediaStream API
18.) What is the purpose of the performance.now() method?
A) To measure code execution time in milliseconds with high precision.
B) To display the current date and time.
C) To pause code execution.
D) To profile memory usage.
19.) Which method is used to test asynchronous code in Jest?
A) testAsync()
B) done()
C) expectAsync()
D) wait()
20.) How can you avoid blocking the event loop in JavaScript?
A) Use synchronous code for all operations.
B) Minimize the use of promises.
C) Increase the number of event listeners.
D) Split large tasks into smaller chunks and use setTimeout().
Related