Rain Instant Pay - Online Test
Anonymous User
239

Location : India

Screening Test details for Rain Instant Pay

90 mins duration
total 3 tasks
Golang and SQL only lang options

Task 1 :

As part of question a faulty code of find_min in an array was given.

code (approx)

result := 0
for int i=0; i<len(A); i++ {
	if(result > A[i])
		result = A[i];
}
return result

Now as a part of task you have to write an algorithm which will generate a counter example array that will prove above code wrong. N is given as part of input to the array

For Example :

Input N=5
Output : [4,2,4,3,4]
Explanation : answer should be 2 for above array but faulty code will return ans as zero

Task 2 :

Given an array of integers, return minimum positive integer that is not present in input array. (duplicates allowed)
array elements are in range [-1000000,1000000]

For Example :

Input N=[1,4,2,1,5]
Output : 3
Explanation : smallest positive integer is 3 which is not present in array

Input N=[-100,5,2]
Output : 1

Input N=[3,2,1]
Output : 4

Task 3 :

2 relational tables were given

testgroups(name,marks) - contains test groups and marks awarded for each passing testcase of this group
testcases(id,groupname,status) - contains result of testcases executed where status can be OK or FAILURE

You have to write an SQL query which will generate output of the form
(group-name, total-testcases, passed-testcases, score)

For Example :

testgroups

namemarks
g120
g210
g315
g410

testcases

idnamestatus
1g1OK
2g2OK
3g1OK
4g3FAILURE
5g2FAILURE
6g1OK
7g1OK
8g3FAILURE
9g2OK

ans

nametatal testcasessuccess testcasesscore
g14480
g23220
g3200
g4000
Comments (0)