Challenge - 5 Problems
Bundle Size Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What does Angular's bundle size primarily affect?
In Angular applications, why is it important to keep the bundle size small?
Attempts:
2 left
💡 Hint
Think about what happens when a user opens your app on a slow internet connection.
✗ Incorrect
Smaller bundles mean less data to download, so the app loads faster and feels smoother to users.
❓ component_behavior
intermediate2:00remaining
How does lazy loading affect Angular bundle size?
Consider an Angular app with many feature modules. What happens to the initial bundle size when lazy loading is used?
Attempts:
2 left
💡 Hint
Think about when the code for a feature module is downloaded in lazy loading.
✗ Incorrect
Lazy loading splits the app so that feature modules load only when the user navigates to them, reducing the initial bundle size.
📝 Syntax
advanced2:00remaining
Identify the correct Angular CLI command to analyze bundle size
Which Angular CLI command correctly generates a detailed bundle size report?
Attempts:
2 left
💡 Hint
The command should create a JSON file with build stats.
✗ Incorrect
The ng build --stats-json command creates a stats.json file used for bundle analysis.
🔧 Debug
advanced2:00remaining
Why does the Angular bundle include unused code?
You notice your Angular bundle is large and includes code from a library you no longer use. What is the most likely cause?
Attempts:
2 left
💡 Hint
Think about how unused imports affect the final bundle.
✗ Incorrect
If a library is imported in code, even if unused, it can be included in the bundle unless tree shaking removes it.
❓ state_output
expert2:00remaining
What is the size of the main bundle after enabling differential loading?
An Angular app is built with differential loading enabled. The ES2015 bundle is 1.2MB and the ES5 bundle is 1.8MB. What is the size of the main bundle served to modern browsers?
Attempts:
2 left
💡 Hint
Modern browsers load only the ES2015 bundle, not the ES5 one.
✗ Incorrect
Differential loading serves smaller ES2015 bundles to modern browsers, reducing bundle size and improving performance.