Monday, 23 November 2015

IBPS IT SO DBMS 100 MCQs

100 DBMS MCQs

Q.1 In the relational modes, cardinality is termed as:
 (A) Number of tuples.
(B) Number of attributes.
(C) Number of tables.
 (D) Number of constraints.
Ans: A

Q.2 Relational calculus is a
(A) Procedural language.
(B) Non- Procedural language.
 (C) Data definition language.
 (D) High level language.
 Ans: B

 Q.3 The view of total database content is
 (A) Conceptual view.
(B) Internal view.
(C) External view.
(D) Physical View.
 Ans: A

Q.4 Cartesian product in relational algebra is
 (A) a Unary operator.
(B) a Binary operator.
(C) a Ternary operator.
(D) not defined.
Ans: B Cartesian product in relational algebra is a binary operator. (It requires two operands. e.g., P X Q)

 Q.5 DML is provided for
(A) Description of logical structure of database.
(B) Addition of new structures in the database system.
 (C) Manipulation & processing of database.
(D) Definition of physical structure of database system.
Ans: C DML is provided for manipulation & processing of database

 Q.6 ‘AS’ clause is used in SQL for
(A) Selection operation.
 (B) Rename operation.
(C) Join operation.
 (D) Projection operation.
Ans: B ‘AS’ clause is used in SQL for rename operation. (e.g., SELECT ENO AS EMPLOYEE_NO FROM EMP)

 Q.7 ODBC stands for
 (A) Object Database Connectivity.
(B) Oral Database Connectivity.
(C) Oracle Database Connectivity.
 (D) Open Database Connectivity.
 Ans: D

Q.8 Architecture of the database can be viewed as
 (A) two levels.
(B) four levels.
(C) three levels.
(D) one level.
Ans: C

Q.9 In a relational model, relations are termed as
(A) Tuples.
 (B) Attributes
(C) Tables.
(D) Rows.
Ans:c

Q.10 The database schema is written in
 (A) HLL
 (B) DML
 (C) DDL
 (D) DCL
 Ans: C

Q.11 In the architecture of a database system external level is the
(A) physical level.
(B) logical level.
(C) conceptual level
 (D) view level.
Ans: D

 Q.12 An entity set that does not have sufficient attributes to form a primary key is a
(A) strong entity set.
 (B) weak entity set.
 (C) simple entity set.
(D) primary entity set.
 Ans: B

Q.13 In a Hierarchical model records are organized as
(A) Graph.
(B) List.
(C) Links
. (D) Tree.
Ans: D

Q.14 In an E-R diagram attributes are represented by
(A) rectangle.
 (B) square.
 (C) ellipse.
(D) triangle.
Ans: C

Q.15 In case of entity integrity, the primary key may be
(A) not Null
(B) Null
(C) both Null & not Null.
 (D) any value.
Ans: A

 Q.16 In tuple relational calculus P1 ®P2 is equivalent to
(A) ¬P1 Ú P2
 (B) P1 Ú P2
(C) P1 Ù P2
 (D) P1 Ù¬P2
Ans: A In tuple relational calculus P1 P2 is equivalent to ¬P1 Ú P2.

 Q.17 The language used in application programs to request data from the DBMS is referred to as the (A) DML
(B) DDL
 (C) VDL
(D) SDL
Ans: A

Q.18 A logical schema
(A) is the entire database.
(B) is a standard way of organizing information into accessible parts.
(C) describes how data is actually stored on disk.
(D) both (A) and (C)
Ans: A

 Q.19 Related fields in a database are grouped to form a
(A) data file.
 (B) data record.
(C) menu.
(D) bank.
Ans: B Related data fields in a database are grouped to form a data record. (A record is a collection of related fields)

 Q.20 The database environment has all of the following components except:
 (A) users
. (B) separate files
. (C) database.
 (D) database administrator.
 Ans: A

 Q.21 The language which has recently become the defacto standard for interfacing application programs with relational database system is
(A) Oracle.
(B) SQL.
 (C) DBase.
(D) 4GL.
Ans: B

Q.22 The way a particular application views the data from the database that the application uses is a (A) module.
(B) relational model.
(C) schema.
(D) sub schema.
Ans: D

Q.23 In an E-R diagram an entity set is represent by a
 (A) rectangle.
(B) ellipse.
(C) diamond box.
 (D) circle.
Ans: A

 Q.24 A report generator is used to
(A) update files.
(B) print files on paper.
(C) data entry.
 (D) delete files.
 Ans: B

 Q.25 The property / properties of a database is / are :
 (A) It is an integrated collection of logically related records.
