MCQ( 20 qns includes Quants, logical, histogram, Maths(log))
Problem solving:
1) Race Winner Problem(Greedy)
You are given an integer n representing the number of racers and an array a[] where a[i] is the current score of the i-th racer.
In a final race:
The 1st place finisher gets n points
2nd place gets n-1 points
…
Last place gets 1 point
Each racer can finish in any position.
Question:
How many racers can still win (i.e., can end up with the highest total score after the final race)?
2) SQL Query Problem
You are given a table Project and Dept with the following columns:
dept
rating
date (format: MM/DD/YYYY)
Question:
Write an SQL query (in SQLite) to retrieve all departments that did not have any project with rating = 4 between the years 2012 and 2015 (inclusive).
3) Pretty Pair of Quadruplets(DP)
You are given two arrays A[] and B[], each of size N.
A quadruplet of indices (i1, j1, k1, l1) from array A and (i2, j2, k2, l2) from array B is called a pretty pair of quadruplets if:
1 ≤ i1 < j1 < k1 < l1 ≤ N
1 ≤ i2 < j2 < k2 < l2 ≤ N
A[i1] = B[i2]
A[j1] = B[j2]
A[k1] = B[k2]
A[l1] = B[l2]
Question:
Find the total number of possible pretty pairs of quadruplets.
4. Remove duplicates using numpy or pandas (ML no java or any other lang allowed)