← bridge.xyz Interview Insights

bridge.xyz·Software Engineer·Onsite - System Design / Architecture·Intermediate

Intermediate
May 2026

Summary

System design round at Bridge.Xyz for a software engineer role, focused entirely on building an email/password auth service from scratch. No scaling tricks, just get the security fundamentals right. Trickier than it sounds.

Questions Asked (6)

Q1

Design a basic email and password authentication service supporting user sign-up and login, without using any third-party identity providers.

System DesignAPI & IntegrationsData Modeling
Author's notes

Big open-ended question to start.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (e.g., scale, security, compliance) and then outline the core components: user registration, login, password storage, session management, and security measures. Focus on a secure, scalable design that uses industry best practices like bcrypt for password hashing and JWT for sessions, and discuss trade-offs.

Pro tip: Demonstrate security awareness by mentioning rate limiting, account lockout, and secure password reset flows, and discuss how you would handle scaling and monitoring. Also, consider mentioning compliance standards like GDPR or SOC2 if relevant to bridge.xyz's fintech context.

1. Clarify Requirements

Ask about expected scale, security requirements, compliance needs, and whether features like email verification, password reset, or multi-factor authentication are needed.

2. Design Data Model

Define a users table with fields like id, email (unique), password_hash, created_at, updated_at, and possibly status. Consider a separate table for sessions or tokens if needed.

3. Design API Endpoints

Outline endpoints for sign-up (POST /signup), login (POST /login), and possibly logout (POST /logout). Specify request/response formats and status codes.

4. Detail Security Measures

Explain password hashing (bcrypt/argon2), salting, secure session management (JWT or server-side sessions), HTTPS, rate limiting, and protection against common attacks (SQL injection, XSS, CSRF).

5. Discuss Scalability and Operations

Address how to scale (e.g., stateless JWT, database sharding), monitoring, logging, and handling failures. Mention potential use of caching for sessions.

Key Points to Mention

  • Password hashing with bcrypt or Argon2, including salting and work factors.
  • Session management using JWT or secure, HttpOnly cookies with server-side session storage.
  • Rate limiting and account lockout to prevent brute-force attacks.
  • Email verification and secure password reset flows using time-limited tokens.
  • Database design: unique email constraint, indexing, and handling of soft deletes.
  • Compliance and data protection (e.g., GDPR, encryption at rest and in transit).

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

Q2

How should passwords be stored securely, and why can't you just use a standard hash like SHA-256?

Technical Trade-offsSystem Design
Author's notes

Knew this one cold.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining that passwords should never be stored in plaintext or with fast general-purpose hashes. Describe the correct approach: use a slow, salted, memory-hard password hashing function like Argon2id, bcrypt, or scrypt. Then explain why SHA-256 is unsuitable: it's designed to be fast, making brute-force and rainbow table attacks feasible.

Pro tip: Mention that even with a strong password hash, you should enforce rate limiting and account lockout to mitigate online attacks, and consider using a pepper (a secret key) stored separately from the database for defense in depth.

1. State the goal

Explain that the goal is to make password verification slow and costly for attackers, while still being fast enough for legitimate users.

2. Describe secure storage

Recommend using a password hashing function like Argon2id, bcrypt, or scrypt, which are intentionally slow and include salting to prevent rainbow table attacks.

3. Explain why SHA-256 is inadequate

Point out that SHA-256 is a fast cryptographic hash, making it vulnerable to brute-force and GPU-based attacks; it also lacks built-in salting and work factors.

4. Discuss additional measures

Mention the importance of salting (unique per password), using a pepper (secret key), and implementing rate limiting and account lockout to defend against online attacks.

5. Summarize trade-offs

Conclude that while strong password hashing adds computational overhead, it's a necessary trade-off for security, and modern libraries make implementation straightforward.