(B) It consolidates separate files into a common pool of data records.
(C) Data stored in a database is independent of the application programs using it.
(D) All of the above.
Ans: D

Q.26 The DBMS language component which can be embedded in a program is
 (A) The data definition language (DDL).
(B) The data manipulation language (DML).
(C) The database administrator (DBA).
 (D) A query language.
 Ans: B

Q.27 A relational database developer refers to a record as
 (A) a criteria.
(B) a relation.
 (C) a tuple.
(D) an attribute.
Ans: C

Q.28 The relational model feature is that there
(A) is no need for primary key data.
(B) is much more data independence than some other database models.
(C) are explicit relationships among records.
(D) are tables with many dimensions.
 Ans: B

 Q.29 Conceptual design
 (A) is a documentation technique.
(B) needs data volume and processing frequencies to determine the size of the database.
 (C) involves modelling independent of the DBMS.
 (D) is designing the relational model
 Ans:C

Q.30 The method in which records are physically stored in a specified order according to a key field in each record is
(A) hash.
(B) direct.
(C) sequential.
(D) all of the above.
Ans: A A method in which records are physically stored in a specified order according to a key field in each record is hash. (In hash method, a hash function is performed on the key value to determine the unique physical address of the record to store or retrieve)

 Q.31 A subschema expresses
 (A) the logical view.
 (B) the physical view.
(C) the external view.
 (D) all of the above.
Ans: C A subschema expresses the external view. (External schemas are called also called as subschemas)

Q.32 Count function in SQL returns the number of
(A) values.
(B) distinct values.
 (C) groups.
(D) columns. Ans: A Count function in SQL returns the number of values. (Count function counts all the not null values in the specific column. If we want to count only distinct values than the DISTINCT keyword is also to be used)

Q.33 Which one of the following statements is false?
 (A) The data dictionary is normally maintained by the database administrator.
(B) Data elements in the database can be modified by changing the data dictionary.
 (C) The data dictionary contains the name and description of each data element.
 (D) The data dictionary is a tool used exclusively by the database administrator.
 Ans: B

Q.34 An advantage of the database management approach is
(A) data is dependent on programs.
(B) data redundancy increases.
 (C) data is integrated and can be accessed by multiple programs.
(D) none of the above.
 Ans: C

 Q.35 A DBMS query language is designed to
(A) support end users who use English-like commands.
 (B) support in the development of complex applications software.
(C) specify the structure of a database.
(D) all of the above.
Ans: D

Q.36 TrAnsaction processing is associated with everything below except
(A) producing detail, summary, or exception reports.
 (B) recording a business activity.
(C) confirming an action or triggering a response.
(D) maintaining data.
Ans: C

 Q.37 It is possible to define a schema completely using
(A) VDL and DDL.
(B) DDL and DML.
(C) SDL and DDL.
 (D) VDL and DML.
Ans: B

Q.38 The method of access which uses key trAnsformation is known as
(A) direct.
 (B) hash.
(C) random.
(D) sequential.
Ans: B

Q.39 Data independence meAns
 (A) data is defined separately and not included in programs.
(B) programs are not dependent on the physical attributes of data.
 (C) programs are not dependent on the logical attributes of data.
 (D) both (B) and (C).
 Ans: D both (B) and (C)

Q.40 The statement in SQL which allows to change the definition of a table is
(A) Alter.
(B) Update.
 (C) Create.
 (D) select.
Ans: A

Q.41 E-R model uses this symbol to represent weak entity set ?
(A) Dotted rectangle.
 (B) Diamond
 (C) Doubly outlined rectangle
(D) None of these
Ans: C

Q.42 SET concept is used in :
 (A) Network Model
 (B) Hierarchical Model
(C) Relational Model
(D) None of these
Ans: A

Q.43 Relational Algebra is
(A) Data Definition Language .
 (B) Meta Language
 (C) Procedural query Language
(D) None of the above
Ans: C

Q.44 Key to represent relationship between tables is called
(A) Primary key
 (B) Secondary Key DMBS Ojbective Type Questions - Akhil Arora for more materials visit us at www.Gr8AmbitionZ.com Gr8AmbitionZ.com
 (C) Foreign Key
(D) None of these
 Ans: C

Q.45 _______ produces the relation that has attributes of R1 and R2
(A) Cartesian product
(B) Difference
(C) Intersection
(D) Product
Ans: A

 Q.46 The file organization that provides very fast access to any arbitrary record of a file is
 (A) Ordered file
 (B) Unordered file
 (C) Hashed file
(D) B-tree
Ans: C

