UIPath | SDE2 | Seattle | June 2019

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2019-06-05Added By Anonymous
Source: Link

Status: 4 years experience

Position: SDE-II


Round 1 : https://leetcode.com/problems/escape-a-large-maze/


Round 2: Rank of all elements in an array

Given an array of N integers with duplicates allowed. All elements are ranked from 1 to N in ascending order if they are distinct. If there are say x repeated elements of a particular value then each element should be assigned a rank equal to the arithmetic mean of x consecutive ranks.

1Input : 20 30 10 2Output : 2.0 3.0 1.0 3 4Input : 10 12 15 12 10 25 12 5Output : 1.5, 4.0, 6.0, 4.0, 1.5, 7.0, 4.0 6 7Explanation: 810 is the smallest and there are two 10s so take the average of two consecutive ranks 1 and 2 i.e. 1.5 . 9Next smallest element is 12. since, two elements are already ranked, the next rank that can be given is 3. 10However, there are three 12's so the rank of 2 is (3+4+5) / 3 = 4. 11Next smallest element is 15. There is only one 15 so 15 gets a rank of 6 since 5 elements are ranked. 12Next element is 25 and it gets a rank of 7. 13 14Input : 1, 2, 5, 2, 1, 60, 3 15Output : 1.5, 3.5, 6.0, 3.5, 1.5, 7.0, 5.0


Round 3 : Behavioural Questions


Round 4: Design a chat server for group chat and implement API to deliver eventual consistency data model


Round 5: Relevance Score Calculator

Given an array of strings calculate the relevancy score for each pair of string in the array.

1input: {"abcd", "dab", "ba"} 2output: {2, 1, 1} 3 4Explanation: 5Compare pairs "abcd" and "dab" first in these 2 strings, maximum length of consicutive elemnts is 2 i.e ab 6note that we only want to calculate the score for consicutively matching characters so 7dab -> d, a, b, da, ab 8if we check the above substrings with the string "abcd" then "ab" is the matching substring with largest length for 9this pair so the score is 2 for the 1st pair. 10 11For "abcd" and "ba" the max score is 1 since 12ba -> b, a 13 14Similarly, for "dab" and "ba" max relevancy score is 1 as there are no 2 consicutive letters in any substrings.
Comments