Describe two key Angular CLI production build optimizations

Tests whether you know architect targets and concrete production optimizations. Strong answers name two of: dead code elimination and minification, hashed filenames for cache busting, or disabled source maps.
WHAT THIS TESTS: The interviewer wants to know if you understand the angular.json architect section controls builder targets, and that production is not just a label but a preset of aggressive optimizations. They are checking whether you can name specific behaviors of the Angular CLI build pipeline rather than giving a vague it is faster response.
A GOOD ANSWER COVERS: First, explain that the production configuration lives under the architect build options in angular.json and overrides the default development settings. Second, name two specific optimizations. One strong choice is dead code elimination and minification, which the CLI enables through the optimization flag set to true in production; this runs minification on scripts and optimizes styles. Another strong choice is output hashing, where the CLI rewrites filenames with content hashes for cache busting. Alternatively, mention that production disables source maps and extracts licenses to reduce payload. You do not need to list all of them, but the two you pick should be bundle-level optimizations, not just environment variable changes.
COMMON WRONG ANSWERS: Saying that production removes console logs is not a default Angular CLI behavior unless configured. Claiming that AOT compilation is a production-only optimization is outdated because modern Angular uses AOT in both development and production. Giving only source maps are disabled as both of your two answers looks thin because it ignores the actual bundle pipeline. Also, confusing angular.json with environment files is a red flag; the interviewer expects you to talk about builder targets.
LIKELY FOLLOW-UPS: The interviewer may ask how to customize these settings without ejecting, which you answer by editing the build options under the production target in angular.json. They might ask about budgets, which are size thresholds configured in the same file. They could also ask how the CLI decides which configuration to use, which leads to the defaultProject and architect target logic.
ONE CONCRETE EXAMPLE: If you open angular.json and navigate to projects then your app then architect then build then configurations then production, you will see fields like optimization set to true and outputHashing set to all. When you run ng build --configuration production, the CLI passes these options to the builder, resulting in a dist folder where main.js becomes something like main.a3f1b2c.js and unused library code is stripped out.
Read the original → angular.dev
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.