PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Bloomberg

Design auth, session security, and top-N users

Last updated: May 1, 2026

Quick Overview

This question evaluates a candidate's competency in web authentication and session security, secure API design, and scalable analytics for computing top-N active users.

  • hard
  • Bloomberg
  • System Design
  • Software Engineer

Design auth, session security, and top-N users

Company: Bloomberg

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design a web application where a user signs in and the page displays "Hello, <username>". 1) Define the client–server APIs for sign-up, sign-in, sign-out, and fetching the greeting (request/response shapes, status codes, and error handling). 2) Choose an authentication approach (stateful sessions vs. stateless tokens like JWT) and detail password storage, MFA (optional), TLS, CSRF protection, and XSS mitigations. 3) After sign-in, explain how to prevent others from impersonating a user by reusing/guessing a user ID; cover session identifiers or tokens, entropy, rotation/expiration, storage (cookie flags, SameSite), token binding, refresh flows, and defenses against fixation, replay, and theft. 4) Design an endpoint/service that returns the top N active users over a recent time window; define what "active" means, the signals you will count (e.g., requests, actions), the data model, and an efficient computation approach (e.g., sliding-window counters, stream processing, precomputed aggregations). Include scalability, consistency, rate limiting, and back-of-the-envelope capacity planning.

Quick Answer: This question evaluates a candidate's competency in web authentication and session security, secure API design, and scalable analytics for computing top-N active users.

Related Interview Questions

  • Design streaming mention analytics with search and alerts - Bloomberg (hard)
  • Design a Global Marketing Email Platform - Bloomberg (medium)
  • Design a fair event registration queue API - Bloomberg (medium)
  • Design in-memory trade subscription processor - Bloomberg (medium)
  • Explain Kafka partitions and delivery semantics - Bloomberg (hard)
Bloomberg logo
Bloomberg
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
System Design
16
0

Web App Design: Authentication, Security, and Top-N Active Users

Context: Build a browser-based web application where a user signs in and the page displays "Hello, <username>". Assume JSON over HTTPS, a single-page web client, and a backend service. Design the APIs, authentication, and a service that returns the top N active users over a recent time window.

Tasks

  1. Client–Server APIs
  • Define REST endpoints for sign-up, sign-in, sign-out, and fetching the greeting.
  • Include request/response JSON shapes, HTTP status codes, and error handling.
  1. Authentication Approach
  • Choose between stateful server-side sessions and stateless tokens (e.g., JWT).
  • Detail password storage, optional MFA, TLS requirements, CSRF protection, and XSS mitigations.
  1. Post Sign-In Impersonation Risks
  • Explain how to prevent impersonation via reusing/guessing a user ID.
  • Cover session identifiers or tokens, entropy, rotation/expiration, storage (cookie flags, SameSite), token binding, refresh flows, and defenses against fixation, replay, and theft.
  1. Top N Active Users Service
  • Design an endpoint/service that returns the top N active users over a recent window.
  • Define "active" and the signals counted (e.g., requests, actions).
  • Propose a data model and an efficient computation approach (e.g., sliding-window counters, stream processing, precomputed aggregations).
  • Include scalability, consistency tradeoffs, rate limiting, and back-of-the-envelope capacity planning.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Bloomberg•More Software Engineer•Bloomberg Software Engineer•Bloomberg System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.