Question Bank For Practice-1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

QUESTION BANK for Practice

Which of the following is not a component of the database environment?

A) Users

B) Database Management System (DBMS)

C) Data

D) Software Development Life Cycle (SDLC)

In a relational database, what is a tuple?

A) A row

B) A column

C) A table

D) A primary key

What is ACID in the context of database transactions?

A) Atomicity, Consistency, Isolation, Durability

B) Association, Control, Integrity, Data

C) Access, Concurrency, Isolation, Database

D) Atomic, Correctness, Isolation, Dependency

Which normal form deals with the concept of partial dependency?

A) First Normal Form (1NF)

B) Second Normal Form (2NF)

C) Third Normal Form (3NF)

D) Boyce-Codd Normal Form (BCNF)

What is the purpose of an index in a database?

A) To store metadata

B) To enforce data integrity

C) To speed up data retrieval

D) To store large binary objects


Which type of join returns all rows from both tables, joining them where there are matching values
and including unmatched rows from one or both tables?

A) Inner join

B) Left outer join

C) Right outer join

D) Full outer join

Which SQL keyword is used to remove data from a database?

A) REMOVE

B) DELETE

C) ERASE

D) DROP

What does SQL stand for?

A) Structured Query Language

B) Standard Query Language

C) Sequential Query Language

D) Simplified Query Language

Which type of relationship between tables enforces referential integrity?

A) One-to-many

B) Many-to-one

C) One-to-one

D) Many-to-many

Which SQL command is used to retrieve data from a database?

A) GET

B) FETCH

C) SELECT

D) EXTRACT
What is a primary key in a relational database?

A) A unique identifier for each row in a table

B) A key that is used to join two tables together

C) A key that can contain duplicate values

D) A key that is used to encrypt data

Which type of database model represents data as objects, similar to object-oriented programming?

A) Hierarchical

B) Relational

C) Network

D) Object-oriented

Which SQL command is used to add a new row to a table?

A) ADD

B) INSERT

C) CREATE

D) UPDATE

Which normal form eliminates transitive dependencies?

A) First Normal Form (1NF)

B) Second Normal Form (2NF)

C) Third Normal Form (3NF)

D) Boyce-Codd Normal Form (BCNF)

Which of the following is not a type of database schema?

A) External schema

B) Conceptual schema

C) Logical schema

D) Physical schema
Which SQL clause is used to filter the results of a query based on specified conditions?

A) WHERE

B) HAVING

C) FILTER

D) CONDITION

What is the purpose of a foreign key in a relational database?

A) To ensure each row has a unique identifier

B) To enforce referential integrity between tables

C) To encrypt sensitive data

D) To perform complex calculations

Which SQL function is used to count the number of rows in a result set?

A) COUNT()

B) SUM()

C) AVG()

D) MAX()

Which normal form ensures that every non-prime attribute is fully functionally dependent on the
primary key?

A) First Normal Form (1NF)

B) Second Normal Form (2NF)

C) Third Normal Form (3NF)

D) Boyce-Codd Normal Form (BCNF)

What is the purpose of a view in a database?

A) To store temporary data

B) To create a virtual table based on the result of a SELECT query

C) To optimize data storage

D) To enforce data integrity constraints


1. In order traversal of binary search tree will produce −

a. unsorted list b. Reverse of input c.sorted list d. none of the above

2. What data structure is used for depth first traversal of a graph?

a. queue b. List c. Stack d. None of the above

3. What could be the worst case height of an AVL tree?

a. 0.97 log n b. 2.37 log n c. 1.44 log n d. None of the above

4. The Θ notation in asymptotic evaluation represents

a. worst case b. Average case c. Basr case d. None of the above

5. Which of the following is not the type of queue?

a. priority queue b. Single ended c. Circular d. ordinary

6. What will be the output of the following code snippet?

