# Rashmi Agrawal | 5.5 yrs exp - Java, Python - MySQL, Dynamodb - Able to solve ds/algo problem. - Good with db design. - Overall - 7/10 # Question 1: Find the 2nd largest number in an array. ```java= int arr[] = {8,6,5,1,3}; n=5; int max = -999, swap_index; for(int j=0;j<2;j++){ for(int i=j;i<n;i++){ if(arr[i]>max){ max = arr[i]; swap_index = i } } int temp = arr[j] arr[j]= max; arr[swap_index] = temp } return arr[1]; j = 0 i = 0 max = -999 ``` # Question 2: Find the max sum in an array. - pick ith index number, cannot pick i-1th and i+1th index number in the sum. [1, 2, 3, 4, 5] - (1, 3, 5) = 9 [1, 2,-3, 4, 5] - (2, 5) = 7 [101, 110, 13] int arr[] = { 1,2,3,4,5} n=5; max=0; for(int i=0;i<n;i++){ int sum = checkSum(arr,i,n) if(sum > max){ max = sum; } } return max; checkSum(arr,i,n){ int sum = 0; for(int j=0;j<n;j++){ sum += ((i==0 || i-1!=j) && (i==n-1 || i+1!=j)) ? arr[j] : 0; } return sum; } # Question 3: [1, 2, 3, 4, 1, 2, 1, 3, 1, 2, 3, 3] MaxWeight = 5Kg [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4] # DB design : - user service is already there. - task service. - - create a task,(subtask) descriptions, files, dates. - Assign the task to users. (many to many). - track the status of assigned task/subtask.(ENUM - pending, complete, not_started) T1, s1, s2, s3 U1, U2, U3 Task Table task_id subtask_id desc file date T1 s1 xyz T1 s2 abc T1 s3 def Assignment task_id user_id status t1 s1 U1 pending t1 s2 U1 pending t1 s3 U1 pending t1 s1 U2 pending t1 s2 U3 pending t1 s3 U3 pending