← Bridge Interview Insights

Bridge·Software Engineer·Onsite - System Design / Architecture·Intermediate

IntermediatePrefer not to say
May 2026Remote

Summary

System design round at bridge.xyz for a software engineer role, focused entirely on building an auth service from scratch. No OAuth shortcuts allowed, which honestly made it more interesting than the usual 'just use Cognito' answer.

Questions Asked (4)

Q1

Design a simple authentication service with sign-up and login, built entirely in-house without any third-party OAuth providers.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

This one had a lot of surface area.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, security, compliance) and then walk through a high-level design covering data model, API endpoints, and token management. Emphasize security best practices like password hashing and rate limiting, and discuss trade-offs such as session vs. JWT and database choices.

Pro tip: Demonstrate awareness of security pitfalls by mentioning timing attacks and the importance of constant-time comparisons, and suggest using a well-vetted library for password hashing rather than implementing crypto yourself.

1. Clarify Requirements

Ask about expected scale, security/compliance needs (e.g., GDPR, PCI), and whether features like email verification, password reset, or MFA are required.

2. Design Data Model

Define a users table with fields for email, hashed password, salt, and metadata; consider a separate table for refresh tokens or sessions if needed.

3. Define API Endpoints

Outline endpoints for sign-up, login, logout, and token refresh; specify request/response formats and HTTP status codes.

4. Implement Security Measures

Describe password hashing (e.g., bcrypt/Argon2), token generation (JWT or opaque), secure storage (HttpOnly cookies), and protections like rate limiting and CSRF.

5. Discuss Trade-offs and Scalability

Compare session-based vs. token-based auth, SQL vs. NoSQL, and how to scale (e.g., stateless JWT, distributed session store).

Key Points to Mention

  • Password hashing with salt using bcrypt/Argon2 and constant-time comparison
  • Token-based auth: JWT vs. opaque tokens, access/refresh token pattern
  • Secure token storage: HttpOnly, Secure, SameSite cookies or secure client storage
  • Rate limiting and account lockout to prevent brute-force attacks
  • Email verification and password reset flows with time-limited tokens
  • Scalability considerations: stateless vs. stateful auth, database choice, caching

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you design the database schema for storing user credentials, and how should passwords be stored?

Data ModelingSystem Design
Author's notes

Covered the basics: separate users and credentials tables, salted hash with a cost factor, never storing plaintext.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements such as scale, compliance, and authentication needs. Then outline a normalized schema separating user identity from credentials, and explain secure password storage using adaptive hashing with salts. Emphasize defense-in-depth and future-proofing.

Pro tip: Mention that password hashing should be done client-side or in a secure enclave if possible, but always server-side with a slow hash. Also, discuss the importance of a separate credentials table to allow multiple authentication methods without altering the user table.

1. Clarify Requirements

Ask about scale, compliance (e.g., GDPR, PCI), and authentication methods (password, OAuth, etc.). This shows you consider context before designing.

2. Design User and Credentials Tables

Propose a users table for identity (email, name) and a separate credentials table for authentication data (user_id, password_hash, salt, algorithm, etc.). This separation supports multiple auth methods and clean data management.

3. Choose Password Hashing Strategy

Recommend a strong adaptive hashing algorithm like Argon2id, bcrypt, or scrypt. Explain the need for unique salts per password and tuning work factors for security vs. performance.

4. Address Security Best Practices

Discuss pepper (secret key added to hash), rate limiting, account lockout, and secure password reset flows. Mention that passwords should never be stored in plaintext or reversible encryption.

5. Consider Scalability and Maintenance

Talk about indexing for lookups, handling hash upgrades (rehashing on login), and monitoring for breaches. Show awareness of operational aspects.

Key Points to Mention

  • Use of adaptive hashing algorithms like Argon2id, bcrypt, or scrypt with unique salts.
  • Separation of user identity and credentials into different tables for flexibility.
  • Never store passwords in plaintext or using reversible encryption.
  • Implementation of pepper (secret key) stored separately from the database.
  • Rate limiting and account lockout to prevent brute-force attacks.
  • Plan for algorithm upgrades and rehashing on user login.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through how you'd issue and validate sessions or auth tokens, including expiration and revocation.

System DesignTechnical Trade-offs
Author's notes

