Wednesday, August 29, 2007

Interview questions ,algoritms and design thinking

Normally these Questions u can expect if u attend any TOP product MNC.

* Given an array of integers, find the indexes, the contiguous elements between which form the
largest increasing sum.

* Given two arrays which are sorted, remove all the elements from first array which appear in
second array.

* Given a binary search tree and a query x, find the node in the tree which is just less than x.

* Design a data structure to represent a table of employee records.

* Given an array of integers, find two numbers which add up to given sum.

* Write a factorial function for C math Library. Hint: Use amortized analysis

* Design question on how to extract session information from user logs

* Given a binary whose non-leaf nondes are either 'AND' or 'OR' and leaf nodes are either
'TRUE' or 'FALSE'. Given a node, find the boolean value represented by the sub-tree rooted
by that node. Write C++ code.

* Given an array of n bytes and given a pointer to the first byte, find the number of bits which
are 'SET' in the array

* Design a text editor. Design the data structures, classes etc

* Write C++ code for defining a generic Array

* Given two arrays which are sorted, the first array is long enough to hold the elements of
second array. Merge them and obtain a sorted array. TRY to do it with minumum swaps


Tele-Phone Interview Questions normally i ask.

* Write C++ code involving, inheritance, polymorphism, STL, Templates.

* Given a sorted array of integers, Write C code to find the index of the first occurrence of the
query, and also number of repetitions of the query.

* Given two light boxes, find from which floor of n storeyed building, if dropped the light box will
break.

* Difference between Hash table and binary search tree

* Design a data structure for table of employee records, so that the table is sorted frequently on
first name. How will you modify your data structure if image is one of the columns

Essential basics i expect any computer science engineer to have is on the below subjects.

* Essential C
* Binary Trees
* Tree List Recursion
* Linked List Basics
* Pointers and Memory
* Puzzles