Fintech Dev - Assessment Test: Duration: 60 Minutes Instructions
Fintech Dev - Assessment Test: Duration: 60 Minutes Instructions
Version 2.1
Duration: 60 minutes
Instructions:
i) This is open book test.
iv) You may want to take help of fiddles to test run your code.
Fiddles for C#, JavaScript and T-SQL can be found at link1, link2 and link3 respectively.
[To be able to see output from console.log() in JSFiddle, you may consider using the solution mentioned here]
Section 1: T-SQL
Consider a database that contains following tables.
Write a T-SQL query for a report. The query must meet the following requirements:
For example,
{3, 7}
{1, 9}
{5, 5}
Class Mine
Int l,r
while (l < r) {
if (numbers[l] + numbers[r] == sum)
Console.Writeline(numbers[l], numbers[r]);
return true;
else if (numbers [l] + numbers[r] < sum)
l++;
else // numbers[i] + numbers[j] > sum
r--;
}
return false;
console.writeline(“no pair fpund”)
static int partition(List<Int> numbers, int low, int high)
{
int pivot = numbers[high];
// index of smaller element
int i = (low - 1);
for (int j = low; j <= high - 1; j++) {
// If current element is smaller
// than or equal to pivot
if (numbers[j] <= pivot) {
i++;
int temp = numbers [i];
numbers [i] = numbers [j];
numbers [j] = temp;
}
}
int temp1 = numbers [i + 1];
numbers [i + 1] = numbers [high];
numbers [high] = temp1;
return i + 1;
}
static void sort(List<Int> numbers, int low, int high)
{
if (low < high) {
int pi = partition(numbers, low, high);
sort(numbers, low, pi - 1);
sort(numbers, pi + 1, high);
}
}
}
Section 3: JavaScript
Write a function called getClone that takes an object and creates an object copy of it but does not copy
deep property of the input object.
Example:
var cloneObj = getClone(obj); // getClone is the function which you have to write
Console.log(CloneObj == GetClone(obj))
GetClone(Obj)
Obj.foo=’Bar’;
Write a T-SQL query for a report. The query must meet the following requirements:
From dbo.orders as o