Went with cookie-based sessions since scale was explicitly off the table.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system context and requirements (e.g., web/mobile clients, security needs, scale). Then walk through the full lifecycle: issuance, validation, expiration, and revocation, explaining trade-offs between stateful sessions and stateless tokens. Conclude with how you'd handle edge cases like token theft or logout across devices.

Pro tip: Emphasize that revocation is the hardest part of stateless tokens and discuss practical mitigations like short-lived access tokens with refresh token rotation and a revocation list. Showing awareness of operational concerns (e.g., clock skew, key rotation) demonstrates maturity.

1. Clarify requirements and constraints

Ask about client types, security requirements, scale, and whether statelessness is needed. This shapes your choice between sessions and tokens.

2. Design token issuance

Explain how you'd generate tokens (e.g., JWT with signed claims) or create sessions (server-side store with session ID). Include what data goes in the token and how it's signed/encrypted.

3. Explain validation

Describe how the server validates tokens on each request: signature verification, expiration check, and possibly audience/issuer validation. For sessions, look up the session ID in the store.

4. Handle expiration and refresh

Discuss short-lived access tokens and longer-lived refresh tokens, with refresh token rotation. For sessions, set idle and absolute timeouts.

5. Implement revocation

Cover strategies: for sessions, delete from store; for tokens, maintain a blacklist/revocation list or use short expirations. Mention trade-offs (e.g., blacklist adds state).

Key Points to Mention

  • JWT structure and signing (HMAC vs RSA) and why not to store sensitive data in payload
  • Refresh token rotation and reuse detection to mitigate token theft
  • Revocation challenges with stateless tokens and solutions like blacklisting or short TTLs
  • Session storage options (in-memory, Redis) and scalability considerations
  • Clock skew and token expiration leeway
  • Secure token transmission (HTTPS, HttpOnly cookies) and storage (avoid localStorage for sensitive tokens)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

What security considerations would you include in this auth service, such as brute-force protection and timing-safe comparisons?

System DesignTechnical Trade-offs
Author's notes

Rate limiting on login endpoints, account lockout after N failures, timing-safe compare to prevent user enumeration via response time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing security as a layered defense-in-depth strategy, then systematically cover authentication-specific threats like brute-force, timing attacks, and credential storage. Tie each consideration to concrete implementation choices (e.g., rate limiting, constant-time comparison) and trade-offs (e.g., latency vs. security), showing you understand both the 'what' and 'why'.

Pro tip: Mention that timing-safe comparisons should be used for all secret comparisons (not just passwords) and that rate limiting should be applied per-account and per-IP with exponential backoff to avoid denial-of-service on legitimate users. Also, note that security is a continuous process, not a one-time checklist.

1. Identify threats and assets

Briefly outline the key assets (credentials, tokens, sessions) and the main threats (brute-force, timing attacks, credential stuffing, session hijacking). This shows you prioritize based on risk.

2. Implement brute-force protection

Describe rate limiting (per IP and per account), account lockout with exponential backoff, CAPTCHA after repeated failures, and monitoring/alerting for suspicious patterns.

3. Use timing-safe comparisons

Explain that string comparison for secrets (passwords, tokens) must be constant-time to prevent timing attacks. Mention using language-specific functions like `hmac.compare_digest` in Python or `crypto.timingSafeEqual` in Node.js.

4. Secure credential storage and transmission

Cover password hashing with strong algorithms (bcrypt, Argon2), salting, and enforcing HTTPS/TLS for all auth traffic. Also mention secure token generation and storage (e.g., HttpOnly cookies).

5. Add defense-in-depth and monitoring

Include additional layers like multi-factor authentication, anomaly detection, logging of auth events, and regular security audits. Emphasize that security is iterative.

Key Points to Mention

  • Rate limiting and account lockout with exponential backoff to mitigate brute-force attacks.
  • Timing-safe comparison functions for all secret comparisons to prevent timing side-channels.
  • Password hashing with adaptive algorithms (bcrypt, Argon2) and per-user salts.
  • Secure session management: HttpOnly, Secure, SameSite cookies; token expiration and rotation.
  • Monitoring and alerting for failed login attempts and anomalous behavior.
  • Trade-offs: balancing security measures with user experience (e.g., lockout duration, CAPTCHA friction).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.