Object-oriented design interview questionMedium
Microsoft

Design a Role-Based Password Validator

Design an extensible validator that applies different password policies to regular users, administrators, and super administrators, handles Unicode input, and rejects passwords on a forbidden or breached-password list.

1. Problem Statement

Design a password validator with different requirements for regular users, administrators, and super administrators. The policy should be easy to extend when roles or rules change.

2. Live Coding Format

Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.

3. Key Focus Areas

  • 1
    Policy and rule interfaces
  • 2
    Role-to-policy composition
  • 3
    Useful validation errors
  • 4
    Unicode and normalization
  • 5
    Unit and boundary testing

4. What Strong Candidates Should Demonstrate

  • Model password policies without a brittle role-by-role conditional tree.
  • Keep validation rules composable, explainable, and easy to test.
  • Avoid security regressions when policies evolve.

Want interactive feedback?

Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.

Continue to Dashboard

Core Concepts

Hidden because they name the technique, which a real interviewer would not tell you.

Show core concepts
Object-Oriented DesignValidationSecurityTesting

Continue preparing

Build a complete software engineer mock interview plan

Prepare by company

Related Object-Oriented Design

Design a Rare Book Condition Management System

Model the core domain objects for tracking physical condition assessments of rare library books, with immutable scan history and structured condition report generation.

Related Object-Oriented Design

Design an Airline Management System

Design an airline domain model covering airports, aircraft seat layouts, scheduled flights versus dated flight instances, passengers, reservations and tickets, seat assignment, and flight status transitions.

Related Object-Oriented Design

Implement an In-Memory Rate Limiter

Design and implement an in-memory rate limiter as an object-oriented module, validate it with concrete test cases, and discuss concurrency considerations.

Related Object-Oriented Design

Design an ATM Transaction Engine

Design an ATM that authenticates a card and PIN, and supports balance inquiry, cash withdrawal with denomination dispensing, and deposits, including session/state handling and hardware abstractions.