Sign In Pages

Problem Overview

  • Implement sign-in pages by simulating three APIs: Register, Login, Logout, and produce a response per request.
  • Input: ordered array of API request strings. Output: array of responses. Usernames and passwords are case-sensitive.
  • Start with no users; if a user is already logged in, a new Login is unsuccessful; process requests in order.
  • Real-world authentication scenario; an Amazon interviews coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: