Sunteți pe pagina 1din 11

22) Parthiv has included several classes and their objects in his project.

Now he wants to use something that will hold all these objects(of different
classes). Which of the following options provides him with the best alternate?
(a)Store them in database (b)Final Class (c)Generic Class (d)Anonymous Class

21) Suppose that a graph is represented as adjacency matrix and a BFS(Breadth First search) algorithm is modified to handle such input graphs.
Which of the following options refers to the running time of such an algorithm given that the number of vertices in the graph is V and number of
edges is E?
(a) O(V*V) (b)O(V*V+E) (c)O(E*E+V) (d)O(E*E)

if a sender sends data 10101010 and receiver receives 10010010 then what is the hamming distance between these data?
a)2
b)3
c)4
d)5
Since hamming distance between two codes in no. of bits by which the two codes differ
Hence, in this case option b) i.e 3 is correct ans.
Here the 3 bits which differ are :- 3rd ,4th and 5th(counting from left)

which of the following process is used for sending data along with the acknowledgement?
a)Automatic Repeat Request
b)Stop and wait ARQ
c)Go-Back-n-ARQ
d)Piggy Backing

which of the following options is not a user level thread?


a)POSIX Pthread
b)BeOS thread
c)Mach C-thread
d)Solaris thread

in which of the following sections when one process is executing then no other process is allowed to be executed?
a)entry section
b)remainder section
c)critical section
d)solaris temple
critical section
Here, the important point is that when one process is executing shared modifiable data in its critical section, no other process is to be allowed to
execute in its critical section. Thus, the execution of critical sections by the processes is mutually exclusive in time.