Q.47 DBMS helps achieve
(A) Data independence
 (B) Centralized control of data
(C) Neither (A) nor (B)
 (D) both (A) and (B)
 Ans: D

Q.48 Which of the following are the properties of entities?
(A) Groups
(B) Table
(C) Attributes
 (D) Switchboards
 Ans: C

Q.49 In a relation
(A) Ordering of rows is immaterial
(B) No two rows are identical
 (C) (A) and (B) both are true
(D) None of these.
Ans: C

Q.50 Which of the following is correct:
 (A) a SQL query automatically eliminates duplicates.
(B) SQL permits attribute names to be repeated in the same relation.
(C) a SQL query will not work if there are no indexes on the relations
 (D) None of these
Ans: D

Q.51 It is better to use files than a DBMS when there are
(A) Stringent real-time requirements.
(B) Multiple users wish to access the data.
 (C) Complex relationships among data.
(D) All of the above.
Ans: B

Q.52 The conceptual model is
(A) dependent on hardware.
(B) dependent on software.
(C) dependent on both hardware and software .
(D) independent of both hardware and software.
 Ans: D

Q.53 What is a relationship called when it is maintained between two entities?
(A) Unary
(B) Binary
 (C) Ternary
(D) Quaternary
Ans: B

Q.54 Which of the following operation is used if we are interested in only certain columns of a table? (A) PROJECTION
 (B) SELECTION
(C) UNION
(D) JOIN
Ans: A

Q.55 Which of the following is a valid SQL type?
(A) CHARACTER
(B) NUMERIC
 (C) FLOAT
(D) All of the above
 Ans: D

Q.56 The RDBMS terminology for a row is
(A) tuple.
(B) relation.
 (C) attribute.
 D) degree.
Ans: A

Q.57 Which of the following operations need the participating relations to be union compatible?
(A) UNION
(B) INTERSECTION
(C) DIFFERENCEqq
(D) All of the above
Ans: D

