Sei sulla pagina 1di 18

C ques was on pointers & arrays, Macros,Scope of variables.

Plz read probability


also.(Throwing dice & coins , cards Plz note, they will also collect your rough sheet
along wih answer sheet & i think it's also some strategy.

2nd test was on programming 2 programs have to be wrtitten 1) Binary Tree Sort (assume
tree is there & use 'inorder' traversal. ) 2)Finding element in array (Use Binary search if
given array is 'sorted') They focus on complxity also.

1St TI
Asked all basic of DS , focus was on Link list ,trees.& OOPs concept.

2nd TI
They ask to write programs for linklist,quicksort, e.t.c.

HR
Be prepared with all of DS & sorting algos. They love linklist.

15 questions on aptitude
LR, percentages, age problems,Ratio proportion

15 Questions on C
give the output, what is the error, some had abcde and some had abcd options only

10Questions on Data Structures


Complexity, Better sorting techniques,etc

5 Question on OS.
Unix, paging, segmentation.

2nd Round:-
Selected =22
Write a C Program
1) An Array to be passed to a function and check some condition and print. <--- SO
pointers are considered

2)Datastructure BTREE pre-order and its traversal and checking if itis palindrome.

3rd round
Interview : In the nagpur Persistent campus............. results yet to be out ...... I think five
would be selected
Persistent is a 11th fastest growing company , so if you want to learn while you earn go
for it Package provided was 2.6+

Test 1 -- consists of only technicalobjective questions, It has six sections & each have 5
Qns.
The sections are --
1. C Programming
2. Theory
3. Genera
4. OS
5. Database
6. Data Structures

1st SECTION(Data structures and Alogorithm.)

1)From the following when 43 will not be found by binary search (a series was given
with last element 43 in each)

2)On which maximum operations cannot be performed .if we want to use abstract data
type.

a)Array
b)Hash Table
c)Linked List
d)Heap
e)Binary Tree
3)A hash table has a size of 11 and data filled in its position like{3,5,7,9,6}how many
comparisons have to be made if data is not found in the list in worst case
a) 2
b) 6
c) 11
d)
ANS:- 2

4)Forest with n Trees and having p edges then


a)n(1-p)
b) n = p +2
c) n-p+1
d)
e)

5)Find the shortest path from B to E


ANS: 7
one Question on Postfix.

2ndSECTION (C LANGAUGE)

1) what is int(*(*ptr (int))(void)


a)Pointer to function with no arguments(void) and return pointer to integer.
b)----
c)

2)func(char *s1,char * s2)


{
char *t;
t=s1;
s1=s2;
s2=t;
}
void main()
{
char *s1=?jack?, *s2=?jill?;
func(s1,s2);
printf(?%s %s ?,s1,s2);
}

OUTPUT jack jill

3) void main()
{
int a[5] ={1,2,3,4,5},i,j=2,b;
for (i =0;i<5;i++ )
func(j,a[i]);
for (i =0;i<5;i++ )
printf(?%d?,a[i]);
}
func(int j,int *a)
{
j=j+1;
a=a+j;
b= b+2;
}
OUTPUT: 12345
4) void main()
{
for (a=1;a<=100;a++)
for(b=a;b<=100;b++)
foo();
}
foo()
{}
how many times foo will be called.
a) 5050
b) 1010
c)
d)
ANS: 5050

5)A tree was given with nodes assigned clours red, blue, yellow, green and more that one
node is having colour red.They have asked that how many times the output will be red
if the total number of evaluation is 11.
some code was given--I don't remember that.

3rd Section(O.S)

1) If there are n proceses and each process waits p time in waiting state then cpu
utilization is-:
a) n(1-p)
b) n*p

2)No. of pages are given and using LRU algorithm we have to find the number of page
faults.
a)2
b)6
c)5
d)7

3)There is a file server which provides locking for mutual exclusion . if any procees locks
the file and abruptly terminated this will result in indefinitely locking .The solution they
found is to implement a timer for locking of file i.e. if time outs then server assumes that
file is indefinitely locked and terminate the process ?
a) this solution is perfect for mutual exclausion
b) this will solve indefinite locking
c) this will result in interleaving of file between processes
d) will allow the concurrent process to access the file.

4)A critical Section is


a)for mutual exclusion
b)a set of shared resources
c)
d)

5)Match the following.

1)Critical Section a)Mutual exclusion


2)Wait/signal b)Deadlock
3)Working set c)Hoare's Monitor
4)Semaphore d)

4th Section(TOC)

