Round 1: Online assessment, 2 medium level questions on Codility.
Round 2:
Q1: Given "n" objects having structure,
{
emailId: string
firstName: string,
middleName: string,
lastName: string,
teelphone: string,
address: string
}
for e.g.
x = {
emailId: abc@xyz.com
firstName: Ramesh,
middleName: Kumar,
lastName: Sharma,
teelphone: ,
address:
}
y = {
emailId: abc@xyz.com
firstName: Ramesh Kumar,
middleName: ,
lastName: Sharma,
teelphone: 123456789,
address:
}
z = {
emailId: abc@xyz.com
firstName: Ramesh Kumar Sharma,
middleName: ,
lastName: ,
teelphone: ,
address: xyz street, abc City
}
write an algorithm to merge the records, where emailId can be used as unique identifier and you need to merge other attributes.
For above input, output will be something like:
o/p = {
emailId: abc@xyz.com
firstName: Ramesh,
middleName: Kumar,
lastName: Sharma,
teelphone: 123456789,
address: xyz street, abc City
}
Its not mandatory that first, middle, last names can have atmost one word, it can be more than one word as well.
Q 2: Given a list of words, and a word "x". Can you find if given word x can be formed by merging any two words for given list.
For e.g. words[] = {"abc", "xyz", "efg", huj}
x = xyzabc => output = true
x = efgabcd => output = falseRound 3:
Q1: Given schedules of n members, schedule = [startTime, endTime]. Can you find the earliest slot in the
day of "X" hrs where all members are free, if you can't find a slot return -1; You can imagine day starts at 00:00 and ends at 24:00
a = [[0:00, 1:00], [2:00, 4:00], [8:00, 12:00]]
b = [[1:00, 4:00]]
c= [5:00, 8:00]
if X = 1 hrs => ans will be [4:00, 5:00]
Follow up questions -
1) Write different test cases?
2) what if X is real, some thing like 1.5, 1.2?
3) What if all users are in different timezones?Round 4:
Q1: Given a string, can you move all vowels at start of string, numbers in the middel and cononants at the end?
Q2: https://leetcode.com/problems/valid-parenthesis-string/
Round 5:
Q1: Given different IP ranges, with owners for each range
Range - Owner
[1.1.2.3 - 1.4.5.6] - A
[2.6.7.8 - 3.4.5.6] - B
[4.5.6.99 - 10.12.3.5] - C
.
.
.
.
[253.12.12.4 - 255.255.255.255] - Z
Now, given an IP address can you find who is the owner of that IP.
For e.x -> 1.1.3.4 => A