Q.58 The full form of DDL is
 (A Dynamic Data Language
(B) Detailed Data Language
 (C) Data Definition Language
 (D) Data Derivation Language
Ans: C

Q.59 Which of the following is an advantage of view?
(A) Data security
(B) Derived columns
(C) Hiding of complex queries
(D) All of the above
Ans: D

Q.60 Which of the following is a legal expression in SQL?
(A) SELECT NULL FROM EMPLOYEE;
(B) SELECT NAME FROM EMPLOYEE;
(C) SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL;
 (D) None of the above
Ans: B

Q.61 The users who use easy-to-use menu are called
(A) Sophisticated end users.
 (B) Naïve users.
 (C) Stand-alone users.
 (D) Casual end users.
Ans: B

Q.62 Which database level is closest to the users?
 (A) External
(B) Internal
(C) Physical
 (D) Conceptual
Ans: A

Q.63 Which are the two ways in which entities can participate in a relationship?
(A) Passive and active
(B) Total and partial
(C) Simple and Complex
 (D) All of the above
 Ans: B

Q.64 The result of the UNION operation between R1 and R2 is a relation that includes
(A) all the tuples of R1
(B) all the tuples of R2
 (C) all the tuples of R1 and R2
 (D) all the tuples of R1 and R2 which have common columns
 Ans: D

Q.65 Which of the following is a comparison operator in SQL?
 (A) =
(B) LIKE
(C) BETWEEN
 (D) All of the above
Ans: D

Q.66 A set of possible data values is called
(A) attribute.
 (B) degree.
(C) tuple.
(D) domain.
Ans: D

Q.67 Which of the operations constitute a basic set of operations for manipulating relational data? (A) Predicate calculus
 (B) Relational calculus
(C) Relational algebra
(D) None of the above
Ans:C

Q.68 Which of the following is another name for weak entity?
(A) Child
(B) Owner
(C) Dominant
(D) All of the above
 Ans: A

 Q.69 Which of the following database object does not physically exist?
(A) base table
(B) index
(C) view
 (D) none of the above
Ans: C

Q.70 NULL is
(A) the same as 0 for integer
(B) the same as blank for character
(C) the same as 0 for integer and blank for character
 (D) not a value
Ans: D

Q.71 Which of the following is record based logical model? DMBS Ojbective Type Questions - Akhil Arora for more materials visit us at www.Gr8AmbitionZ.com Gr8AmbitionZ.com
 (A) Network Model
(B) Object oriented model
(C) E-R Model
 (D) None of these
Ans: A

Q.72 A data dictionary is a special file that contains:
(A) The name of all fields in all files.
(B) The width of all fields in all files.
 (C) The data type of all fields in all files.
(D) All of the above.
Ans: D

 Q.73 A file manipulation command that extracts some of the records from a file is called
(A) SELECT
 (B) PROJECT
 (C) JOIN
(D) PRODUCT
Ans: A

 Q.74 The physical location of a record is determined by a mathematical formula that trAnsforms a file key into a record location is :
(A) B-Tree File
(B) Hashed File
(C) Indexed File
 (D) Sequential file.
 Ans: B

 Q.75 Using Relational Algebra the query that finds customers, who have a balance of over 1000 is (A) PCustomer_name(s balance >1000(Deposit))
 (B) s Customer_name(Pbalance >1000(Deposit))
 (C) PCustomer_name(s balance >1000(Borrow))
(D) s Customer_name(Pbalance >1000(Borrow))
Ans: A D

Q.76 A primary key is combined with a foreign key creates
 (A) Parent-Child relation ship between the tables that connect them.
(B) Many to many relationship between the tables that connect them.
(C) Network model between the tables that connect them.
(D) None of the above.
Ans: A

 Q.77 In E-R Diagram derived attribute are represented by
(A) Ellipse
(B) Dashed ellipse
(C) Rectangle
 (D) Triangle
 Ans B

Q.78 Cross Product is a:
 (A) Unary Operator
 (B) Ternary Operator
(C) Binary Operator
 (D) Not an operator
Ans: C

 Q.79 An instance of relational schema R (A, B, C) has distinct values of A including NULL values. Which one of the following is true?
(A) A is a candidate key
 (B) A is not a candidate key
 (C) A is a primary Key
(D) Both (A) and (C)
Ans: B

Q.80 Consider the join of a relation R with relation S. If R has m tuples and S has n tuples, then the maximum size of join is:
 (A) mn
 (B) m+n
(C) (m+n)/2
(D) 2(m+n)
Ans: A

 Q.81 The natural join is equal to :
 (A) Cartesian Product
 (B) Combination of Union and Cartesian product
(C) Combination of selection and Cartesian product
(D) Combination of projection and Cartesian product
 Ans: D

Q.82 Which one of the following is not true for a view:
(A) View is derived from other tables.
(B) View is a virtual table.
(C) A view definition is permanently stored as part of the database.
 (D) View never contains derived columns.
 Ans: C

 Q.83 A primary key if combined with a foreign key creates
(A) Parent-Child relationship between the tables that connect them.
(B) Many to many relationship between the tables that connect them.
 (C) Network model between the tables that connect them.
 (D) None of the above.
Ans: A

 Q.84 In E-R Diagram relationship type is represented by
(A) Ellipse
(B) Dashed ellipse
(C) Rectangle
 (D) Diamond
Ans: D

Q.85 Hierarchical model is also called
(A) Tree structure
(B) Plex Structure
 (C) Normalize Structure
 (D) Table Structure
Ans: A

Q.86 To delete a particular column in a relation the command used is:
(A) UPDATE
(B) DROP
(C) ALTER
(D) DELETE
Ans: C

Q.87 The ______ operator is used to compare a value to a list of literals values that have been specified.
(A) BETWEEN
(B) ANY
(C) IN
(D) ALL
 Ans: A

Q.88 A logical schema
A) is the entire database
 B) is a standard way of organizing information into a accessible part
 C) describe how data is actually stored on disk
D) none of these
Ans: D

Q.89 A B-tree of order m has maximum of _____________ children
(A) m
 (B) m+1
(C) m-1
(D) m/2
Ans: A

Q.90 _____________ function divides one numeric expression by another and returns the remainder. (A) POWER (
B) MOD
 (C) ROUND
 (D) REMAINDER
 Ans: B

 Q.91 A data manipulation command the combines the records from one or more tables is called
 (A) SELECT
 (B) PROJECT
(C) JOIN
(D) PRODUCT
 Ans: C

Q.92 In E-R diagram generalization is represented by
 (A) Ellipse
 (B) Dashed ellipse
 (C) Rectangle
 (D) Triangle
Ans: D

Q.93 _________ is a virtual table that draws its data from the result of an SQL SELECT statement. (A) View
 (B) Synonym
 (C) Sequence
 (D) TrAnsaction
 Ans: A
Q.94 The method of access which uses key trAnsformation is known as
(A) Direct
(B) Hash
 (C) Random
(D) Sequential
Ans: B

Q.95 A table joined with itself is called
(A) Join
(B) Self Join
(C) Outer Join
(D) Equi Join
 Ans: B

Q.96 _________ data type can store unstructured data
(A) RAW
 (B) CHAR
