← Back to Articles         
Environment & Configuration - Interview Questions

Environment & Configuration - Interview Questions

Published on 12 Oct 2026     3 min read Angular
Quick Revision

1. How do you manage environment-specific configuration in Angular?

Angular uses environment files and build configurations to manage settings for development, testing, and production. The Angular CLI supports file replacements for different environments.

// environment.ts
export const environment = { apiUrl: 'https://localhost:7001/api' };

2. How do development and production configurations differ?

Development

Production

Local API URL

Production API URL

Debugging enabled

Optimized build

Source maps commonly enabled

Source maps typically disabled

Development settings

Production settings

3. Where should the ASP.NET Core API URL be configured?

Configure the API base URL in Angular environment files or a runtime configuration file. Services should reference this configuration instead of hard-coded URLs.

this.http.get(`${environment.apiUrl}/articles`);

4. How do Angular build configurations work?

Angular uses angular.json to define build configurations such as development and production. The CLI applies the selected configuration during compilation.

ng build --configuration production
ng serve --configuration development

5. How do you avoid hard-coding API URLs?

Define the API URL in a centralized configuration and reuse it across Angular services. This simplifies environment changes and maintenance.

export const API_URL = environment.apiUrl;

6. Can secrets be securely stored in Angular environment files?

No. Angular environment files are bundled into client-side JavaScript, making their contents accessible to users.

Key Point: Store only public configuration values, never passwords, private API keys, or signing secrets.

7. Why should database passwords and API secrets never be shipped in Angular code?

Angular executes in the user's browser, where JavaScript files can be inspected. Exposing credentials could allow unauthorized access to databases or backend services.

8. Where should secrets be stored in an Angular + ASP.NET Core architecture?

Store secrets on the ASP.NET Core server using environment variables, secure configuration providers, or Azure Key Vault. For local development, use .NET User Secrets.

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");

Key Point: Never commit production secrets to source control.

 

Important Interview Revision Points

Concept

Key Point

environment.ts

Development configuration

environment.production.ts

Production configuration

angular.json

Build configuration

fileReplacements

Environment-specific file replacement

ng serve

Development server

ng build

Application build

API Base URL

Centralized API endpoint

Runtime Configuration

Change settings without rebuilding

Angular Environment Files

Public configuration only

.NET User Secrets

Local development secrets

Environment Variables

Server-side configuration

Azure Key Vault

Secure secrets management

Angular + ASP.NET Core Configuration Flow

Angular Application
    |
    | environment.ts
    | API Base URL (Public)
    v
ASP.NET Core Web API
    |
    | appsettings.json
    | Environment Variables
    | Azure Key Vault
    v
SQL Server
    |
    | Database Credentials
    | Stored Server-Side

Interview priority: Focus particularly on questions 1, 2, 3, 4, 6, 7, and 8.

Key interview takeaway: Angular environment files manage public client-side configuration, while ASP.NET Core manages sensitive server-side configuration and secrets.

← Back to Articles