void solve() {

int a[] = {1, 2, 3, 4, 5};

int sum = 0;

for(int i = 0; i < 5; i++) {

if(i % 2 == 0) {

sum += a[i];

cout << sum << endl;

a. 1 b. 4 c. 9 d. None

7. What will the output of the following code snippet?

void solve() {
int a[] = {1, 2, 3, 4, 5};

int sum = 0;

for(int i = 0; i < 5; i++) {

if(i % 2 == 0) {

sum += *(a + i);

else {

sum -= *(a + i);

cout << sum << endl;

a. 3 b. 4 c. 5 d. None

8. What function is used to append a character at the back of a string in C++?

a. push back() b. Push c. Append d. None

9. Kruskal’s Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a?

a. D P algorithm b. Greedy Algorithm c. Adhoc Problem d. None

10. Maps in C++ are implemented using which of the following data structures?

a. hash b. Red black c. AVL d. None

11. What is the best case time complexity of the binary search algorithm?

a. O(n) b. O(1) c. O( Logn) d. None

12. What is the time complexity to insert an element to the front of a LinkedList(head pointer
given)?

a. O(n) b. O(1) c. O( Logn) d. O ( Logn*n)

13. What is the time complexity to insert an element to the rear of a LinkedList(head pointer given)?
a. O(n) b. O(1) c. O( Logn) d. O ( Logn*n)

14. Choose correct Syntax for C Arithmetic Compound Assignment Operators.

a. a+=b is (a= a+ b) a-=b is (a= a-b) b. a*=b is (a=a*b) a/=b is (a = a/b)

c. a%=b is (a=a%b) d. All the above.

15. Which of the following return-type cannot be used for a function in C?

a. Char b. Struct c. Void d. None

16. Determine the output of the C code mentioned below:

#include <stdio.h>

int main()

float q = ‘a’;

printf(“%f”, q);

return 0;

a. run time error b. a c. 97.000000 d. a.0000000

17. We cannot use the keyword ‘break’ simply within _________.

a. while b. for c. if-else d. do-while

18. The global variables are ____________.

a. External b. Internal c. Both External and Internal d. None of the above

19. Out of the following operations, which one is not possible in the case of a register variable?

a. Global declaration of the register variable

b. Copying the value from the memory variable

c. Reading any value into the register variable

d. All of the above


20. The #include <stdio.h> is a ______________.

a. Inclusion directive b. File inclusion directive

c. Preprocessor directive d. None of the above

21. Which of these properties of #define is false?

a. These always obey the scope rules b. We can make use of a pointer to #define

c. The #define can be externally available d. All of the above

22. The correct format of declaring a function is:

a. type_of_return name_of_function (argument type);

b. type_of_return name_of_function (argument type){}

c. type_of_return (argument type) name_of_function;

d. all of the above

23. Out of the following function definition, which one will run correctly?

a.int sum(int x, int y)

return (x + y);

b.int sum(int x, int y)

{return (x + y);}

c.int sum(x, y)

return (x + y);

d. none of the above

24. Comment on the C statement given below:

int (*p)[5];

a. A ragged array b. An array “p” of pointers

c. A pointer “p” to an array d. None of the above

25. The definition of the function abort() is in which header file?

a. stdlib.h b. assert.h c.stdio.h d.stdarg.h

26. What is the primary purpose of the preprocessor directive #error?


a. Rectifies the first error occuring in the code

b. Rectifies the errors present in a code

c. Causes a preprocessor to ignore any error

d. Causes a preprocessor to report some fatal error

27. What will be the output of the following C code?

#include<stdio.h>

int main()

int p = 1, q = 2, r = 3, s = 4, x;

e = r + s = q * p;

printf(“%d, %d\n”, x, s);

a. Syntax error b. 5, 2 c. 7, 2 d. 7, 4

28. We cannot use the keyword ‘break’ simply within _________.

a. while b. For c. if-else d. do-while

29. The #include <stdio.h> is a ______________.

a. Inclusion directive b. File inclusion directive

c. Preprocessor directive d. None of the above

30. Which of these properties of #define is false?

a. These always obey the scope rules b. We can make use of a pointer to #define

c. The #define can be externally available d. All of the above

31. Which of these is the correct initialization method for the following:

typedef char *string;

a. More than a single space shouldn’t be given when we are using typedef

b. *string p = ‘A’;

c. string p = “Hello”;
d. *string *p = “Hello”;

32. Which arithmetic operators can we NOT use with strings?

a. – b. + c. * d. All of the above

33. Which function do we use to shuffle a list(say list1)?

a. shuffle(list1) b. list1.shuffle()

c. random.shuffleList(list1) d. random.shuffle(list1)

34. What will be the error in the following Java code?

byte b = 50;

b = b * 50;

a. b cannot contain value 50

b. b cannot contain value 100, limited by its range

c. No error in this code

d. * operator has converted b * 50 into int, which can not be converted to byte without casting

35. Which of the following is a type of polymorphism in Java Programming?

a. Multiple polymorphism b. Compile time polymorphism

c.Multilevel polymorphism d.Execution time polymorphism

36. Automatic type conversion is possible in which of the possible cases?

a. int to long b. byte to int c. Long to int d. Short to int

37. Find the output of the following code.

int Integer = 24;

char String = ‘I’;

System.out.print(Integer);

System.out.print(String);

a. 24 I b. I c. 24 d. Compiler Error
38. Find the output of the following program.

public class Solution{

public static void main(String[] args){

short x = 10;

x = x * 5;

System.out.print(x);

a. Compiler Error b. 10 c. 5 d. Syntax Error

39. Identify the correct restriction on static methods.

1. They must access only static data

2. They can only call other static methods.

3. They cannot refer to this or super.

a. I, II and III b. III only c. II and III d. None

40. 1. Which of these components are used in a Java program for compilation, debugging, and
execution?

a. JDK b. JVM c. JRE d. JIT

1. A queue follows _________:

a. LIFO principle b. FIFO principle c. Linear tree d. Ordered array

2. The time complexity used for inserting a node in a priority queue on the basis of key is:

a. O(n) b. O(n2) c. O(nlogn) d. O(logn)

3. Which of these is a postfix expression?

a. a+b-c b. +ab c. abc*+de-+ d. a*b(c+d)

4. The members of two of the sets are relatively more common when the Jaccard Index is:
a. Closer to 0 b. Closer to 1 c. Farther to 1 d. Closer to -1

5. Which one is the most desirable out of these traits of a hash function?

a. it must cause more collisions b. it must be easy to implement

c. it must cause less collisions d. it must occupy less space

6. The swap space in a disk is primarily used for:

a. Save process data b. Save temporary HTML pages

c. Store the device drivers d. Store the super-block

7. Consider a computer system that supports 32-bit physical as well as virtual addresses. Now since
the space of the physical address is the same size as the virtual address, the OS designers would
decide to entirely get rid of its virtual memory. Which one of these is true in this case?

a. It is no longer possible to efficiently implement multi-user support

b. It is possible to make CPU scheduling more efficient now

c. There would no longer be a requirement for hardware support for memory management

d. It would be possible to make the processor cache organisation more efficient now

8. Thrashing occurs in a system when:

a. The processes on the system access pages and not memory frequently

b. A page fault pops up

c. The processes on the system are in running state

d. The processes on the system are in the waiting state

9. The page fault occurs whenever:

a. The requested page isn’t in the memory b. The requested page is in the memory

c. An exception is thrown d. The page is corrupted

10. In every entry of a page table, the essential content(s) is/are:

a. Page frame number b. Virtual page number

c. Both page frame number and virtual page number d. Accessing the right information
11. What will be the output of the following C code?

#include<stdio.h>

int main()

int p = 1, q = 2, r = 3, s = 4, x;

e = r + s = q * p;

printf(“%d, %d\n”, x, s);

a. Syntax error b. 5, 2 c. 7, 2 d. 7, 4

12. We cannot use the keyword ‘break’ simply within _________.

a. while b. For c. if-else d. do-while

13. The #include <stdio.h> is a ______________.

a. Inclusion directive b. File inclusion directive

c. Preprocessor directive d. None of the above

14. Which of these properties of #define is false?

a. These always obey the scope rules b. We can make use of a pointer to #define

c. The #define can be externally available d. All of the above

15. Which of these is the correct initialization method for the following:

typedef char *string;

a. More than a single space shouldn’t be given when we are using typedef

b. *string p = ‘A’;

c. string p = “Hello”;

d. *string *p = “Hello”;

16. Which arithmetic operators can we NOT use with strings?

a. – b. + c. * d. All of the above


17. Which function do we use to shuffle a list(say list1)?

a. shuffle(list1) b. list1.shuffle()

c. random.shuffleList(list1) d. random.shuffle(list1)

18. Which function removes a set’s first and the last element from a list?

a. pop b. Remove c. Dispose d. discard

18. The output of this Python code would be:

def find(x, **y):

print(type(y))

find(‘letters’,X=’1′,Y=’2′)

a. Dictionary b. An exception is thrown

c. String d. Tuple

19. Which one of these is NOT true about recursion?

a. We can replace a recursive function by a non-recursive function

b. The memory space taken by the recursive functions is more than that of non-recursive function

c. Running a recursive function is faster as compared to a non-recursive function

d. The process of recursion makes it easier for users to understand a program

20. Which function doesn’t accept any argument?

a. re.compile b. re.findall c. re.match d. re.purge

21. In Python, the primary use of the tell() method is that:

a. within the file, it tells the end position

b. within the file, it tells the current position

c. it tells us if the file is opened

d. none of the above

22. In the context of data warehousing, data map or ‘data about data’ is known as …………….

a. tuple b. Attribute c. Metadata d. teradata

23. Which of the following normal form deals with the anomaly of multi-value dependency?

a. 1NF b. 2NF c.4NF d. 5NF


24.…………… is a database language used to define data structures in SQL?

a.Sybase b.Oracle c.DDL d. MySQL

25. Which of the following is not the state of a transaction in the database?

a.Active b.Committed c.Terminated d. Nullified

26.The …………… file saves the recovery scenario in Quick Test Professional (QTP) environment

a. QRS b. JPE c. DOC d. TSR

27. Which of the following is not a command is SQL?

a. WHERE b.ORDER BY c.REMOVE d. SELECT

28.How should we traverse an oracle database to retrieve a row in the quickest possible time?

a. Full table scan b. Unique index c. Primary key d. Table access by row id

29. Which of the following is a concurrency control protocol?

a.Locked-based protocol b. two-phase locking protocol

c.Timestamp ordering protocol d. all

30.Which of the following statements are used to create indexes in the database?

a.CREATE INDEX b. BUILD INDEX c.WRITE INDEX d. None

31. Which of the following is a database recovery technique?

a. Check-pointing b.Transaction rollback

c. Shadow paging d. All

32.Which of the following is a foreing key constraint?

a.Referential integrity b. Domain integrity c. Entity integrity d. All

33. FTP runs exclusively over ___.

a.HTTP b.TCP c. SMTP d. HTML


34.FTP runs exclusively over ___.

a. HTTP b. TCP c.SMTP d. HTML

35.Which of the following primarily uses guided media?

a.cellular telephone system

b.local telephone system

c. satellite communications

d. radio broadcasting

36.This is the ability to increase system performance gradually as the workload grows just by adding
processors.

a. multipliability b. Inheritance c. Scalability d. vectorization

37.SMTP refers to ___.

a. Simple mail transfer protocol b. Small mail transfer protocol

c.Simple mass transfer protocol d. Small mail transfer protocol

38. A data channel contains ___.

a. control information b.management information

c.miscellaneous functions d. user data/information

39.Which layer is not really a layer?

a. Host of the network

b. Network to host

c. Application to presentation

d. None

40.The term used to describe the way in which computers are connected to the network.

a. Logic b. Technology

c.Topology d. All of the above


1. In the case of the index allocation scheme of various blocks to a file, the maximum size (possible)
of the file would depend on :

a. the total number of blocks that have been used for the index, size of all the blocks

b. the actual size of all blocks, the size of the blocks’ address

c. the of the blocks’ size, the blocks’ address size, and the total number of blocks that have been
used for the index

d. None of the above

2. The swap space in a disk is primarily used to:

a. Save process data b. Save temporary HTML pages

c. Store the device drivers d. Store the super-block

3. Out of these page replacement algorithms, which one suffers from Belady’s anomaly?

a. FIFO b.LRU c. Both LRU and FIFO d. Optimal Page Replacement

4. An increase in a computer’s RAM leads to a typical improvement in performance because:

a. Fewer page faults occur b. Virtual memory increases

c. Fewer segmentation faults occur d. A larger RAM is faster

5. Consider a computer system that supports 32-bit physical as well as virtual addresses. Now since
the space of the physical address is the same size as the virtual address, the OS designers would
decide to entirely get rid of its virtual memory. Which one of these is true in this case?

a. There would no longer be a requirement for hardware support for memory management

b. It is possible to make CPU scheduling more efficient now

c. It is no longer possible to efficiently implement multi-user support

d. It would be possible to make the processor cache organisation more efficient now

6. The Virtual memory is:

a. An illusion of a large main memory b. A large main memory

c. A large secondary memory d. None of the above


7. A CPU yields 32-bit virtual addresses, and the page size is 4 kilobytes. Here, the processor consists
of a TLB (translation lookaside buffer). It is a 4-way set associative, and it can hold a total of 128-
page table entries. The TLB tag’s minimum size is:

a. 20 bits b. 15 bits c. 13 bits d. 11 bits

8. In which of the following formats data is stored in the database management system?

a. text b. table c. Image d. Graph

9. Which of the following is a function of the DBMS?

a. Storing data b. Providing multi-users access control

c. Data Integrity d. All of the above

10. _____________ is a hardware component that is most important for the operation of a database
management system.

a. Microphone b. Printer

c. High-resolution video display d. High speed, large capacity disk to store data

11. What is the best case time complexity of the binary search algorithm?

a. O(n) b. O(1) c. O( Logn) d. None

12. What is the time complexity to insert an element to the front of a LinkedList(head pointer
given)?

a. O(n) b. O(1) c. O( Logn) d. O ( Logn*n)

13. What is the time complexity to insert an element to the rear of a LinkedList(head pointer given)?

a. O(n) b. O(1) c. O( Logn) d. O ( Logn*n)

14. Choose correct Syntax for C Arithmetic Compound Assignment Operators.

a. a+=b is (a= a+ b) a-=b is (a= a-b) b. a*=b is (a=a*b) a/=b is (a = a/b)

c. a%=b is (a=a%b) d. All the above.


15. Which of the following return-type cannot be used for a function in C?

a. Char b. Struct c. Void d. None

16. Determine the output of the C code mentioned below:

#include <stdio.h>

int main()

float q = ‘a’;

printf(“%f”, q);

return 0;

a. run time error b. a c. 97.000000 d. a.0000000

17. We cannot use the keyword ‘break’ simply within _________.

a. while b. for c. if-else d. do-while

18. The global variables are ____________.

a. External b. Internal c. Both External and Internal d. None of the above

19. Out of the following operations, which one is not possible in the case of a register variable?

a. Global declaration of the register variable

b. Copying the value from the memory variable

c. Reading any value into the register variable

d. All of the above

20. The #include <stdio.h> is a ______________.

a. Inclusion directive b. File inclusion directive

c. Preprocessor directive d. None of the above

21. Which of these properties of #define is false?

a. These always obey the scope rules b. We can make use of a pointer to #define

c. The #define can be externally available d. All of the above


22. Out of these methods, which one makes the raw MIME formatted string?

a. toString() b. getString() c. parse() d. parseString()

23. The remover() method throws which of these exceptions:

a. ObjectNotFoundException b. IOException c. IllegalStateException d. SystemException

24. Out of the following, which one is a superclass of all the exception type classes?

a. String b. RuntimeExceptions c. Throwable d. Catchable

25. What happens when we call two threads that have the same priority to process simultaneously?

a. Both of the threads will be simultaneouslyexecuted

b. Any one of the threads can be executed first lexicographically

c. Itdepends on the OS

d. There will be no execution of threads

26. Out of these classes, which one is used for reading strings and characters in Java from the
console?

a. StringReader b. InputStreamReader c. BufferedReader d. BufferedStreamReader

27. Out of these operators, which one can be used to get the run time info about an object?

a. Info b. getInfo c. Instanceof d. none

28. Out of these classes, which one allows a user to define their own formatting pattern for time and
dates?

a. UsersDateFormat b. ComplexDateFormat c. SimpleDateFormat d. DefinedDateFormat

29. Which method can we use in an applet to output a string?

a. transient() b. drawString() c. print() d. display()

30. The public int start() returns what?

a. the start index of the previous match b. the start index of the current match
c. the start index of the input string d. None of the above

31. Which one is a superclass of the ContainerEvent class out of the following?

a. ComponentEvent b. InputEvent c. ItemEvent d. WindowEvent

32. _______ is a superclass of all the Adapter classes.

a. Applet b. ComponentEvent c. InputEvent d. Event

33. Which method in Java generates boolean random values?

a. nextBoolean() b. randomBoolean() c. generateBoolean() d. previousBoolean()

34. Which class produces objects with respect to their geographical locations?

a. Locale b. Date c. Simple TimeZone d. TimeZone

35. Which method is used for notifying the observer about the change in the observed object?

a. update() b. notify() c. observed() d. check()

36. Which package is used to remotely invoke a method?

a. java.rmi b. java.awt c. java.applet d. java.util

37. What are the uses of generics?

a. The generics make a code more readable and optimised

b. The generics make a code faster

c. The generics add stability to a code. They do so by making more bugs detectable at the runtime

d. The generics add stability to a code. They do so by making more bugs detectable at the compile
time

38. Which mechanism helps in the process of naming as well as visibility control of the classes and
their content?

a. Packages b. Interfaces c. Object d. None of the above

39. The configuration is stored in which of the file database tables:

a. .hbm b. .ora c. .sql d. .dbm


40. The primary use of Files.lines(Path path) is that it:

a. reads the lines that are from a file as the Stream

b. reads the files that are at the path specified as the String

c. counts the total number of lines for the files at the specified path

d. reads the filenames at the specified path

Which of the following layers of the OSI model is responsible for physical addressing and
transmission of data over the network?

a) Data Link Layer

b) Network Layer

c) Transport Layer

d) Physical Layer

What is the maximum data rate defined by the IEEE 802.11n standard?

a) 54 Mbps

b) 150 Mbps

c) 300 Mbps

d) 600 Mbps

Which of the following protocols is used for securely transmitting data over the Internet?

a) TCP

