Angular MCQs – Authentication and Security21.) What Angular feature is used to automatically attach authentication headers to HTTP requests?A) Route GuardsB) ServicesC) HTTP InterceptorsD) DirectivesShow AnswerAnswer: Option CExplanation: HTTP Interceptors modify HTTP requests by attaching authentication tokens before they are sent.22.) Which attack does Angular’s built-in Content Security Policy (CSP) help prevent?A) Cross-Site Scripting (XSS)B) SQL injectionC) DDoS attacksD) Buffer overflowShow AnswerAnswer: Option AExplanation: CSP (Content Security Policy) blocks malicious scripts, preventing XSS attacks in Angular applications.23.) Which guard is used for route protection?A) CanLoadB) CanActivateC) CanDeactivateD) CanMatchShow AnswerAnswer: Option BExplanation: CanActivate prevents users from accessing routes without proper authentication.RelatedPages: 1 2 3