1)output for the diagram one diagram of AC was given

a.odd number of a
b.even numbers of a
c.even number of b.
d odd number b

CFG was given


S -> 1 S 1
S-> 0 S 0
S -> 1 1
S -> 0 0
Find out the string
3)

5th section General

1)Probability to find digits which not contain 7 between 100 to 999


Ans=18/25

2)Difference between Packet switching & Circuit Switching.


Ans= CS take more time to established circuit.

3)in cache memory 100ns an in main memory 200ns what is the cache hit ratio.what %
should be cache memory so that not more than 20 % is main memory accessed.

a.90%
b.95%
c.98%
d80%

4)From the set {a,b,c,d,e,f} find no. of arrangements for 3 alphabets with no data
repeated.
ANS=360. OR for 4 alpha ANS=720.
5)

6th section (DBMS)

1)employee(eno,ename)
works_on(eno,pno,ename)
project(pno, project)
select ename from employee where eno in(select eno from works_on where pno =(select
*from project)
what is the output ?
a)Employee who works on all project.
b)Employee who works one project .
c) name of employee who works on more than one project.
d)

2)Select ename from employee where salary = salary

3)what is the use of B-tree


a) has fixed index file size
b) is better for queries like < <= > >=
c) searching will be easy
d)

4)Question on inner Join returning N- tuples & Full outer Join returns M- tuples. For both
Variables are given & in options relationship is given to find whichever have greater
tuples.And variable D is given------
a)then N= M
b) N = M + D
c)
d)

5) To save space which option is better


a) write all join operation then select then project
b) write all join operation then projects then select
c)write all join operation then select between project

Test 2- Consist of Two Questions. In this we have to make a C program.

Q.1)
Inward-spiral order matrix.
i.e you have to traverse the matrix in clockwise manner and display the elements,
for eg.
1 2 5 4
8 9 7 1
9 7 6 3
2 3 5 8

output should be 1, 2, 5, 4, 1, 3, 8, 5, 3, 2, 9, 8, 9, 7, 6, 7

Q.2)
consider a two dimensional array A[N][N] of the order n x n.Then you find the sub-
squares and display the largest sum of the sub-square.Sub- squares are the contigious
elements in the array.Largest sum can be find out by summing the elements in the sub-
square.

Occurrence of letters in String. Get string from KB of any length & print letters coming
maximum time first than second largest….. i.e in descending order.
Their requirement: They want that u make this program thru linked list if u do that than it
is well n good. Must allocate memory dynamically. Use proper assumptions & Comments
everywhere this will add more advantage .use in all programs.
Output look like if u enter string aababbbcba
b 5 times
a 4 times
c 1 times just like that
Hint: Make array of 256 chars. Now Scan the string pick each char and according to it’s
acsii value increment that index value at last u have an array which have counter for each
alphabet. Sort this array & display.

Sparse Matrix Addition.


A structure of sparse matrix is given. You have to create a function sparseadd to add 2
sparse matrices
Structure is some how like
Struct Sparsematrix
{
int row ;
int col ;
int val;
SparseMatrix *next;
}
You have to made function to add two sparse matrices.
Function signature like
SparseMatrix SparseAdd(SparseMatrix s1,SparseMatrix s2)

Interview Questions

Prepare DS,DBMS,OS,TOC thoroughly may ask abt anyone everything .

Reversing a linked list.

How u make database for windows directory structure or any OS.


Hint: using trees & field parent of which points to parent.

Make Program (Logic) to find word in Dictionary.


Hint: using Hash Table.

Make logic of sorting which is not given in books. Make ur own.

win NT architecture given in galwin book in end.

File system FAT, NTFS etc.

Prepare your project & CV Thoroughly.

They ask to make a Joke.

Tcp/ip.

Whatever they presented in PPT watch it carefully(Most Important)

If there r n proceses and each process waits p time in waiting state then cpu utilization is-:
a) n(1-p)
b) n*p

A string of pages were given and no of page faults have to be found in LRU algorithm
here is a file server which provides locking for mutual exclusion . if any procees locks the
file and abruptly terminated this will result in indefinitely locking .The solution they
found is to implement a timer for locking of file i.e. if time outs then server assumes that
file is indefinitely locked and terminate the process –
a) this solution is perfect for mutual exclausion
b) this will solve indefinite locking
c) this will result in interleaving of file between processes
d)

A critical section is –
ans a set of instruction which is shared by many proceeses

There was a question on automata ans – the resultant string will have even no of c

CFG was given


