Quantitative research associate Interview Questions | Glassdoor.co.in

Quantitative research associate Interview Questions


quantitative research associate interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Minimize the number of comparisons for finding minimum and maximum of a given set of numbers.

6 Answers

Given n numbers, the optimal number of comparison should be 3n/2 Pairwise compare all numbers = n/2 comparisons It is easy to see that the max, min lies among the n/2 elements which are greater, smaller respectively. Pairwise compare the n/2 greater elements = n/4 comparisons. Again pairwise compare the n/4 greater elements obtained in previous step = n/8 comparions. ... You get max(min) in n/4+n/8+...1 = n/2 comparisons. initial comparisons = n/2 comparisons to get max number = n/2 comparisons to get min number = n/2 Total = 3n/2

Here is matlab code according to the suggested algorithm : clear; clc; vec=[3,8,7,2,1,6,5,4]; [max12,min12]=max_min(vec(1),vec(2)); [max34,min34]=max_min(vec(3),vec(4)); [max56,min56]=max_min(vec(5),vec(6)); [max78,min78]=max_min(vec(7),vec(8)); [max1234,~]=max_min(max12,max34); [max5678,~]=max_min(max56,max78); [max12345678,~]=max_min(max1234,max5678); fprintf('max=%d\n',max12345678); % Find Min [~,min1234]=max_min(min12,min34); [~,min5678]=max_min(min56,min78); [~,min12345678]=max_min(min1234,min5678); fprintf('min=%d\n',min12345678);

More on the above analytic solution: The resulting sequence is geometric with missing first two terms, n + n/2. Sum of a geometric sequence n + n/2 + n/4 + ... + 1 = 2n So for the present sequence: sum = 2n - n - n/2 = n/2 Thus the minimum number of steps required for finding BOTH the minimum and maximum of the set of numeric values is 3n/2. However, to calculate only minimum or maximum, the minimum number of steps would be (n-1) by pairwise comparison.

How to find a loop in a linked list?

1 Answer

Salary expectation and When I can join?

1 Answer

Technology questions, market analysis etc.

1 Answer

Fundamental research questions

1 Answer

Tell me about what you have worked on?

1 Answer

Two questions in each probability, puzzles and coding.