Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,452 views
in Online Assessments by Expert (46,090 points) | 1,452 views

2 Answers

0 like 0 dislike
Best answer
After completing my job hunt phase.. I would like to contribute back.
I have started writing my interview details... Hope it helps.

Online Assessment : 90mins, 3 questions
Question 1 : Write a function solution that, given a string S consisting of N letters 'a'
and/or "b' returns true when all occurrences of letter 'a' are before all
occurrences of letter "b' and returns false otherwise,
Examples:

Given S = "aabbb", the function should return true.
Given S = "ba", the function should return false
Given S = "aaa", the function should return true. Note that "b' does not
need to occur in S.
Given S = "b", the function should return true. Note that 'a' does not
need to occur in S.
Given S = "abba", the function should return false.
Write an efficient algorithm for the following assumptions:
N is an integer within the range [1..300,000];
• string S consists only of the characters 'a' and/or "b'.
by Expert (46,090 points)
0 like 0 dislike
by Expert (46,090 points)