Panda Guru LogoPanda
Guru

Amazon Online Assessment Questions | SDE 1

Round 1

Questions: Problem 1:
image

Problem 2:
image
Problem statement:
The problem requires identifying the length of the longest self-sufficient substring in a given string S with size n consisting of lowercase letters. Find the longest self-sufficient substring.

Definition of a self-sufficient substring:

Constraints: 1 <= n <= 1e5
Output: The length of the longest self-sufficient proper substring. If no such substring exists, return 0.

Example:
S = "amazonservices"
O/p = 11 as "zonservices" is substring of maximum length which satisfy the condition.

Valid substrings are:
"amazon", "services", "ama", "ervice"
Invalid substrings are:
"amazonservices", "amazonservice", "amazons"

You can share your approaches.
Cheers!!

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.