(C) NUMERIC
(D) VARCHAR
Ans: A

Q.97. Which of the following statements is not correct?
A) A primary goal of a database system is to share data with multiple users  
B) It is possible to change a method or property inherited from a higher level class
C) While companies collect data all the time, the structure of the data changes very often.   
D) In a client / server environment, data independence causes client side applications to be essentially independent of the database stored on the server side.
Ans:C
Q.98. Which of the following statements is not correct?
A) Data Normalization is the process of defining the table structure   
B) The purpose of class diagrams is to model the interrelationships between the different classes in the database   
C) Individual objects are stored as rows in a table   
D) Properties of an object are stored as columns in a table.
Ans:A
Q.99 Which of the following statements is not correct?
A) The primary key must be unique for a given table   
B) Specifying a zero (0) for the lower bound for the association multiplicity on a class diagram indicates that the item is required   
C) Specifying a one (1) for the lower bound for the association multiplicity on a class diagram indicates that the item is required   
D) Most databases allow multiple records that are identical (i.e., records that have the same values for all properties).
Ans: B
Q.100 Which of the following statements is not correct?
A) All many-to-many relationships must be converted to a set of one-to-many relationships by adding a new entity   
B) In a one-to-one relationship between two classes, the two classes are generally described by one table in relational database model   
C) Encapsulation provides some security and control features   
D) Propertiesand functions can be protected from other areas of the applications
Ans: B


Friday, 20 November 2015

IBPS IT SO-Operating System-Deadlock Recovery

Deadlock Recovery

1) A deadlock can be broken by : (choose all that apply)
a) abort one or more processes to break the circular wait
b) abort all the process in the system
c) preempt all resources from all processes
d) to preempt some resources from one or more of the
 deadlocked processes
Answer: a and d
Explanation: None.
2) The two ways of aborting processes and eliminating deadlocks are : (choose all that apply)
a) Abort all
 deadlocked processes
b) Abort all processes
c) Abort one process at a time until the deadlock cycle is eliminated
d) All of these
Answer: a and c
Explanation: None.
3) Those processes should be aborted on occurrence of a deadlock, the termination of which :
a) is more time consuming
b) incurs minimum cost
c) safety is not hampered
d) All of these
Answer: b
Explanation: None.
4) The process to be aborted is chosen on the basis of the following factors : (choose all that apply)
a) priority of the process
b) process is interactive or batch
c) how long the process has computed
d) how much more long before its completion
e) how many more resources the process needs before its completion
f) how many and what type of resources the process has used
g) how many resources are
 available in the system
h) All of these
Answer: a, b, c, d, e, f
Explanation: None.
5) Cost factors of process termination include : (choose all that apply)
a) number of resources the deadlock process is holding
b) CPU utilization at the time of deadlock
c) amount of time a
 deadlocked process has thus far consumed during its execution
d) All of the above
Answer: a and c
Explanation: None.
6) If we preempt a resource from a process, the process cannot continue with its normal execution and it must be :
a) aborted
b) rolled back
c) terminated
d) queued
Answer: b
Explanation: None.
7) To _______ to a safe state, the system needs to keep more information about the states of processes.
a) abort the process
b)
 roll back the process
c) queue the process
d) None of these
Answer: b
Explanation: None.
8) If the resources are always preempted from the same process, __________ can occur.
a) deadlock
b) system crash
c) aging
d) starvation
Answer: d
Explanation: None.
9) The solution to starvation is :
a) the number of rollbacks must be included in the cost factor
b) the number of resources must be included in resource preemption
c) resource preemption be done instead
d) All of these
Answer: a
Explanation: None.

IBPS IT SO Operating system Deadlock Detection

Deadlock Detection

1) The wait-for graph is a deadlock detection algorithm that is applicable when :
a) all resources have a single instance
b) all resources have
 multiple instances
c) both a and b
Answer: a
Explanation: None.
2) An edge from process Pi to Pj in a wait for graph indicates that :
a) Pi is waiting for Pj to release a resource that Pi needs
b) Pj is waiting for Pi to release a resource that Pj needs
c) Pi is waiting for Pj to leave the system
d) Pj is waiting for Pi to leave the system
Answer: a
Explanation: None.
3) If the wait for graph contains a cycle :
a) then a deadlock does not exist
b) then a deadlock exists
c) then the system is in a safe state
d) either b or c
Answer: b
Explanation: None.
4) If deadlocks occur frequently, the detection algorithm must be invoked ________.
a) rarely
b) frequently
c) None of these
Answer: b
Explanation: None.
5) The disadvantage of invoking the detection algorithm for every request is :
a) overhead of the detection algorithm due to consumption of memory
b) excessive time consumed in the request to be allocated memory
c) considerable overhead in computation time
d) All of these
Answer: c
Explanation: None.
6) A deadlock eventually cripples system throughput and will cause the CPU utilization to ______.
a) increase
b) drop
c) stay still
d) None of these
Answer: b
Explanation: None.
7) Every time a request for allocation cannot be granted immediately, the detection algorithm is invoked. This will help identify : (choose all that apply)
a) the set of processes that have been
 deadlocked
