0
0
Angularframework~20 mins

Bundle size analysis in Angular - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bundle Size Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does Angular's bundle size primarily affect?
In Angular applications, why is it important to keep the bundle size small?
ABecause larger bundles increase the number of components in the app automatically.
BBecause smaller bundles load faster, improving user experience especially on slow networks.
CBecause bundle size controls the number of Angular modules you can create.
DBecause smaller bundles reduce the number of HTTP requests the server can handle.
Attempts:
2 left
💡 Hint
Think about what happens when a user opens your app on a slow internet connection.
component_behavior
intermediate
2: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?
AThe initial bundle size becomes zero because lazy loading removes all code from the main bundle.
BThe initial bundle size increases because lazy loading duplicates code.
CThe initial bundle size stays the same because all modules are bundled together anyway.
DThe initial bundle size decreases because feature modules are loaded only when needed.
Attempts:
2 left
💡 Hint
Think about when the code for a feature module is downloaded in lazy loading.
📝 Syntax
advanced
2:00remaining
Identify the correct Angular CLI command to analyze bundle size
Which Angular CLI command correctly generates a detailed bundle size report?
Ang build --stats-json
Bng serve --stats-report
Cng test --bundle-analyze
Dng lint --bundle-size
Attempts:
2 left
💡 Hint
The command should create a JSON file with build stats.
🔧 Debug
advanced
2: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?
AThe library is imported somewhere but never removed, so tree shaking cannot remove it.
BAngular automatically bundles all installed libraries regardless of usage.
CThe Angular CLI disables tree shaking by default.
DThe library code is included because it is referenced only in comments.
Attempts:
2 left
💡 Hint
Think about how unused imports affect the final bundle.
state_output
expert
2: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?
A1.8MB, because ES5 bundle is always loaded first.
B3.0MB, because both bundles are loaded together.
C1.2MB, because modern browsers load the ES2015 bundle only.
D0MB, because differential loading disables main bundles.
Attempts:
2 left
💡 Hint
Modern browsers load only the ES2015 bundle, not the ES5 one.