in a 32 bit m/o there are 16kB pages. What is the memory present in each page?
2 bit memory
In terms of storage,which of the following would you use to have a complexity in terms on no. of vertices and edges
1)Adjacency List
2)Incidence List
3)Adjacency MAtrix
Only 1
"""" 2
"""" 3
Both 1 and 2
"""" 2 and 3

integer(*arr1)[10]
integer(*arr2)[10]
Which stmt is true regarding above??
arr1 is pointer to an array of integers
arr2 is array of integer pointers
arr1 and arr2 both are pointers to array of integers
arr1 and arr2 both are array of integer pointers
arr1 is array of integer pointers
arr2 is pointer to an array of integers

arr1 and arr2 both are pointers to array of integers


as there is parenthesis in the declaration of that two array.absence of parenthesis would make both of them array of integer pointers.

passage
1)column major order
2)row major order
3)random fashion
in which of the the following gives number is a multidimensional array repesent memory
123
both1&2
123
which of the following gives the lower bound framing time algorithm
best case
average case
worse case
number of iteration

Ques. We have two programs.


We know that the first has a time complexity O(n2), while the second has a complexity &omega(n
2). For sufficiently large n, which of the following cannot be true?
Op 1: Both codes have same complexity
Op 2: The first code has higher time complexity than the second
Op 3: The second code has lower time complexity than the first code.
Op 4: Both codes are the same.

aparajitha wants to make a function that is not to any identifier.which of the following functions should she incorporate in her programm ?
1.friend fuction
2.null function
3.global fuction
4.anonymous fuction

Ques. How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in the opposite order?
Op 1: 1 Op 2: 10 Op 3: 50 Op 4: 20
op 4
because in selection sort we compare 0th element to all other and if it is greater then it will be exchanged. simillarly it will repeat for 1st element. so
after (n-i)iteration array will be sorted.

which of the following option is an exception to being a part of composite data type
Structure
binary search algrtm can not be directly applied to which of the followng data stctre..
a)sorted linear arry
b)sorted plain linked list
c)binary tree
d)sorted pointer arry

In demand paging scheme, let p be the probability of a page fault such that 0<=p<=1 and memory access time=ma,then What is the effective
access time?
a. (1-p)*ma+p*page fault time
b. p*ma+p*page fault time
c. (1-p)*ma+(1-p)*page fault time
d. p*ma+(1-p)*page fault time
ps-do explain the answer
when process access the memory for findoing the page
so probability for noit finding the page in memory is (1-p)
total memory access time is (1-p)*(memory access time)
tis process will be done until page is not found.
so total memory access time = {p*pagefault + (1-p)* memory access time}

there is a direct formula in operating system to find the effective access time.
EAT=P*(PAGE FAULT)+(1-P)*MEMORY ACCESS TIME
=P*PAGE FAULT+(1-P)*Ma.
so 1st one is correct option.

Which one used as gobal aparator from Fuction


1. opaarator::
2.oparator;;
3.oparator%
4.oparator !! (two bars)

Which is invalid
1.10!6
2.false && True
3. bool(x)=(bool)10
4. flat= 12.67

Q. A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.
A. default constructor
B. copy constructor
C. Both A and B
D. None of these

whats the value 1%(modulus) 160/130


1.160/130
2.1/130
3.1/160
4. 130/160
1 %160/130
ie % having higher priority compare to /
so it is calculated as (1%160)/130
so 1/130
ans : option 2

1. Preorder is

depth first order


breadth first order
topological order
linear order

A data type is stored as an 6 bit signed integer. Which of the following cannot be represented by this
data type?
Ans:32
Sol:max is 2^n - 1
so here n=6
hence 2^5-1=31

to implement virtual functions...what should be used


a) dynamic dispatching
b) static dispatching
c) static binding
d) anonymous classes

What is the term given to the variable whose scope is beyond all the scopes i.e., it can be accessed by all the scopes?
option a: Universal Variable
option b: Global Variable
option c:External Variable
option d: Auto Variable
option e: Both 2 and 3

-------------returns a value unlike ------------------option a:Procedure. Subroutine


option b:Procedure. function
option c:Function. Method
option d:Function, Procedure

-------------returns a value unlike ------------------option a:Procedure. Subroutine


option b:Procedure. function
option c:Function. Method
option d:Function, Procedure

X want to place elements of an array in heap form.on which floor of the heap will he place 6th element of array
As it has 6 elements, so index values are from 0 to 6 which are 7
floor((i 1) 2)
floor((7 1) 2)
floor 3
which is used to convert source code to target language
a) linker
b) compiler
c) executer
d) loader

max no.of comparisions in binary search


a) n
b) (n+1)/2
c) log(n)+1
d) 2^log(n)

value of key is 85,hash table size is 12.Find index of an empty hash table when linear probing is used
In linear probing------index value is given by----85%12------->1
so index =1

heap of 15 elements.heap stored in array ARR.starting


index of ARR is 1.which subarray of ARR stores leaves of
heap
a)ARR[8,15]
B)ARR[7,15]
C)ARR[10,15]
D)data insufficient
at 0th level ---- one element (root)
at 1st level ----- 2 elements
at 2nd level ---- 4 elements
at 3rd level ---- 8 elements (leaves)
total 15 elements
given root index starts with 1, so leaves index starts from 8 to 15

anu wants to make a function that is not bound to any identifier.which of the following functions should she incorporate in her program?
A) Anonymous Function
B)Friend Function
C) Null Function
D)Global Function

which of the following statements are true?


1)IPV4 addresses are 32 bit long
2)IPV5 addresses are 64 bit long
3)IPV6 is also called internet protocols next generation
4)Address Resolution protocol is used to map ipv4 address to MAC addresses

a)Both 1 and 2
b)Both 2 and 3
c)Both 1 and 4
d)1,3 and 4

GROUPA GROUPB
A.windows95 1.FAT16
B.DOS 2.Redundancy
C.RAID 3. NTFS
D.UNIX o.s 4.Time sharing
Match the given operating system terms in GroupA with their chracteristics in GroupB.
a)A-3 B-1 C-2 D-4
b)A-3 B-4 C-1 D-2
c)A-4 B-3 C-1 D-2
d)A-1 B-3 C-2 D-4
windows 95 use ntfs
dos is fat16
raid is redundancy
unix is time sharing
so ans is a

A Program P reads and Processes 1000 consecutive records from a sequential file F stored on device D without using any file system facilities.Given
the following
1)Size of each record=2800 bytes
2)Access time of D=10 ms
3)Data transfer rate of D=400*10^3 bytes/ec
4)CPU time to process each record=2 ms
What is the transfer time of each record?
a)3 ms
b)4 ms
c)7 ms
d)10 ms

1000 consecutive records than


(1000*2800*10) / (400*10^3)*2 => 7ms...ans

Which of the following statements are true?


1)An Arithmetic left shift multiplies a signed number by two
2)An Arithmetic right shift divides a signed number by two
3)Mask operation is an AND micro-operation and insert is an OR micro-operation
4)In a logical shift,the serial input to the shift is one
a)Both 1 and 2
b)Both 3 and 4
c)1,2 and 3
d)2,3 and 4

which of the following is incorrect about SQL?


1)SQL satisfies all E.F.Codd's rule.
2)Relational database management system is the basis for SQL
3)SQL stands for structured query language
4)In SQL,many tables can be grouped together to form a single database

Amit hs some knowledge about darabase normalization.He has created a table "customer",which has the following characteristics.
1)Table has transitive dependencies.
2)there are no partial dependencies in the table
3)There is no column with redundant data in the table
In which normal form is the table?
a)1NF
b)2NF
c)3NF
d)BCNF

Which of the following statements are incorrect?


a)overlapping is to use the same block of internal strorages during different stages of a program
b)Semi conductor memory is a volatile memory
c)maskable interrupt can be temprarily ignored by the system
d)Flip-Flop is not a magnetic memory

Consider the Following reference String,


4,7,0,7,1,0,1,2,1,2,7,1,2,0
Calculate the difference between the number of page faults encountered when the optimal page replacement policy is used with 4-page frame and 3
page frames respectively
a)0
b)1
c)2
d)3
Which of the following statements is/are true about unique key?
a)unique key can have null values
b)Every alternate key is a unique key
c)Every unique key is a primary key
a)FFF
b)FTT
c)TFT
d)TTF

What does isolation in Acid rules for transaction in database mean?


a)either the effects of whole transaction is reflected on database or database is rolled back to its original state
b)No transaction can interfere in the end result of another transaction
c)effects of a successful transaction must persist in a database
d)Every individual transaction must leave database in a cosistent state .maintaining the integrity of the database

Anil is designing a database of motor vehicles.It has one base entity "vehicles"which is classified into two sub-entries.2 wheeler and 4-wheeler.He
further breaks them down into more entities.what is the process being used here?
a)Generalization
b)Specialization
c)Aggregation
d)segregation

specialization is used its a top down approach of breaking down entities to more entities. the opposite is generalization where we will classify both
two wheeler and 4 wheeler as cars
ans (b)

for a relation R(A,B,C,D,E,F)given are functional dependencies on R


1)A->B
2)BC->DE
3)AE->F
which of the following functional dependencies is not true for R?
1)AC->BC
2)AC->DE
3)ACF->AEF
4)CF->DE

which of the following statements is incorrect?


a)Bridge is a combination of hardware and software to link two similar network
b)Gateway is a combination of hardware and software to link two different types of network.
c)Bridges are faster than Routers
d)Gateway operate at network and transport layer of the OSI model

A parent Process executes ------system call to create a child process


a)exce()
b)fork()
c)child()
d)create()

when byte code is interpreted, how does it get effected in contrast with compiled machine code
a)it has same running time as of machine code
b)it runs faster than machine code
c)it runs slower than machine code
d)interpretation does not make any difference in byte code running time

consider the steps given below in terms of Doubly linked lists assuming that the variables used have their usual meaning
1.assign address of new node to next pointer field of current node pointed by the last element of the existing list
2. assign NULL value to the next pointer field of the new node
3. assign the address of the new node to tail variable
4. assign value of tail variable to the previous pointer field of the new node
Arrange them in order when inserting a new node at the end of the list
1. 4,3,1,2
2. 4,3,2,1
3. 3,2,4,1
4. 3,4,2,1
4,3,1,2 is correct.
as if 3rd statement will come first then previous of new node will be holding its own address that is not correct.
Previous pointer of new node should first hold address of the last pointer that is stored in tail variable. then only new node address
will be assigned to tail variable.
so
let new Node is N
then N->Previous= tail.
tail=address of N.

Raj has a list of n numbers each of a fixed size k he sorts them using radix sort
technique. which of the following option gives the complexity of this operation?
1.
2.
3.
4.

O(n-k)
O(nk)
O(klogn)
kO(logn)

O(nk) is the worst case performance and O(n+k) is the worst case time complexity. Generally, we consider the worst case only as there is a very
less difference between the average and the best cases(in case of any sorting technique).

Yukta created an interface to use it in different parts of the program by implementing it. But she forgot to specify the access
specifier for each contained method. What will be the access specifier of the methods that will be inherited/implemented?
(a)Public (b)Private (c)Protected (d)An error will be generated

if we dont use access specifier in interface method by defult the method is public and abstract

Which of the following sorting techniques have same worst case O(nlogn)?
(a)Heap Sort (b)Quick Sort (c)Insertion Sort (d)Selection Sort E)radix sort
Ans: Heap sort
it has O(nlogn) time complexity for all cases (i.e., Best, average and worst cases)

50) Akshit has a large list of fixed length numbers. He needs to sort this list using an efficient technique. Which of the following techniques can he
use?
(a)Selection Sort (b)Radix Sort (c)Shell Sort (d)Quick Sort
THERE ARE THREE TYPE OF EFFICIENT SORTS
1.MERGE SORT
2.QUICK SORT
3.HEAP SORT
SO ANS OF QUESTION 50 IS d

53) Which of the following options refers to the best case complexity of a Binary Search algorithm while searching a list of n elements?
(a) O(n*n) (b) O(log n) (c) O(n) (d)O (1)

54) Passage:
function Fibonacci(num)

1.if ( num equals 0 )


2.then return 1
3.else if ( n equals 1 )
4.then return 1
5.else return Fibonacci(n-1) + Fibonacci(n-2)
Maya wrote the given algorithm to calculate Fibonacci series.
What is the complexity of this algorithm?
(a) O(n ) (b) O(n ) (c) O(n2) (d) O(2 )

56) What will be the input to the second pass, if the list before starting the Radix Sort is: 729, 150, 123, 931, 348, 517?
(a)150, 123, 348, 517, 729, 931
(b)150, 931, 123, 517, 348, 729
(c)517, 729, 123, 931, 348, 150
(d)123, 150, 348, 517, 729, 931

56) In the following sorting procedures, which one will be the slowest for any given array? (a)Quick sort (b)Heap sort (c)Merge Sort (d)Bubble sort

48) Ritika was asked to include concrete objects in her project. Which of the following statements clearly states about the concrete objects?
(a)All the objects created as the instance of a class
(b)Objects created using the new keyword
(c)Variables and objects that follow the concrete keyword
(d)Objects created under conditional statements

26) Which of the following sorting techniques has the worst case functioning time less than O(n*n)?
(a)Heap Sort (b)Quick Sort (c)Insertion Sort (d)Selection Sort

Piyush used a hashing function that resulted in collision. Since backtracking will take up a lot of time, he decided to use a collision resolution
technique. Which of the given techniques can he use for the same?
1. Open Addressing
2. Simulation
3. Chaining
Options:
a)Only 1
b)Only 3
c) Both 1 and 3
d) Both 2 and 3
e) Both 1 and 2

The minimal set of a super key is?


asked on 25th jan
options: candidate key, primary key, foreign key, secondary key

GATEWAY works in which layer?

Hub: Physical layer


Switch: Data link layer
Bridge: Data link layer
Router: Network layer
Gateway: Network layer
Repeaters: Physical layer

Which of the following options will help in implementing the structure of a telephone answering system where the calls are answered in the order
they are received in i.e. the call that has waited the longest is provided with highest prioroty?
1. Binary Trees
2. Heaps
3. m-way Trees

4. Binary Search Tree

What is the difference between a function and a method?


1.
2.
3.
4.

Function is a named code unlike method which is a part of an object.


Function contained in an object is called a method.
Function cannot change variables outside its scope unlike method.
There is no difference between the two.

Which of the following options give the maximum number of comparisons that can take place in a Binary Search algorithm?
1.
2.
3.
4.

n
(n+1)/2
log(n) + 1
2*log(n)

If x1(n) is O(y1(n)) and x2(n) is O(y2(n)), then which of the following options is true in context of asymptotic complexity notations?
1.
2.
3.
4.

x1(n)
x1(n)
x1(n)
x1(n)

+
+
+
+

x2(n)
x2(n)
x2(n)
x2(n)

is
is
is
is

O(min(y1(n), y2(n)))
O(max(y1(n), y2(n)))
O(y1(n)*y2(n))
O(y1(n)-y2(n))

How many pointers will have to be changed/updated if a node is deleted from a linear linked list?
opt(a) 0
opt(b) 1
opt(c) 2
opt(d) all pointers will be changed

Rachna wants to implement some router based algorithms .Which of the following data structure should she use?
option:linked list,tree,stack,queue

How is bubble sort algorithm different from modified bubble sort algorithm?
option: Former uses more spaces then the latter
b)former is comparitevely easier to implement interms of codes
c)former does not stop compairing once the array is sorted unlike the latter
d)there is no difference between two

Following statement not true in context of anonymous union datatype?


option:unioun does not have name
Not followed by declarator
defining unnamed object
defines a datatype

An array myarr with 10row and 15 column is stored in a row major fashion in the memory.Given that starting adress of myarr is 1000 and each
element size is 1,Find adress of myarr[6][11].(assume that lower bound on column and row as 1and 1 respectively)
option:1105,1060,1160,1085

for row major add[6][11]=baseaddr+element size(n(j-1)+(k-1))


base addr=1000
element size=1
n=15
j=6
k=11
therefore on putting values we get ans =1085

Q5. Any program residing in the memory contains a set of instructions that need to be executed by the computer in a sequential manner. This cycle
for every instruction is known as the instruction cycle. The cycle consists of the following steps which may or may not be the proper sequence of the
execution.
1. Fetch the operand from the memory
2. Execution
3. Fetch instruction
4. Decode the instruction

5. Result
In which of the following steps, is the Program Counter(PC) loaded with the address of the next instruction?
o 5.2
o 6.2
o7
o8
o Execution
o Fetch instruction
o Decode the instruction
o Result

how many arrays are required to implement a priority queue.??


a. 1
b. 2
c. 3
d. 4

which of the following option is generalized queue of abstract data type?


A) double ended queue b) circular queue c)single ended queue d)???

OSI - Open System Interconnection


A seven layer Model in networking

MIME: Multipurpose Internet Mail Extensions


a specification for formatting non-ASCII messages so that they can be sent over the Internet. Many e-mail clients now support MIME,

Q. Which of the following is not a type of constructor?


A. Copy constructor
B. Friend constructor
C. Default constructor
D. Parameterized constructor

Q 1: What is the correct value to return to the operating system upon the successful completion of a program?
A. -1
B. 1
C.0
D.Programs do not return a value.

(c) 0
Normal exit is generally represented by a 0 return value from main. Abnormal termination is usually signalled by a non-zero return but there is no
standard for how non-zero codes are interpreted.so answer is (c)

In which of the following scheduling policies does context switching never take
place?
A) Round-robin
B) Shortest job first
C) Pre-emptive
D) All of the above

Q1. Tushar was studying about the network topology of his company. He asked one of his colleagues to guess the right topology on
the following clues: 1. The topology used is point to point configured. 2. The topology provides fault isolation property. 3. If one link
becomes unusable, then whole system is not incapacitated
Its Mesh Topology...
Its point to point configured
If one link becomes unusable,the whole system is not incapacitated
It supports fault identification nd fault isolation property

24)which of the following statements is/are true


a)string literals can be extended to more than a single line of code by putting a backslash sign at end of each unfinished line
b)string literals concatenate several strings constants,separating them by one or several blank spaces,tabulators,newline or any other valid blank
character

c)if the string literal is expilictly made of wide character,it can be preceded with the constant with the L prefix
d)all the above

22)which requesting for multiple datum,which of the following can work as a separator?
a) A space b) a tab charcter c) a new line character d) all of the above
Which of the following is not a valid type of polymorphism?
a) adhoc polymorphism
b)imperative polymorphism
c) predictattive polymorphism
d) inclusion polymorphism

Each bucket in a hash table is the head of


a. Heap
b. Stack
c. Array
d. Queue
f. Linked List

Q)what is the name given to the function which has no memory or I/O side effects?
a)pure function
b)subroutine
c)procedure
d)method

which of the following statement is not true about tagged union???


a)it is known as variant.
b)Only one data type is used at a time.
c)it holds value of a variable sized different data types.
d)the tag field determines which datatype is being currently used.

S-ar putea să vă placă și