FastPrepSign In Pages 🍊
Problems/Sign In Pages 🍊

Sign In Pages 🍊

Amazon logoAmazon● EasyINTERNOA

Updated Sep 2026

QuestionFunctionExamples

Problem statement

As an intern at Amazon, you have been assigned a task to implement the three sign in pages, each with its own API: Register, Login, Logout.

Notes:

  • Initially, there are no users registered.
  • If a user is already logged in and makes a login request, the new request is unsuccessful. The original login remains active.
  • Each log is an API request and is in one of the three allowed formats.
  • The order of execution of each requests is the same as order of the input.
  • The username and passwords are case-sensitive.

Complete the function signInPages in the editor.

signInPages has the following parameter:

  1. String[] requests: an array of API requests

String[]: an array of responses for each API request

Function

signInPages(requests: String[]) β†’ String[]

Examples

Example 1

requests = ["register david david123", "register adam 1Adam1", "login david david123", "login adam 1adam1", "logout david"]return = ["Registered Successfully", "Registered Successfully", "Logged In Successfully", "Login Unsuccessful", "Logged Out Successfully"]

The sequence of API requests and their corresponding responses are as follows:

  1. register david david123 - The user 'david' is registered successfully.
  2. register adam 1Adam1 - The user 'adam' is registered successfully.
  3. login david david123 - The user 'david' logs in successfully.
  4. login adam 1adam1 - The login is unsuccessful because the password is case-sensitive and does not match the registered password '1Adam1'.
  5. logout david - The user 'david' is logged out successfully.

More Amazon interview questions

  • LRU Cache for Query ResultsPHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
  • Maximal SquareONSITE INTERVIEW Β· Seen Nov 2026
  • Serialize and Deserialize a Binary TreeONSITE INTERVIEW Β· Seen Nov 2026
  • Course SchedulePHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
  • Course Schedule IIPHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
  • Diagonal Traversal of a Binary TreeONSITE INTERVIEW Β· Seen Nov 2026
  • Minimum Time to Spread Through a GridPHONE SCREEN Β· ONSITE INTERVIEW Β· Seen Nov 2026
  • Consistent-Hash Packet RouterPHONE SCREEN Β· Seen Nov 2026
  • Count Connected ComponentsPHONE SCREEN Β· Seen Nov 2026
  • Maximize K-Element AND with an Increment BudgetOA Β· Seen Nov 2026

Similar questions at other companies

  • Blood Type Inheritance: Possible Parent GenotypesAbridge Β· OAAbridge interview questions
  • Branch with the Most FilesCapital One Β· OACapital One interview questions
  • Filter Transaction Logs and Calculate Reliability MetricsStripe Β· OAStripe interview questions
  • Parcel Event TrackingAirbnb Β· OAAirbnb interview questions
  • Versioned Recipe SystemThe Trade Desk Β· OA
  • Cheating CodemakerJane Street Β· OAJane Street interview questions
  • Aggregate Paginated Project Run RecordsReplit Β· OA
  • Numbers Station Message DecoderOptiver Β· OAOptiver interview questions
  • Hidden ArtifactsIMC Trading Β· OAIMC Trading interview questions
  • SimpleRDD Word CountDatologyAI Β· PHONE SCREEN

Interview reports that mention this question

  • Amazon Intern OA Problems: Every Task We Have (Part 2 of 5)

Amazon interview experiences

  • Amazon Experienced SDE Onsite Questions: 1 Experience
  • Amazon SDE Onsite Interview Questions: 9 Experiences
  • Amazon SDE II and L5 FDE Interview Questions: 4 Experiences
  • Amazon Full-Time OA Problems, Earlier Reports (Part 5 of 5)
  • Amazon Full-Time OA Problems, Recent Reports (Part 4 of 5)
See Amazon hiring insights
Saved
class Solution {
    public String[] signInPages(String[] requests) {
        // write your code here
    }

}
Checking account…