b) IP

c) HTTPS

d) FTP

Which networking device operates at the Data Link Layer of the OSI model?

a) Router

b) Hub

c) Switch

d) Repeater
Which type of network topology is characterized by a central node with point-to-point connections
to other nodes?

a) Star

b) Ring

c) Mesh

d) Bus

What is the purpose of DNS (Domain Name System)?

a) To encrypt data transmission

b) To translate domain names into IP addresses

c) To manage network traffic

d) To establish secure connections

What is the default subnet mask for a Class C IP address?

a) 255.0.0.0

b) 255.255.0.0

c) 255.255.255.0

d) 255.255.255.255

Which of the following protocols is used for transferring files between a client and a server over a
network?

a) SMTP

b) SSH

c) FTP

d) SNMP

What is the purpose of NAT (Network Address Translation)?

a) To translate MAC addresses to IP addresses

b) To encrypt network traffic

c) To assign IP addresses dynamically

d) To allow multiple devices to share a single public IP address


Which of the following is NOT a valid IPv6 address type?

a) Unicast

b) Multicast

c) Anycast

d) Broadcast

What is the primary function of a firewall in a network?

a) To provide physical security to the network

b) To filter and control network traffic

c) To enhance network speed

d) To manage IP addresses

Which protocol is used to automatically assign IP addresses to devices on a network?

