Facebook | Phone Screen | Caesar Cipher
Anonymous User
19919

Position: SDE intern
Overall 45 minuties, 2 questions.

Question 1:
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"]]

Question 2:
Implement OrderedSet
.add(num)
.remove(num)
.toArray()
.contain(num)

Comments (8)