Professional Documents
Culture Documents
Pradipto Chatterjee
DSA Questions
Pre-assessment Test
Instructions: Use your favourite programming language to implement the following
questions. You can take user input or initialize the data structures directly in your program. Your
task in to implement the logic to solve the following problems.
1. Given an array of integers (A[]) and a number x, find the smallest subarray with
sum greater than the given value.
3. Given three integers 'A' denoting the first term of an arithmetic sequence , 'C'
denoting the common difference of an arithmetic sequence and an integer 'B'.
you need to tell whether 'B' exists in the arithmetic sequence or not.
8. The problem is to print all the possible paths from top left to bottom right of a
mXn matrix with the constraints that from each cell you can either move only to
right or down.
9. Equilibrium index of an array is an index such that the sum of elements at lower
indexes is equal to the sum of elements at higher indexes.
Write a function int equilibrium(int[] arr, int n) that given a sequence arr[] of
size n, returns an equilibrium index (if any) or -1 if no equilibrium indexes exist.
For example, in an array A:
Li-Mat Soft Solutions Pvt. Ltd. Pradipto Chatterjee
10. There is a given array and split it from a specified position, and move the first
splitted part of the array and then add to the end of array.