b) the set of processes in the deadlock queue
c) the specific process that caused the deadlock
d) All of these
Answer: a and c
Explanation: None.
8) A computer system has 6 tape drives, with ‘n’ processes competing for them. Each process may need 3 tape drives. The maximum value of ‘n’ for which the system is guaranteed to be deadlock free is :
a) 2
b) 3
c) 4
d) 1
Answer: a
Explanation: None.
9) A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units then, deadlock :
a) can never occur
b) may occur
c) has to occur
d) None of these
Answer: a
Explanation: None.
10) ‘m’ processes share ‘n’ resources of the same type. The maximum need of each process doesn’t exceed ‘n’ and the sum of all their maximum needs is always less than m+n. In this setup, deadlock :
a) can never occur
b) may occur
c) has to occur
d) None of these
Answer: a
Explanation: None.

IBPS IT SO-Operating system-Deadlock Avoidance

Deadlock Avoidance

1) Each request requires that the system consider the __________, _____________, ____________ to decide whether the current request can be satisfied or must wait to avoid a future possible deadlock. (choose three)
a) resources currently available
b) processes that have previously been in the system
c) resources currently allocated to each process
d) future requests and releases of each process
Answer: a, c and d
Explanation: None.
2) Given a priori information about the ________ number of resources of each type that maybe requested for each process, it is possible to construct an algorithm that ensures that the system will never enter a deadlock state.
a) minimum
b) average
c) maximum
d) approximate
Answer: c
Explanation: None.
3) A deadlock avoidance algorithm dynamically examines the __________, to ensure that a circular wait condition can never exist.
a) resource
 allocation state
b) system storage state
c) operating system
d) resources
Answer: a
Explanation: Resource allocation states are used to maintain the availability of the already and current available resources.
4) A state is safe, if :
a) the system does not crash due to deadlock occurrence
b) the system can allocate resources to each process in some order and still avoid a deadlock
c) the state keeps the system protected and safe
d) All of these
Answer: b
Explanation: None.
5) A system is in a safe state only if there exists a :
a) safe
 allocation
b) safe resource
c) safe sequence
d) All of these
Answer: c
Explanation: None.
6) All unsafe states are :
a) deadlocks
b) not deadlocks
c) fatal
d) None of these
Answer: b
Explanation: None.
7) A system has 12 magnetic tape drives and 3 processes : P0, P1, and P2. Process P0 requires 10 tape drives, P1 requires 4 and P2 requires 9 tape drives.
Process
P0
P1
P2
Maximum needs (process-wise : P0 through P2 top to bottom)
10
4
9
Currently allocated (process-wise)
5
2
2
Which of the following sequence is a safe sequence ?
a) P0, P1, P2
b) P1, P2, P0
c) P2, P0, P1
d) P1, P0, P2
Answer: d
Explanation: None.
8) If no cycle exists in the resource allocation graph :
a) then the system will not be in a safe state
b) then the system will be in a safe state
c) either a or b
d) None of these
Answer: b
Explanation: None.
9) The resource allocation graph is not applicable to a resource allocation system :
a) with multiple instances of each resource type
b) with a single instance of each resource type
c) Both a and b
Answer: a
Explanation: None.
10) The Banker’s algorithm is _____________ than the resource allocation graph algorithm.
a) less efficient
b) more efficient
c) None of these
Answer: a
Explanation: None.
11) The data structures available in the Banker’s algorithm are : (choose all that apply)
a) Available
b) Need
c)
 Allocation
d) Maximum
e) Minimum
f) All of these
Answer: a,b,c,d
Explanation: None.
12) The content of the matrix Need is :
a)
 Allocation – Available
b) Max – Available
c) Max –
 Allocation