a) DHCP

b) DNS

c) FTP

d) HTTP

What is the primary function of a switch in a network?

a) To connect multiple networks together

b) To regulate network traffic

c) To translate domain names to IP addresses

d) To connect devices within the same network segment

Which OSI layer is responsible for ensuring the reliable delivery of data between two nodes on a
network?

a) Transport Layer

b) Network Layer

c) Data Link Layer

d) Session Layer
What is the purpose of ICMP (Internet Control Message Protocol)?

a) To encrypt data transmission

b) To diagnose network connectivity issues

c) To establish secure connections

d) To assign IP addresses dynamically

Which of the following is NOT a wireless networking standard?

a) 802.11ac

b) Bluetooth

c) 3G

d) Ethernet

What is the maximum transmission unit (MTU) size for Ethernet networks?

a) 1500 bytes

b) 576 bytes

c) 64 kilobytes

d) 512 bytes

Which type of cable is commonly used to connect a computer to a switch or router in a local area
network (LAN)?

a) Coaxial cable

b) Fiber optic cable

c) Ethernet cable

d) HDMI cable

What is the primary purpose of ARP (Address Resolution Protocol)?

a) To map IP addresses to MAC addresses

b) To secure network connections

c) To establish VPN connections

d) To assign IP addresses dynamically


Which network topology offers the highest level of redundancy and fault tolerance?

a) Star

b) Ring

c) Mesh

d) Bus

You might also like