Meta | London | Phone Screening April 2022
Anonymous User
1600

Question 1:
In an array of elements find maximum number and return a random number if they maximum has multiple occurences.
Example:
Input: [0,-3,5,7,8,8,2,6,8}
Output: Random number with equal probability from index 4,5,8

To be done in O(n) time and O(1) space

Question 2:
Caesar Cipher Encrpytion
You are given a list of string, group them if they are same after using Ceaser Cipher Encrpytion.
Definition of "same", "abc" can right shift 1, get "bcd", here you can shift as many time as you want, the string will be considered as same.

Example:

Input: ["abc", "bcd", "acd", "dfg"]
Output: [["abc", "bcd"], ["acd", "dfg"]]

Comments (3)