d) Allocation – Max
Answer: c
Explanation: None.
13) A system with 5 processes P0 through P4 and three resource types A, B, C has A with 10 instances, B with 5 instances, and C with 7 instances. At time t0, the following snapshot has been taken :
Process
P0
P1
P2
P3
P4
Allocation (process-wise : P0 through P4 top to bottom)
A B C
0 1 0
2 0 0
3 0 2
2 1 1
0 0 2
Max (process-wise : P0 through P4 top to bottom)
A B C
7 5 3
3 2 2
9 0 2
2 2 2
4 3 3
Available
A B C
3 3 2
The sequence
 leads the system to :
a) an unsafe state
b) a safe state
c) a protected state
d) a deadlock
Answer: b
Explanation: None.

IBPS IT SO-Operating system- Deadlock Prevention

 Deadlock Prevention

1) The number of resources requested by a process :
a) must always be less than the total number of resources
 available in the system
b) must always be equal to the total number of resources
 available in the system
c) must not exceed the total number of resources
 available in the system
d) must exceed the total number of resources
 available in the system
Answer: c
Explanation: None.
2) The request and release of resources are ___________.
a) command line statements
b) interrupts
c) system calls
d)
 special programs
Answer: c
Explanation: None.
3) Multithreaded programs are :
a) lesser prone to
 deadlocks
b) more prone to deadlocks
c) not at all prone to
 deadlocks
d) None of these
Answer: b
Explanation: Multiple threads can compete for shared resources.
4) For a deadlock to arise, which of the following conditions must hold simultaneously ? ( choose all that apply )
a) Mutual exclusion
b) Starvation
c) Hold and wait
d) No preemption
e) Circular wait
Answer: a, c, d and e
Explanation: None.
5) For Mutual exclusion to prevail in the system :
a) at least one resource must be held in a non sharable mode
b) the processor must be a uniprocessor rather than a multiprocessor
c) there must be at least one resource in a sharable mode
d) All of these
Answer: a
Explanation: If another process requests that resource (non – shareable resource), the requesting process must be delayed until the resource has been released.
6) For a Hold and wait condition to prevail :
a) A process must be not be holding a resource, but waiting for one to be freed, and then request to acquire it
b) A process must be holding at least one resource and waiting to acquire additional resources that are being held by other processes
c) A process must hold at least one resource and not be waiting to acquire additional resources
d) None of these
Answer: b
Explanation: None.
7) Deadlock prevention is a set of methods :
a) to ensure that at least one of the necessary conditions cannot hold
b) to ensure that all of the necessary conditions do not hold
c) to decide if the requested resources for a process have to be given or not
d) to recover from a deadlock
Answer: a
Explanation: None.
8) For non sharable resources like a printer, mutual exclusion :
a) must exist
b) must not exist
c) may exist
d) None of these
Answer: a
Explanation: A printer cannot be simultaneously shared by several processes.
9) For sharable resources, mutual exclusion :
a) is required
b) is not required
c) None of these
Answer: b
Explanation: They do not require mutually exclusive access, and hence cannot be involved in a deadlock.
10) To ensure that the hold and wait condition never occurs in the system, it must be ensured that :
a) whenever a resource is requested by a process, it is not holding any other resources
b) each process must request and be allocated all its resources before it begins its execution
c) a process can request resources only when it has none
d) All of these
Answer: d
Explanation: c – A process may request some resources and use them. Before it can can request any additional resources, however it must release all the resources that it is currently allocated.
11) The disadvantage of a process being allocated all its resources before beginning its execution is :
a) Low CPU utilization
b) Low resource utilization
c) Very high resource utilization
d) None of these
Answer: b
Explanation: None.
12) To ensure no preemption, if a process is holding some resources and requestsanother resource that cannot be immediately allocated to it :
a) then the process waits for the resources be allocated to it
b) the process keeps sending
 requests until the resource is allocated to it
c) the process
 resumes execution without the resource being allocated to it
d) then all resources currently being held are preempted
Answer: d
Explanation: None.
13) One way to ensure that the circular wait condition never holds is to :
a) impose a total ordering of all resource types and to determine whether one precedes another in the ordering
b) to never let a process acquire resources that are held by other processes
c) to let a process wait for only one resource at a time
d) All of these
Answer: a
Explanation: None.

IBPS IT SO-Operating system-Deadlock

Deadlock

1. What is the reusable resource?
a) that can be used by one process at a time and is not depleted by that use
b) that can be used by more than one process at a time
c) that can be shared between various threads
d) none of
 the mentioned
Answer:a
Explanation:None.
2. Which of the following condition is required for deadlock to be possible?
a) mutual exclusion
b) a process may hold allocated resources while awaiting assignment of other resources
c) no resource can be forcibly removed from a process holding it
d) all of
 the mentioned
