Fresher Online Assessment for SWE - University role.
The online assessment had 3 questions, was for 70 min and was conducted on CodeSignal.
Needed to solve all 3 questions to advance to the next round.
- Given a number ( greater than 1 and less than 1e12 ) return the sum of it's prime factors
Example inputs :
9 = 3 * 3. So, answer is (3+3) = 6
6 = 3 * 2. So, answer is (3+2) = 5
Execution time limit : 1 sec
- Given 'n' cities and each city is connected to the other by a direct road. You are currently at your hometown. You have to wander around the city and come back in exactly 'x' trips. In one trip, you can go from the current city to any different city. Find the number of ways to travel around so that after exactly 'x' steps, you should be at your hometown city.
Example inputs :
n=3 ; x=3
possible ways :
1->2->3->1
1->3->2->1
Ans : 2 ways
- Given two list of integers 'a' and 'b' of same length 'n'. Find the count of strictly increasing sequences of integers l[0] < l[1] < .... l[n-1] so that min(a[i], b[i]) <= l[i] <= max(a[i], b[i]) for each 'i'.
Example :
a = [6,3,4,4]
b = [1,5,1,6]
4 possible solutions are there :
1, 3, 4 ,5
1, 3, 4, 6
2, 3, 4, 5
2, 3, 4, 6
Execution limit : 1 sec
len(a) , len(b) <= 100
values of a,b between 1 and 10000