You are on page 1of 2

It consisted of 52 questions, 50MCQs, and 2 coding questions. It consisted of 4 sections.

1. Aptitude 20 questions (30 minutes)


2. Verbal ability 10 questions(10 minutes)
3. Technical 20 questions (30 minutes)
4. Coding 2 questions(50 minutes)

● Given a 2-D matrix of size mxn. If (m+n) is even then return the sum of all elements
arr[i][j] such that (i+j) is even otherwise return the sum of all elements arr[i][j] such that
(i+j) is odd.
● It was a variation of the question:
https://www.geeksforgeeks.org/maximum-sum-such-that-no-two-elements-are-adjacent/
● Given an array of integers, return an array such that arr[i] contains the product of all
elements except the element at that position without using division.
https://www.geeksforgeeks.org/a-product-array-puzzle/
● Given a binary tree, perform the zig-zag traversal.
● Given a sorted array of integers and an element x, find the correct position where x
should be inserted.

The questions were about the OSI layer model, different protocols. He also asked me questions
on Operating systems(deadlocks, semaphores, critical section), DBMS(subqueries, joins, and
normalization), and Data Structures and Algorithms

● Given two functions f1 and f2. f1 accepts an infinite number of integers and at any
moment of time calls f2. f2 must create a data structure and return the kth maximum of
all the numbers. The value of k is revealed in f2.
● He then modified the condition to check if an integer had already been entered in f1.
Then he modified it such that we wanted to know the frequency of occurrence of any
element.

● (Easy) Given a string, return the k’th element in the string after it is lexicologically sorted.
And also find the number of times that element is repeated in the string
● (Medium) A person wants to buy ‘N’ pens. There are ‘M’ shops, where each shop has ‘n’
pens in stock, each pen costs ‘p’ and the delivery cost is ‘d’. Find the minimum cost to
buy N pens.
● Given 3 points on a 2-D plane, check if the three points are collinear. This was a pretty
straight forward question and can be solved with O(1) time complexity.
● Given a number ‘n’, get the first ‘n’ numbers in the Fibonacci series, and return the sum
of all the numbers in the prime number indices of the series.
● Given a binary tree, find the sum of all leaf nodes.
● Given an array of integers, find the longest subarray whose sum is zero. This was a
dynamic programming question that could be solved with space complexity of O(n) and
time complexity of O(n).
DBMS(subqueries, joins, and normalization), CN(routing algorithms), OS(deadlocks and
semaphores), DSA(binary trees, heaps).

1. Given an array of integers that represent the stock price of a commodity, find the days on
which a person should buy and sell stock to maximize the profit. This was again a
dynamic programming question that could be solved with time complexity of O(n) and
space complexity of O(n).
2. Given a binary search tree, print the right view. I was asked to cover all edge cases and
optimize the code. This was done with the time complexity of O(n).

You might also like