S -> 1 S 1
S-> 0 S 0
S -> 1 1
S -> 0 0
Find out the string

One singly circular ordered list is there if M elements are ti be inserted what will be the
complexity of time
a) O(M*N)
b) O(M*(M+N))
c) O ((M+N) * log(M+N))
d)

find postfix and prefix of


A+B*(C+D )/ E+F

Find out shortest path from A to B


ABCDE
A0m
Bm022m
C05
D06
E0

From the following when 43 will not be found by binary search (a series was given with
last element 43 in each)

From 100 – 999 find the prob. Of getting 3 digit no with no 7 in any of its digit
a) 18/25
b) 10/25
c) 729/1000
d)

from the set {a,b,c,d,e,f} find no of arrangements for 3 alphabet with no data repeated

To save space which option is better


a) write all join operation than select than project
b) ---------,,------------------than project----select
c) ----------,,-----------------in b/w select and project

Employee = { e_no , salary, fname, lname}


Works_On = {e_no, p_no, hrs}
Project = {p_no, p_name}

select e_no from Employee where salary = salary


a) query invalid
b)

Select fname ,lname from Employee where e_no in (select e_no from works_on where
p_no =(select * from project))
a) name of Employee who works on all project
b)
c)
d)

B tree is different from other


a) has fixed index file size
b) is better for queries like < <= > >=
c) searching will be easy
d)

func(char *s1,char * s2)


{
char *t;
t=s1;
s1=s2;
s2=t;
}
void main()
{
char *s1=”jack”, *s2=”jill”;
func(s1,s2);
printf(“%s %s ”,s1,s2);
}
OUTPUT jack jill
void main()
{
int a[5] ={1,2,3,4,5},i,j=2;
for (i =0;i<5;i++ )
func(j,a[i]);
for (i =0;i<5;i++ )
printf(“%d”,a[i]);
}
func(int j,int *a)
{
j=j+1;
a=a+j;
}

oid main()
{
for (a=1;a<=100;a++)
for(b=a;b<=100;b++)
foo();
}
foo()
{}
how many times foo will be called.
a) 5050
b) 1010
c)
d)

A hash table has a sie of 11 and data filled in its position like{3,5,7,9,6}how many
comparisons have to be made if data is not found in the list in worst case
a) 2
b) 6
c) 11
d)

packet switching is better than circuit switching coz


a) it takes less time
b) it takes less bandwidth
c)
d)

addition of two sparse matrix in 3 tuple notation ---time 30 min


24a tree has 1000000 nodes than how many search r required to search a node
a) 25
b)
c)
d)

A prgrm to arrange a string in order of occurrence of the character

Computer Algorithms
1. Time Complexity
2. Which of the following cannot be implemented
efficiently in Linear Linked
List
1. Quicksort
2. Radix Sort
3. Polynomials
4. Insertion Sort
5. Binary Search
3. In binary search tree , n=nodes, h=height of tree.
What's complexity?
1. o(h)
2. o(n*h)
3. o(nLogn)
4. o(n*n)
5. None
4.
5.

C Programs
1. Printf("%d%d",i++,i++);
1. Compiler Dependent
2. 4 4
3. 4 3
4. 3 4
5. None of Above
2. void main()
{
printf("persistent");
main();
}
1. Till stack overflows
2. Infinite
3. 65535
4. 34423
5. None
3. Swapping
4. what does it do?
void f(int n)
{
if(n>0)
{
if(A[i]>A[j])
swap();
}
else
f(n-1);
}
1. Swap
2. Sort in Ascending order
3. Sort in Descending order
4. Computes permutation
5.
5. Given a Fibonacci function
f1=1;f2=1
fn=f(n-1)+f(n-2) which of the following is true?
1. Every Second element is even
2. Every third element is odd
3. The series increases monotonally
4. For n>2, fn=ceiling(1.6 * f(n-1))
5. None

Operating System
1. Where the root dir should be located
1. Anywhere on System disk
2. Anywhere on Disk'
3. In Main memory
4. At a fixed location on Disk
5. At fixed location on System Disk
2. Problem on Concurrency
3. Problem on Round Robin Algorithm
4.
5.

General
1. If x is odd, in which of the following y must be
even
1. X+Y=5
2. 2(X+Y)=7
3. 2X + Y =6
4. X+2Y=7
5.
2. 1000! How many digits? What is the most significant
and Least significant

digit
3.
4.
5.

Theory
1. If a production is given
S -> 1S1
0S0
00
11
Then which of the following is invalid
1. 00101010100
2.
3.
4.
5.
2. Context free grammar cannot recognize
1. if-then-else
2. var
3. loops
4. syntax
5. None
3.
4.
5.

