Wissen Infotech
Time- 1 hour 45 minutes
Platform- Hackerearth
There will be a person from wissen technology on google meet and we have to share the screen and camera should be on.
2 coding questions, 1 SQL query and 12 MCQ (including java output and aptitude)
Farthest From Zero
Given an integer array. Write a program to print the farthest element from 0. (Number with highest absolute value negative or positive) If there are multiple elements, print the number with lesser value
Example-
Input-
7
-7 -9 5 3 1 2 9
Output- -9
9
-7 -9 5 3 1 2 9 10 15
Output- 15
Median Queries
You are given an array. For a subarray of length , you have to sort the elements of the subarray in increasing order. find the median of the subarray. Consider the array to be 1 indexed
You are given two integers L and R.
You have to find the median of a subarray of the array.
Example-
Input-
7
1 2 3 4 5 6
3
1 6
2 4
5 5
Output-
3
3
5