Profiling and Measuring — Concept Check
Questions on Profiling and Measuring. Two different questions need two different tools: "which component is slow" is the React Profiler, "is the page slow for users" is Lighthouse and field metrics.
Questions in this quiz
7 questions on Profiling and Measuring — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A React component re-renders 20 times per keystroke. Which tool should you use to diagnose the problem?
- AReact Profiler
- BBundle analyzer
- CField metrics
- DLighthouse
2.A webpage takes 4 seconds to become interactive. What is the most likely cause?
- ABundle and network issues
- BJavaScript syntax errors
- CCSS styling errors
- DReact component re-renders
3.When using the React Profiler, what does a large 'self duration' indicate?
- AThe entire app is slow
- BThe browser is outdated
- CThe network is slow
- DThe component itself is slow
4.Which metric should you measure to determine if a page responds quickly to user interactions?
- AINP (Interaction to Next Paint)
- BFCP (First Contentful Paint)
- CLCP (Largest Contentful Paint)
- DCLS (Cumulative Layout Shift)
5.A website's largest contentful paint (LCP) is 3 seconds. What is a potential fix?
- AAdding more JavaScript libraries
- BCode splitting and preloading hero images
- CIncreasing CSS specificity
- DUsing a single large CSS file
6.What is the primary purpose of using Lighthouse in performance analysis?
- ATo improve database queries
- BTo assess user-facing load performance
- CTo optimize CSS styles
- DTo debug JavaScript errors
7.What should you check first if a React app loads slowly?
- AJavaScript syntax using a linter
- BCSS styles using a style linter
- CHTML structure using a validator
- DBundle size using a bundle analyzer