DBMS
1. If table A has m rows and table B has n rows then
how many rows will the
following query return
SELECT A.A1,B.B1
FROM A,B
WHERE A.A3=B.B3
1. <=(m*n)
2. m*n
3. <=(m+n)
4. >=(m+n) and <=(m*n)
5. m+n
2. A Query optimizer optimizes according to which of
the following criteria
1. Execution time
2. Disk access
3. CPU usage
4. Communication time
5. None
3. Which of the following is not a characteristic of a
transaction
1. Atomicity
2. Consistency
3. Normalization
4. Isolation
5. Durability
4. The def. of Foreign key is there to support
1. Referential integrity
2. Constraint
3.
4.
5. None
5. Problem
Process A Process B
WRITELOCK(X) WRITELOCK(Y)
READ(X) READ(Y)
... ...
1. The problem is serializable
2. The problem is not serializable
3. It can be run in parallel
4.
5. None

PROGRAMMING SECTION (This consisted of Two programs to be solved in


1 hour.)

A sparse matrix is a matrix in which a node with val=0 is not represented. The whole
matrix is represented by a Linked list where node typedef struct Node
{
int row;
int col;
int value;
sparsematrix next;
} Element, *sparsematrix;
The problem is, if there are two matrix given suppose m1 and m2, then add them and
return the resultant sparsematrix.
If suppose there are N functions say from 0,1,2,... N-1 and it's given that A[i][j]=1 if the
function i contains a call to
func. j otherwise A[i][j]=0, then write a function that will form groups of related
functions and print them line by line and at the end print the number of total groups

THERE ARE TWO ROUND OF WRITTEN.

IN THE 1ST ROUND it was objective which consists of 6 sections AND EACH
SECTION HAS 5 QS. Duration 1hour

1ST SECTION:( DATA STRUCTURE)

1. question from binary search tree ans(250)


2.
3. hash table problem ans(5)
4. adjacent matrix to calculate shortest path ans(7)
5.

2ndSECTION (C LANGAUGE)

1 what is int(*(*ptr (int))(void)


2. recursion to find the value of GET(I don't remaember the digit but it is 2 arguments
(ans 6)
3.
4 recursion function to calculate fun(4,9)( ans e)
5 problem from strcmp

3rd SECTION(O.S)

1.
2 string reference is given calculate the page fault based on LRU (ans:3 or 6)
3cache hit ratio numerical (ans 98%)
4 ans 360 (but I am not sure)
5

4TH SECTION(DBMS)

1. query is given based on table employ(eno,name,salary..),workl(eno,.),project(pno,..)


select eno from employ where eno in(select eno from workl groupby eno where
count(*)=(select count(*) from project))
2.select eno from emply where salary=salary
3.which is not required in trascation
options are (a).atomicity (b)isolation (c)normalization (d)concerrancy
4.
5

5TH SECTION(TOC)

1. one transtion state is given identify the grammer it accept


1
2. 0
0 1 1,0
option are( a) (10)* (b) string starting from 1 (c) ) string starting from 0
(d) 1*0*

2.totolagy ans(b)
3
4
5 S->1S1
S->00
S->11
S->0S0
Option are (a) 00100100 {b) 110010001(c) I don't remember

6th SECTION (GENERAL COMPUTER)

1
2. difference between packet swiching and circuit swiching
3. what is the probiblity of the occurance of 7 beetween 0 and 999 ans(18/25)
4. ans (360)
5. ans (37000)

SECOND ROUND (OF 1HOUR) (VERY VERY TOUGH)

TWO C PROGRAMS ARE GIVEN

Q1. U have to write the function for matrix addition using link list.
It is called "sparse matrix" .The structure for the element is as follows.

Typedef struct element{


Int row;
Int column;
Int value;
Element * next;
}element,sparsematrin*;

If value contains zero then there should not be node assign for that.U have to also check
boundary condition in your program.

Function is:
SparseMatrix SmAdd(SaprseMatrix m1,SparseMatrix m2)
( Revised concept of linked list and have a look at coding..)

Q2.Problem:-

One boy has to climb steps. He can climb 1 or 2 steps at a time.


Write a function that will returns number of way a boy can climb the steps.
Int WaytoSteps(int n)
(eg:- suppose number of steps is n=4 ,the function will return 5

(one-one-one-one ,one-one-two, one-two-one-,two-one-one, two-two)


second round is vey important for getting selected.