Key Points to Mention

  • Use of slow, memory-hard password hashing functions (Argon2id, bcrypt, scrypt)
  • Salting: unique random salt per password to prevent rainbow tables and identical hashes
  • Why SHA-256 is fast and therefore vulnerable to brute-force and GPU attacks
  • Work factor / cost parameter: adjustable to increase computational cost over time
  • Pepper: an additional secret key stored separately from the database
  • Defense in depth: rate limiting, account lockout, and monitoring for breach attempts

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

Q3

How do you manage login state after a user authenticates, and what are the tradeoffs between opaque session tokens and JWTs?

System DesignTechnical Trade-offs
Author's notes

I went with opaque tokens and argued revocation is cleaner when you control a single DB.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining the core requirements of login state management: security, scalability, and user experience. Then compare opaque session tokens and JWTs across dimensions like statelessness, revocation, and performance, and conclude with a recommendation tailored to the context (e.g., bridge.xyz's fintech environment).

Pro tip: Emphasize that the choice isn't binary—many production systems use a hybrid approach (e.g., short-lived JWTs with refresh tokens backed by a session store) to balance scalability and revocation. Mentioning this shows you understand real-world tradeoffs beyond textbook definitions.

1. Clarify requirements and constraints

Ask about scale, security/compliance needs (e.g., PCI DSS for fintech), and whether horizontal scaling is a priority. This frames the tradeoff discussion around the company's context.

2. Explain opaque session tokens

Describe how they work: a random string stored server-side (e.g., in Redis or a database) that maps to user session data. Highlight pros (easy revocation, no sensitive data in token) and cons (server-side storage, scaling challenges).

3. Explain JWTs

Describe how they work: a self-contained token with claims signed by the server. Highlight pros (stateless, scalable, no DB lookup) and cons (hard to revoke, size, potential for stale data).

4. Compare tradeoffs

Contrast on key dimensions: revocation, scalability, performance, security, and complexity. For example, JWTs are great for microservices but revocation is hard; opaque tokens are simple to revoke but require shared storage.

5. Recommend a solution

Propose a pragmatic approach for bridge.xyz, such as using short-lived JWTs with refresh tokens stored server-side, or opaque tokens with a distributed cache. Justify based on requirements from step 1.

Key Points to Mention

  • Statelessness vs. statefulness: JWTs are self-contained, opaque tokens require server-side storage.
  • Revocation: opaque tokens can be revoked immediately; JWTs require blacklists or short expiry.
  • Scalability: JWTs scale horizontally without shared storage; opaque tokens need a centralized store (e.g., Redis).
  • Security: JWTs are signed but not encrypted (avoid sensitive data); opaque tokens are just references.
  • Performance: JWTs avoid database lookups; opaque tokens add latency per request.
  • Hybrid approaches: short-lived JWTs + refresh tokens, or token introspection for opaque tokens.

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

Q4

What is user enumeration and how do you prevent it, including the timing side channel?

System DesignTechnical Trade-offs
Author's notes

This is where I lost some points.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Define user enumeration as an information disclosure vulnerability where attackers can determine valid usernames or accounts, then explain prevention strategies for both response content and timing side channels. Emphasize consistent responses, rate limiting, and constant-time operations, and discuss trade-offs between security and user experience.

Pro tip: Mention that timing side channels are often overlooked but can be mitigated with constant-time algorithms and dummy operations; also note that logging and monitoring can help detect enumeration attempts.

1. Define User Enumeration

Explain that user enumeration occurs when an application reveals whether a username or account exists, often through different error messages, response times, or status codes.

2. Identify Enumeration Vectors

List common vectors such as login forms, registration pages, password reset flows, and APIs that return different responses for valid vs. invalid users.

3. Prevent Content-Based Enumeration

Use generic error messages (e.g., 'Invalid username or password') for all authentication failures, and ensure consistent HTTP status codes and response bodies.

4. Mitigate Timing Side Channels

Implement constant-time comparison for password hashing and user lookup, add random delays, or perform dummy operations to equalize response times regardless of user existence.

5. Add Defensive Measures

Apply rate limiting, CAPTCHAs, and account lockouts to slow down enumeration attempts, and monitor logs for suspicious patterns.

Key Points to Mention

  • Generic error messages for authentication failures
  • Consistent HTTP status codes and response bodies
  • Constant-time algorithms for password verification and user lookup
  • Rate limiting and CAPTCHAs to deter automated enumeration
  • Timing side channels and mitigation techniques (e.g., dummy operations, random delays)
  • Trade-offs between security and user experience (e.g., usability of password reset flows)

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

Q5

How would you handle 'log out from all devices' and force re-login after a password change?

System DesignTechnical Trade-offs
Author's notes

Follow-up question near the end.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: immediate invalidation of all sessions upon password change, with a good user experience. Then propose a token-based architecture with a centralized session store or token versioning, and discuss trade-offs between security, performance, and complexity.

Pro tip: Mention that you would also invalidate sessions on other security-sensitive events (e.g., email change) and provide a way for users to see and revoke active sessions, which shows a holistic security mindset.

1. Clarify requirements and constraints

Ask whether the invalidation must be immediate, whether it applies to all devices including the current one, and what the expected scale is. This ensures you design the right solution.

2. Choose a session management strategy

Decide between stateful sessions (server-side store) and stateless tokens (JWT). For immediate revocation, a centralized store or token versioning is needed.

3. Implement token invalidation

For JWTs, use a token version or a blacklist/whitelist in a fast data store like Redis. For stateful sessions, simply delete all sessions for the user from the store.

4. Handle the current session and user experience

Decide whether to log out the current device immediately or allow it to continue. Typically, you force re-login on all devices, but you might keep the current session active for convenience.

5. Discuss trade-offs and edge cases

Cover performance implications (e.g., Redis latency), consistency (eventual vs. immediate), and failure modes (e.g., if Redis is down). Also mention scaling considerations.

Key Points to Mention

  • Use of a centralized session store (e.g., Redis) for stateful sessions or token versioning for JWTs
  • Immediate invalidation vs. eventual consistency and the trade-offs
  • Handling of the current session (log out current device or not)
  • Performance and scalability considerations (e.g., Redis as a bottleneck)
  • Security best practices: invalidate on password change, email change, etc.
  • User experience: notifying the user and providing a way to manage active sessions

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

Q6

Where would email verification and password reset flows attach to this design, and what new tables or tokens would they require?

System DesignData Modeling
Author's notes

Kept this one brief since I'd declared both out of scope earlier.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, identify the existing user model and authentication layer in the design, then describe where email verification and password reset flows attach as separate services or modules that interact with the user table. Explain the new tables (e.g., verification_tokens, password_reset_tokens) and token properties (expiry, single-use, hashed storage) needed to support these flows securely.

Pro tip: Mention that tokens should be stored hashed and single-use with short TTLs, and that email sending should be asynchronous via a queue to avoid blocking the main request flow—this shows production maturity.

1. Locate the attachment points

Identify where in the existing design these flows attach: typically after user creation (for email verification) and as an unauthenticated endpoint (for password reset).

2. Define new tables and schema

Propose tables like email_verification_tokens and password_reset_tokens with columns: id, user_id, token_hash, expires_at, used_at, created_at.

3. Describe token generation and validation

Explain how tokens are generated (cryptographically random), hashed before storage, and validated by comparing hashes and checking expiry and usage.

4. Outline the flow steps

Walk through the request flow: user requests reset/verification, server generates token, stores hash, sends email with link containing raw token, user clicks link, server validates and performs action.

5. Address security and scalability

Discuss rate limiting, token invalidation on password change, and using a queue for email delivery to handle scale.

Key Points to Mention

  • Token storage: store only hashed tokens (e.g., SHA-256) to prevent misuse if database is compromised.
  • Token properties: single-use, short expiry (e.g., 15-60 minutes), and tied to user ID.
  • Email delivery: use an asynchronous queue (e.g., SQS, RabbitMQ) to decouple email sending from the request path.
  • Rate limiting: prevent abuse by limiting requests per email/IP.
  • Invalidation: invalidate existing tokens when a new one is issued or when password changes.
  • Database indexing: index on token_hash and user_id for efficient lookups.

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