Paypal OA HackerRank for SDE intern 2023
Anonymous User
875

There were 2 medium questions for 60 minutes.

Only remember the first one:

1: You are given an array of strings strArr and another array with intervals intervalArr in the format "X-Y" where X would be the starting index and Y the ending index. Output the array in which for each interval i in intervalArr, the index i in the output array has the number of strings in strArr in the interval that start and end with a vowel. Assume the intervals are always valid.

Example
Input: strArr = ['abu', 'banana', 'hah'] intervalArr = ['0-2', '1-2']
Output: [1, 0] #in interval 0-2, only 'abu' that starts and ends with a vowel

Half the test cases required you to optimize the code as they had strArr, intervalArr with size 10^5 running for less than 10sec.

Comments (4)