19 December 2020

# If a man travels @ 10 km/hr from A to B and again @ 15 km/hr from B to A Find the average speed of man for complete journey

1. 8

2. 10

3. 12

4. 14

Avg. speed = (2×10×15)/(10+15)=(2×10×15​)/25=12 km/hr

# Technical

The command used to delete a particular column in a relation is _______.

1. Update Table

2. Truncate Column

3. Alter, Drop

4. Delete Column

# Coding Question

There are N Algorithm Experts and N-1 Software Developers. You as Project manager will exclude an Algorithm Expert and form N-1 teams each consist of a software developer and an algorithm expert such that the efficiency of the whole project is maximised, but the problem is you can't jumble the ordering as the employees won't be happy.

There is an array algoExperts[] which denotes the skill of ith algorithm expert and an array Developers[] which denotes the skill of ith software developer.

Efficency of a team is given by the product of the skill of software developer and the algorithm expert, and total efficiency is the sum of the efficiencies of N-1 teams.

`Example: Input:254 1 5 2 91 2 1 124 11Output:254`
`Explanation:Testcase 1: 2nd Algorithm Expert is excluded and the maximum efficiency will be 4*1 + 5*2 + 2*1 + 9*1 = 25.Testcase 2: 2nd Algorithm Expert is excluded and the maximum efficiency will be 4*1 = 4.`

# Solution:

`long long int project(long long int a[], long long int d[], int n){       long long int left=0,right=0,f=0;    for(int i=0;i<n-1;i++)     left+=a[i]*d[i];    long long int sum=left;    for(int i=n-1;i>=1;i--)    {        left-=(a[i-1]*d[i-1]);        right+=(a[i]*d[i-1]);        sum=max(sum,left+right);    }    return sum;    }`