# (Paper) Sasken Computer Science Placement Questions Paper

**Sasken Computer
Science ****Placement Questions Paper**

**
Computer science**

**
1.Deadlock occur when
**
(a)Some resources are held up by some process.

(b)...

(c)...

(d)None of these

**2. A prefix expression can be equal to a postfix expression reversed only if**

(a)It is left associative

(b)It is commutative

(c)It is right associative

**3.How many lines will be printed in the following Pascal pgm [I don't remember the Pascal version,so I am giving C version]**

void print(int n)

{

if(n>0)

{

print(n-1);

printf("%d",n);//println(n) in Pascal version.

print(n-1);

}

}

(a)3

(b)7

(c)15

(d)31

**4.Maximum number of nodes in a tree with n levels.**

(a)2^(n-1)

(b)(2^n)-1

(c)2^(n-1) - 1

**5.Complete graphwith n nodes have**

(a)n-1 edges

(b)n(n-1)/2

**6.If d is the degree of a node in a graph and n is number of vertices then number of edges in that graph**

is

(a)Edi^n

(b)0.25Edi

(c)0.5Edi

**7.A grammar was given and 4 strings was given and the one which was not possible was to be chosen.**

8.A problem related to ethernet in which a station

sending a frame is of p probablity.There are m

stations to send pckts.4 option was given.It was a

mathematical kind of question related to probablity.

**9.Which of the following layer in the OSI model does error handling**

(a)Data link

(b)Network

(c)Transport

(d) a & c

**10.A network problem in which Data rate,Propagation delay,and distance was given and it was to find how many packets will be in the line.**

Choices where

(a)5000

(b)Not possible to find with given data

(c)1000

**Answers(Not very sure about all the answers)**

1.(d)

2.(b)

3.(c)

4.(b)

6.(c)

9.(d)

10.(a)

**Interview [For CS students]**

There is Tech as well as HR interview. Tech interview is the important one.

There is Tech as well as HR interview. Tech interview is the important one.

**Tech interview questions:**

They will ask about the project.They will ask general
questions about it and most probably will not go into
the implementation part of it.So one must have a
general idea about the project done.

**
Interview is mainly based on Data Structures.Some
questions are as follows:-**
- What is a tree,its application,order for
insertion,deletion and traversal with worst case
analysis.

- What is a graph,its application.

- Height of a tree

- Balanced tree and how to balance a tree

- Minimum Spanning Tree

- Dijikstra's, Prim algorithms

- Define a structure for a linked list.

- Binary search and its analysis

- Heap sort and its analysis

- What is a heap and its application

- Cache and its working

- Memory(IO mapped)

- Recursive fns and types, its adv and disadv.

- Compiler(grammar)

**C debugging questions like**

**(1)What is the problem with the following code**

int * f(int a)

{

int i;

i=a;

return(&i);

}

Ans-> We can't return address of auto variable as it is allocation is made in stack which is deallocated when the function returns.

**(2) a.h b.c c.c d.c**

int i=0 #include"a.h" #include"a.h" extern int

i;void main{.....}

| | |

b.o c.o d.o

Compilation Phase

Linked to get exe.

Will there be any problem in any phase.If yes then where and what?

In linking phase as there will be multiple declaration of i.

__You will be told to write some code like__

(1) To find string length by using recursive function.

(2) To find fibonaci series by using recursive function.

(3) To write code for malloc so that allocation may be made fastly.

(4) Write a fn prototype which return a pointer which points to an array of 10 ints.

**HR Interview**

- Introduce yourself

- Why should we take you

- What you know about Sasken and etc.