Auth and Security interview questions
100 Backend Engineering practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise Auth and Security questionsBeginner
- A secret was committed to GitHub
- CORS is not an authentication mechanism
- Cross-site request forgery
- Cross-site scripting from the backend's view
- Encryption at rest and in transit
- Hidden admin endpoint is accessible
- How to store passwords
- Input validation as a security control
- Login form vulnerable to SQL injection
- Login reveals which emails exist
- Managing secrets in a backend
- Multi-factor authentication
- OAuth 2.0 vs OpenID Connect
- Passwords appear in logs
- Passwords stored with MD5
- Principle of least privilege
- Protecting login from brute force
- Role-based access control
- Secure password reset flow
- Securing file uploads
- Security audit logging
- Session cookie missing security flags
- Session-based authentication
- Sessions vs JWTs
- Some API calls use plain HTTP
- Stack traces shown to users
- Storing API keys safely
- Users stay logged in forever
- Vulnerable dependencies
- What a JWT is
- What a salt is
- What OAuth 2.0 is
- Where to store tokens in a web app
- Why HTTPS matters for APIs
Intermediate
- ABAC and ReBAC
- Adding "Sign in with Google"
- Adding TOTP-based MFA
- API returns too much data
- Are UUIDs enough to protect resources?
- Authenticating service-to-service calls
- Authorisation logic scattered everywhere
- Authorization code flow with PKCE
- Client credentials flow
- Constant-time comparison
- Designing scopes for a public API
- Download endpoint exposes server files
- Encrypting sensitive fields
- Huge requests take down the API
- Insecure deserialisation
- Key management with KMS
- Normal user calls admin API
- OWASP API Security Top 10
- Passkeys and WebAuthn
- Refresh tokens and rotation
- Revoking JWTs after a breach
- Rotating database credentials without downtime
- Security headers
- Security testing in CI/CD
- Server-side request forgery
- Session handling after login
- Tenant admin can access other tenants
- Threat modelling
- User made themselves an admin
- User-provided webhook URLs
- Validating JWTs correctly
- Verifying incoming webhooks
- Zero-trust architecture
Experienced
- Abuse prevention beyond rate limits
- Adding enterprise SSO to a SaaS product
- Building security into the development process
- Choosing cryptographic primitives
- Customers leaking their API keys
- Defence in depth for a backend
- Designing permissions for document sharing
- Designing secure outbound webhooks
- Dynamic secrets
- Encryption key may be compromised
- Engineers have broad production data access
- Gateway checks auth but services trust everything
- Identity provider outage
- JWT algorithm confusion
- Letting support staff act as a user
- OAuth redirect URI abuse
- OAuth token exchange
- Personal data spread across logs and analytics
- Policy as code for authorisation
- Privacy requirements in backend design
- Rate limiting a login API across regions
- Removing long-lived cloud keys from CI
- Responding to a data breach
- Rotating every secret after a breach
- Rotating JWT signing keys
- Securing a public GraphQL API
- Sender-constrained tokens
- Software supply chain security
- SSRF leads to cloud credential theft
- Stale permissions after access is revoked
- Stored XSS found in user profiles
- Tenant isolation strategies
- Wave of account takeovers