Answer:d
Explanation:None.
3. A system is in the safe state if
a) the system can allocate resources to each process in some order and still avoid a deadlock
b) there exist a safe sequence
c) both (a) and (b)
d) none of
 the mentioned
Answer:c
Explanation:None.
4. The circular wait condition can be prevented by
a) defining a linear ordering of resource types
b) using thread
c) using pipes
d) all of
 the mentioned
Answer:a
Explanation:None.
5. Which one of the following is the deadlock avoidance algorithm?
a) banker’s algorithm
b) round-robin algorithm
c) elevator algorithm
d) karn’s algorithm
Answer:a
Explanation:None.
6. What is the drawback of banker’s algorithm?
a) in advance processes rarely know that how much resource they will need
b) the number of processes changes as time progresses
c) resource once
 available can disappear
d) all of
 the mentioned
Answer:d
Explanation:None.
7. For effective operating system, when to check for deadlock?
a) every time a resource request is made
b) at fixed time intervals
c) both (a) and (b)
d) none of
 the mentioned
Answer:c
Explanation:None.
8. A problem encountered in multitasking when a process is perpetually denied necessary resources is called
a) deadlock
b) starvation
c) inversion
d) aging
Answer:b
Explanation:None.
9. Which one of the following is a visual ( mathematical ) way to determine the deadlock occurrence?
a) resource allocation graph
b) starvation graph
c) inversion graph
d) none of
 the mentioned
Answer:a
Explanation:None.
10. To avoid deadlock
a) there must be a fixed number of resources to allocate
b) resource allocation must be done only once
c) all
 deadlocked processes must be aborted
d) inversion technique can be used
Answer:a
Explanation:None.

IBPS IT SO-Operating system-Semaphores – 2

Semaphores – 2

1) What will happen if a non-recursive mutex is locked more than once ?
a) Starvation
b) Deadlock
c) Aging
d) Signaling
Answer: b
Explanation: If a thread which had already locked a mutex, tries to lock the mutex again, it will enter into the waiting list of that mutex, which results in deadlock. It is because no other thread can unlock the mutex.
2) A semaphore :
a) is a binary mutex
b) must be accessed from only one process
c) can be accessed from multiple processes
d) None of these
Answer: c
Explanation: None.
3) The two kinds of semaphores are : (choose two)
a) mutex
b) binary
c) counting
d) decimal
Answer: b and c
Explanation: None.
4) A mutex :
a) is a binary mutex
b) must be accessed from only one process
c) can be accessed from multiple processes
d) None of these
Answer: b
Explanation: None.
5) At a particular time of computation the value of a counting semaphore is 7.Then 20 P operations and 15 V operations were completed on this semaphore.The resulting value of the semaphore is : (GATE 1987)
a) 42
b) 2
c) 7
d) 12
Answer: b
Explanation: P represents Wait and V represents Signal. P operation will decrease the value by 1 everytime and V operation will increase the value by 1 everytime.
6) A binary semaphore is a semaphore with integer values : (choose two)
a) 1
b) -1
c) 0
d) 0.5
Answer: a and c
Explanation: None.
7) The following pair of processes share a common variable X :
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
Process B
int Z;
B1: Z = X+1;
B2: X = Z;
X is set to 5 before either process begins execution. As usual, statements within a process are executed sequentially, but statements in process A may execute in any order with respect to statements in process B.
i) How many different values of X are possible after both processes finish executing ?
a) two
b) three
c) four
d) eight
Answer: c
Explanation: Here are the possible ways in which statements from A and B can be interleaved.
A1 A2 B1 B2: X = 11
A1 B1 A2 B2: X = 6
A1 B1 B2 A2: X = 10
B1 A1 B2 A2: X = 10
B1 A1 A2 B2: X = 6
B1 B2 A1 A2: X = 12
ii) Suppose the programs are modified as follows to use a shared binary semaphore T :
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
signal(T);

Process B
int Z;
B1: wait(T);
B2: Z = X+1;
X = Z;
T is set to 0 before either process begins execution and, as before, X is set to 5.
Now, how many different values of X are possible after both processes finish executing ?
a) one
b) two
c) three
d) four
Answer: a
Explanation:The semaphore T ensures that all the statements from A finish execution before B begins. So now there is only one way in which statements from A and B can be interleaved:
A1 A2 B1 B2: X = 11.
8) Semaphores are mostly used to implement :
a) System calls
b) IPC mechanisms
c) System protection
d) None of these
Answer: b
Explanation: None.
9) Spinlocks are intended to provide __________ only.
a) Mutual Exclusion
b) Bounded Waiting
c) Aging
d) Progress
Answer: b
Explanation: None.