0% found this document useful (0 votes)
316 views85 pages

Gate MCQ

This document contains 20 multiple choice questions about SQL Server. The questions cover topics like functions, commands, backups, triggers, identifiers and more. Answer options with the correct answer are provided for each question.

Uploaded by

aneess26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
316 views85 pages

Gate MCQ

This document contains 20 multiple choice questions about SQL Server. The questions cover topics like functions, commands, backups, triggers, identifiers and more. Answer options with the correct answer are provided for each question.

Uploaded by

aneess26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

SQL Server Multiple-Choice Questions

1. The @@NESTLEVEL function would fall under which of these categories?


a. Data Functions of Date and Time
b. Mathematical Functions
c. Cursor Functions
d. Configuration Functions
Answer: (d) Configuration Functions
2. Which of these commands is used if we want in a PowerShell to get child items?
a. Set-Alias
b. Get-Child
c. Get-ChildItem
d. Get-Command
Answer: (c) Get-ChildItem
3. Which of these refers to the computer operations’ duplication and routine backups for combating
any unforeseen problems?
a. Deadlock
b. Recovery
c. Concurrency
d. Backup
Answer: (b) Recovery
4. What are all the identifiers in an XQuery known as?
a. QFor
b. Qidt
c. QName
d. Name
Answer: (c) QName
5. Which of these databases must be regularly backed up?
a. Master
b. TEMPDB
c. Pub
d. Adventure Works
Answer: (a) Master
6. Which of these statements can we check for Errors?
a. INSERT
b. DELETE
c. DROP
d. CREATE
Answer: (a) INSERT
7. The Server in SQL can be applied AFTER trigger to:
a. Function
b. Views and Table
c. Table
d. Views
Answer: (b) Views and Table
8. Which of these with SQL Server refers to an enumeration for ADO.net?
a. SqlBulkCopyOptions
b. SqlNotification
c. SqlInfo
d. All of the above
Answer: (a) SqlBulkCopyOptions
9. Which of these refers to a tool used for the migration of the databases from MS Access versions
97 through the 2010 one to the MS SQL Server 2005?
a. SSMS
b. SSAM
c. SSAS
d. SSMA
Answer: (d) SSMA
10. Which of these commands would defragment the clustered as well as the secondary indexes of
any given specified table?
a. DBCC CHECKDB
b. DBCC SHOWCONTIG
c. DBCC INDEXDEFRAG
d. DBCC CATALOG
Answer: (c) DBCC INDEXDEFRAG
11. The database happens to be read-only in which of these modes?
a. Restore mode
b. Stand by
c. Read-only
d. All of the above
Answer: (b) Stand by
12. Which of the waits would occur when any worker is trying to request access to some resources
that are NOT available since the resources are being used by other workers or are not available yet?
a. External
b. Lock
c. Queue
d. Resource
Answer: (d) Resource
13. The Packages of SQL Server Extended Events consist of:
a. Predicates
b. Types
c. Events
d. All of the above
Answer: (d) All of the above
14. Which of these fields has a varbinary data type in the case of cdc.lsn_time_mapping?
a. tran_id
b. start_lsn
c. tran_begin_time
d. all of the above
Answer: (a) tran_id
15. Which of these identifies a query plan uniquely for any batch that has been executed and whose
plans reside in our plan cache?
a. sql_handle
b. pool_name
c. plan_handle
d. none of the above
Answer: (c) plan_handle
16. Which of these backups are taken in full recovery models only or in bulk?
a. Active
b. Log
c. Replica
d. Passive
Answer: (b) Log
17. Which of these would cause a server to raise a certain error whenever the MS SQL Server
Analysis Services also finds an error in the MDX script?
a. IgnoreNone
b. IgnoreAll
c. Ignore
d. All of the above
Answer: (a) IgnoreNone
18. Which of these tools analyse as well as highlights those data rows that do NOT match the
general patterns of the rest of the table?
a. Highlight
b. Exceptions
c. Highlight Exceptions
d. Scenario Analysis
Answer: (c) Highlight Exceptions
19. What is the Space Requirement for the SQL Server 2012 R2 Hard Disk for the database
engines?
a. 511 MegaBytes
b. 611 MegaBytes
c. 711 MegaBytes
d. 811 MegaBytes
Answer: (d) 811 MegaBytes
20. Which of these would hold some set of temporary data?
a. Msdb
b. Tempdb
c. Master
d. Northwind
Answer: (b) Tempdb

Android Multiple-Choice Questions


1. Which of these was the first-ever phone released that was able to run the Android OS?
a. HTC Hero
b. Motorola Droid
c. T-Mobile G1
d. Google gPhone
Answer: (c) T-Mobile G1
2. The Open Handset Alliance was not allowed in which of the years?
a. 2008
b. 2007
c. 2006
d. 2005
Answer: (b) 2007
3. Which of these does NOT refer to a nickname of the Android version?
a. Muffin
b. Honeycomb
c. Gingerbread
d. Cupcake
Answer: (a) Muffin
4. Google purchased Android in which of these years?
a. 2010
b. 2008
c. 2005
d. 2003
Answer: (c) 2005
5. Which of these pieces of code that are used in the Android system is NOT open source?
a. Wifi driver
b. Keypad driver
c. Power management
d. Audio driver
Answer: (a) Wifi driver
6. Which of these do NOT constitute to be a part of the native libraries in Android?
a. OpenGL
b. Webkit
c. SQLite
d. Dalvik
Answer: (d) Dalvik
7. Which of these operating systems is used in the form of the Android sack’s base?
a. XML
b. Java
c. Windows
d. Linux
Answer: (d) Linux
8. The .apk extension stands for which of these?
a. Application Program Kit
b. Android Package
c. Application Package
d. Android Proprietary Kit
Answer: (c) Application Package

9. Which of these is NOT an APK file’s component?


a. Dalvik executable
b. Native libraries
c. Resources
d. None of the above
Answer: (d) None of the above

10. Which of these files specifies our screen’s layout?


a. Manifest file
b. Layout file
c. R file
d. Strings XML
Answer: (c) R file
11. Which of these is an XML file that consists of all the text used in an application?
a. string.java
b. string.xml
c. text.xml
d. stack.xml
Answer: (b) string.xml
12. Which of these does NOT refer to a state in a service’s lifecycle?
a. Paused
b. Destroyed
c. Running
d. Starting
Answer: (a) Paused
13. Android is shipped with which of these built-in databases?
a. Oracle
b. MySQL
c. Apache
d. SQLite
Answer: (d) SQLite
14. The Android system gets exposed with the Status data via:
a. Altering permissions
b. Network receivers
c. A content provider
d. Intents
Answer: (c) A content provider
15. While making any network call, if the UI begins to crash or behave sluggishly, it is most likely
because of:
a. Network latency
b. Too many activities on the Activity Manager
c. Hardware malfunctions
d. Virus on the available Server
Answer: (a) Network latency

Linux Multiple-Choice Questions


1. Which of these commands do we use for removing the files?
a. erase
b. delete
c. rm
d. dm
Answer: (c) rm
2. Which of these hardware architectures does Red Hat not support?
a. Macintosh
b. Alpha
c. IBM-compatible
d. SPARC
Answer: (a) Macintosh
3. Which of these commands do we use for the creation of an installation boot floppy in Linux?
a. bootfp disk
b. mkboot disk
c. dd & rawrite
d. w & rawrite
Answer: (c) dd & rawrite
4. In which of these directories do we store the user-defined files of the system that we use for the
creation of various user directories?
a. /etc/users
b. /etc/skel/
c. /etc/default
d. /usr/temp
Answer: (b) /etc/skel

5. Which of these is NOT used in the form of a communication command?


a. write
b. mesg
c. mail
d. grep
Answer: (d) grep

6. Which of these commands do we use for listing the files, namely, chap01, chap02, and chap03?
a. Is – x chap0[124]
b. Is chap*
c. Is chap0[124]
d. Is chap[124]
Answer: (d) Is chap[124]

7. Which of these commands do we use for the sorting of data lines in a file in alphabetical order?
a. st
b. sort
c. sort – r
d. sh
Answer: (b) sort
8. By default, which of these ports does squid listen to?
a. 3128
b. 7334
c. 2314
d. 4322
Answer: (a) 3128
9. Which of these commands do we use in the NFS servers so as to see the servers that are
running?
a. serverinfo
b. rpcinfo
c. infserv
d. NFSinfo
Answer: (b) rpcinfo
10. The token management and dialogue control in the OSI network architecture are responsible for
the:
a. transport layer
b. data link layer
c. session layer
d. network layer
Answer: (d) network layer
11. Out of the following NIS clients, which one would find the information about any NIS domain as
well as server and then store it?
a. yppoll
b. ypcat
c. ypbind
d. ypwhich
Answer: (c) ypbind
12. Which of these commands do we use for just counting the total number of lines that a file
contains?
a. wc – l
b. wc – c
c. wc – w
d. wc – r
Answer: (a) wc – l
13. Which of these types of installations do need a special boot disk?
a. PCMCIA
b. NFS
c. FTP
d. All of the above
Answer: (d) All of the above
14. Which of these do NOT constitute as a default part of the email system of Red Hat Linux?
a. The MTA
b. Pine
c. Procmail
d. The MUA
Answer: (b) Pine
15. Which of these commands do we use for forcing all the buffers to the disk?
a. flush
b. edbuff
c. sync
d. save
Answer: (c) sync

Computer Architecture Multiple-Choice Questions


1. What would be the minterm expansion of the following:
f(P, Q, R) = PQ + QR’ + PR’
a. m0 + m1 + m3 + m5
b. m2 + m4 + m6 + m7
c. m2 + m3 + m4 + m5
d. m0 + m1 + m6 + m7
Answer: (b) m2 + m4 + m6 + m7
2. What is the hexadecimal representation of 6578?
a. D71
b. 32F
c. 1AF
d. D78
Answer: (c) 1AF
3. Let us consider an array multiplier used for the multiplication of two n bit numbers. In case every
gate in the circuit faces a unit delay, then the total delay of this multiplier would be:
a. Θ(n)
b. Θ(1)
c. Θ(n^2)
d. Θ(log n)
Answer: (a) Θ(n)
4. What would be the total prime implicants of the following function:
f(w, x, y, z) = Σ(0, 2, 4, 5, 6, 10)
a. 5
b. 4
c. 3
d. 2
Answer: (c) 3
5. How many pulses do we need if we want to change the contents of any given 8-bit up counter
from the bit 10101100 to bit 00100111 (the rightmost bit here is the LSB)?
a. 123
b. 124
c. 133
d. 134
Answer: (a) 123
6. When we add a two’s complement, 4-bit, binary numbers 1101 and 0100, it would result in:
a. 1001 and no overflow
b. 0001 and an overflow
c. 1001 and an overflow
d. 0001 and no overflow
Answer: (d) 0001 and no overflow
7. If we want to put an 8085 microprocessor in a wait state, then we have:
a. to raise the-HOLD input
b. to raise the READY input
c. to lower the HOLD input
d. to lower the READY input
Answer: (d) to lower the READY input
8. What would be the 2’s complement representation (in hexadecimal) of (−539)10?
a. 9E7
b. DE5
c. DBC
d. ABE
Answer: (b) DE5
9. What would be the 2′ s complement representation of the -15 decimal value?
a. 10001
b. 1111111
c. 1001
d. 1111
Answer: (d) 1111
10. If in a base-x type of number system, 73x is equivalent to that of 54y in a base-y type of number
system, then the possible values of both- x and y would be:
a. 10, 12
b. 8, 16
c. 8, 11
d. 9, 13
Answer: (c) 8, 11
11. In the Principle of locality, there is a justification of the use of:
a. DMA
b. Cache memory
c. Threads
d. Interrupts
Answer: (b) Cache memory
12. Which of these is NOT involved in the case of a memory write operation?
a. Databus
b. MDR
c. MAR
d. PC
Answer: (d) PC
13. Which of these is required when we want to establish the communication links between a CPU
and its peripherals?
a. Memory data register
b. Memory address register
c. Instruction register
d. Index register
Answer: (a) Memory data register
14. A given 2 level memory consists of a 30 ns average access time. If the cache, as well as the
memory access time here, is 20 ns and 150 ns, respectively, what would be the hit ratio?
a. 99%
b. 70%
c. 93%
d. 80%
Answer: (c) 93%
15. If we double the cache line length and it reduces the miss rate to 3%, then by how much will the
average memory access time be reduced?
a. 4.85 ns
b. 22.2 ns
c. 25.75 ns
d. 27.1 ns
Answer: (d) 27.1 ns
16. The total number of digits that are required for the representation of a 126-bit binary number in
its decimal form would be:
a. 46 bits
b. 42 bits
c. 36 bits
d. 32 bits
Answer: (b) 42 bits
17. Which of these memories would have the lowest access time in a system:
a. Main Memory
b. Magnetic Disk
c. Registers
d. Cache
Answer: (c) Registers
18. Which of these refers to the minimization expression for the following:
A+A’B+A’B’C+A’B’C’D
a. A+B) (C+D)
b. ABCD
c. 1
d. A+B+C+D
Answer: (d) A+B+C+D
19. What is the minimum time delay present between the initiations of two separate, independent
memory operations known as?
a. Cycle Time
b. Latency Time
c. Access Time
d. Transfer Rate
Answer: (a) Cycle time
20. Which of these addressing modes is the most suitable for some high-level language statements?
a. Indexed
b. Auto-decrement
c. Auto-increment
d. Displacement
Answer: (b) Auto-decrement
Cyber Security Multiple-Choice Questions
1. In which of these a person is continually chased/followed by another person or a group of various
people?
a. Identity theft
b. Stalking
c. Bullying
d. Phishing
Answer: (b) Stalking
2. Which of these is an antivirus program type?
a. Kaspersky
b. Quick heal
c. Mcafee
d. All of the above
Answer: (d) All of the above
3. A ____________ can be a hardware device or a software program that filters all the packets of
data that comes through a network, the internet, etc.
a. Firewall
b. Antivirus
c. Malware
d. Cookies
Answer: (a) Firewall
4. Which of these would refer to the exploration of the apt, ethical behaviours that are related to the
digital media platform and online environment?
a. Cybersecurity
b. Cybersafety
c. Cyberethics
d. Cyber low
Answer: (c) Cyberethics
5. Which of these is a technique that is used to verify a message’s integrity?
a. Message Digest
b. Protocol
c. Decryption algorithm
d. Digital signature
Answer: (a) Message Digest
6. Which of these ports and IP address scanners is popular among the users?
a. Ettercap
b. Snort
c. Angry IP Scanner
d. Cain and Abel
Answer: (c) Angry IP Scanner
7. Which of these is NOT a scanning type?
a. Null Scan
b. Xmas Tree Scan
c. SYN Stealth
d. Cloud Scan
Answer: (d) Cloud Scan
8. The Code Red is a sort of a ___________.
a. Video Editing Software
b. Computer Virus
c. Photo Editing Software
d. Antivirus Program
Answer: (b) Computer Virus
9. Which of these is also malicious software?
a. Badware
b. Malicious Ware
c. Malware
d. Ilegalware
Answer: (c) Malware
10. We use the transit time and the response time to measure a network’s ___________.
a. Reliability
b. Performance
c. Longevity
d. Security
Answer: (b) Performance

11. Which of these is the world’s very first antivirus program?


a. Tinkered
b. Creeper
c. Ray Tomlinson
d. Reaper
Answer: (d) Reaper

12. The Hacker who did break the SIPRNET system is ___________.
a. Kevin Poulsen
b. John von Neumann
c. Kevin Mitnick
d. John Draper
Answer: (a) Kevin Poulsen
13. Using the cipher algorithm, which of these types of text would be transformed?
a. Plain text
b. Scalar text
c. Complex text
d. Transformed text
Answer: (a) Plain text
14. Which of the following malware types does not clone or replicate itself through infection?
a. Viruses
b. Worms
c. Trojans
d. Rootkits
Answer: (c) Trojans
15. The DNS would translate any Domain name into ___________.
a. IP
b. URL
c. Binary
d. Hex
Answer: (b) URL
16. Which of these is usually referred to as the port number (default) of several web servers like
apache?
a. 40
b. 20
c. 87
d. 80
Answer: (d) 80
17. Which of these is a sort of independent type of malicious program that would not require any
host program?
a. Virus
b. Trap Door
c. Worm
d. Trojan Horse
Answer: (c) Worm

18. Which of these is NOT involved in the CIA Triad?


a. Confidentiality
b. Availability
c. Integrity
d. Authenticity
Answer: (d) Authenticity
19. Which of these is the oldest techniques used by hackers for phone hacking to make free calls?
a. Phishing
b. Phreaking
c. Spraining
d. Cracking
Answer: (b) Phreaking
20. Which of these is the very first hacker’s conference?
a. DEFCON
b. OSCON
c. SECTION
d. DEVON
Answer: (a) DEFCON

OOPs Multiple-Choice Questions


1. Which of these features of OOP would indicate code reusability?
a. Polymorphism
b. Abstraction
c. Inheritance
d. Encapsulation
Answer: (c) Inheritance
2. Which language does not support polymorphism but supports classes?
a. Ada
b. C++
c. Java
d. SmallTalk
Answer: (a) Ada
3. Which of these specifiers would be applied to the constructors only?
a. Explicit
b. Implicit
c. Protected
d. Public
Answer: (a) Explicit
4. A constructor _____________.
a. May consist of a return type
b. Doesn’t consist of any return type
c. Has some return type
d. Of a derived class has a return type
Answer: (b) Doesn’t consist of any return type
5. The access specifier that is/are the most secure during inheritance is/are _______________.
a. Protected
b. Private
c. Private and Default
d. Default
Answer: (b) Private
6. If in case, in multiple inheritances, a class R would inherit the Class Q, while Class Q would inherit
the class P, then in which sequence would their destructors be called in case we declare an object of
Class R?
a. ~R() then ~P() then ~Q()
b. ~P() then ~Q() then ~R()
c. ~Q() then ~R() then ~P()
d. ~R() then ~Q() then ~P()
Answer: (d) ~R() then ~Q() then ~P()
7. The memory that is allocated for any objects is ____________.
a. Cache
b. HDD
c. ROM
d. RAM
Answer: (d) RAM
8. Which of these classes is a specialization of some more general template classes?
a. Integer
b. Maths
c. String
d. Digit
Answer: (c) String
9. A derived class is also called a ______________.
a. Small class
b. Subclass
c. Noticeable class
d. Big class
Answer: (b) Subclass
10. Which of these inheritances is shown in case we inherit some base class from another class,
then one of the classes derives it?
a. Single
b. Multiple
c. Multi-level
d. Hierarchical
Answer: (c) Multi-level
11. Hierarchical inheritance could be some subset of _________________ inheritance.
a. Multilevel
b. Single level
c. Multiple
d. Hybrid
Answer: (d) Hybrid
12. What is the name of the feature in which we enforce the definitions of the abstract function at the
compile time?
a. Dynamic Polymorphism
b. Static Polymorphism
c. Dynamic or Static Polymorphism according to need
d. Polymorphism
Answer: (a) Dynamic Polymorphism
13. If in case a class is called in the main function directly and has a public member function, then
____________________.
a. It will lead to the production of an undeclared function error
b. It will lead to the production of an out of memory error
c. The program will only give warning
d. The program will shut the computer down
Answer: (a) It will lead to the production of an undeclared function error
14. __________ is the universal handler class for exceptions.
a. Maths
b. Object
c. Exceptions
d. Errors
Answer: (c) Exceptions
15. For catching multiple exceptions in a single catch block, then how do we separate exceptions in
the syntax?
a. Hyphen
b. Vertical bar
c. Modulus
d. Plus
Answer: (b) Vertical bar
16. Where are the temporary objects (that are created during the return by value) created?
a. Inside the calling function
b. Inside the main function
c. Within the function
d. Outside the function scope
Answer:(c) Within the function
17. What shall we use in the case of safe downcast?
a. Implicit cast
b. Manual cast
c. Dynamic cast
d. Static cast
Answer: (c) Dynamic cast
18. Which of these types of values result from a delete operator?
a. null
b. null pointer
c. void pointer
d. void
Answer: (d) void
19. Which of these attributes can we use if we want to get the actual size of any array?
a. Array_name.length
b. Size.Array
c. length.Array_name
d. Array.Size
Answer: (a) Array_name.length
20. Which function is used to get any character that is present at a certain index of a string?
a. char charIn(StringName);
b. char charAt(index);
c. char charIn(index);
d. char charAt(StringName);
Answer: (b) char charAt(index);

C++ Multiple-Choice Questions


1. Which of these types is not provided by C but is provided by C++?
a. double
b. float
c. bool
d. int
Answer: (c) bool
2. Which concept do we use for the implementation of late binding?
a. Static Functions
b. Constant Functions
c. Operator Functions
d. Virtual Functions
Answer: (d) Virtual functions
3. Which of these won’t return any value?
a. void
b. null
c. free
d. empty
Answer: (a) void
4. Which function do we use for checking if a character is a space or a tab?
a. isdigit()
b. isblank()
c. isalnum()
d. isalpha()
Answer: (b) isblank()
5. What would happen in case one uses a void in the passing of an argument?
a. It would return any value
b. It may not or may depend on a declared return type of any function. The return type of the function
is different from the passed arguments
c. It would return some value to the caller
d. It would not return any value to the caller
Answer: (d) It would not return any value to the caller
6. __________ is an ability of grouping certain lines of code that we need to include in our program?
a. macros
b. modularization
c. program control
d. specific task
Answer: (b) modularization

7. Which of these keywords do we use for the declaration of the friend function?
a. myfriend
b. classfriend
c. friend
d. firend
Answer: (c) friend

8. What is used for dereferencing?


a. pointer with asterix
b. pointer without asterix
c. value with asterix
d. value without asterix
Answer: (a) pointer with asterix
9. What does polymorphism stand for?
a. a class that has four forms
b. a class that has two forms
c. a class that has only a single form
d. a class that has many forms
Answer: (d) a class that has many forms
10. What handler do we use if we want to handle all the types of exceptions?
a. try-catch handler
b. catch-none handler
c. catch-all handler
d. catch handler
Answer: (c) catch-all handler
11. What do we use in order to throw an exception?
a. try
b. throw
c. handler
d. catch
Answer: (b) throw
12. We can apply RTTI to which of the class types?
a. Polymorphic
b. Encapsulation
c. Static
d. Derived
Answer: (a) Polymorphic

13. Which header file do we use for the generation of random numbers?
a. <random>
b. <generator>
c. <distribution>
d. <gen_dist>
Answer: (a) <random>

14. Which container is the best for keeping a collection of various distinct elements?
a. queue
b. set
c. heap
d. multimap
Answer: (b) set
15. Inheritance models which type of relationship?
a. Belongs-to relationship
b. Part-Of relationship
c. Is-A relationship
d. Has-A relationship
Answer: (c) Is-A relationship
16. In heap, which of these values will be pointed out first?
a. First value
b. Lowest value
c. Third value
d. Highest value
Answer: (d) Highest value
17. Which of these functions is used for incrementing the iterator by a certain value?
a. move()
b. prev()
c. advance()
d. next()
Answer: (c) advance()
18. In the locale object, which of these objects’ information is loaded?
a. secant object
b. facet object
c. instead object
d. both instead & facet objects
Answer: (b) facet object
19. Which of these mathematics libraries is used in C++ for vector manipulation?
a. blitz++
b. stac++
c. vec++
d. cli+++
Answer: (a) blitz++
20. Which of these operators is used in order to capture every external variable by reference?
a. *
b. &&
c. &
d. =
Answer: (d) =
Computer Fundamentals Multiple-Choice Questions
1. The computer-assisted method that helps in the recording and analysis of a hypothetical or an
existing system is known as:
a. Data processing
b. Data capture
c. Data flow
d. Data transmission
Answer: (c) Data flow
2. Which of these computer languages do we use in artificial intelligence?
a. PROLOG
b. FORTRAN
c. COBOL
d. C
Answer: (a) PROLOG
3. Which of these parts would interpret a program’s instructions to initiate the control operations?
a. Logic unit
b. Control unit
c. Storage unit
d. Input
Answer: (b) Control unit
4. The 1’s complement of 10 is:
a. 10
b. 11
c. 110
d. 01
Answer: (d) 01
5. __________ is the computer program that would convert an assembly language to the machine
language.
a. Interpreter
b. Compiler
c. Comparator
d. Assembler
Answer: (d) Assembler
6. The total time for which any piece of equipment would operate is known as __________________
time.
a. Effective
b. Seek
c. Real
d. Access
Answer: (a) Effective
7. What access method do we use to obtain any record out of a cassette tape?
a. Random
b. Direct
c. Sequential
d. All of the above
Answer: (c) Sequential
8. What is the CPU’s section that interprets, selects, and also sees to a program instructions’
execution?
a. Register unit
b. Control unit
c. ALU
d. Memory
Answer: (b) Control unit
9. One packet on any data link is called:
a. Group
b. Block
c. Frame
d. Path
Answer: (c) Frame
10. What is the common boundary present between two systems known as?
a. Interface
b. Surface
c. Interdiction
d. None of the above
Answer: (a) Interface
11. _____________ is a computer that has been designed so that it is as compact as possible.
a. Supercomputer
b. Mini
c. Mainframe
d. Microcomputer
Answer: (d) Microcomputer

12. Which of these is a general-purpose microcomputer that is single-user and is designed to be


operated by just a single person at any given time?
a. M
b. PC
c. KIPS
d. Special-purpose computer
Answer: (b) PC
13. A total of how many bit codes are used for TELEPRINTER machines by Murray code?
a. 25
b. 9
c. 5
d. 4
Answer: (c) 5
14. _____ refers to the datum that would indicate the important state in an input or output content.
a. Sentinel
b. Sequence
c. Sibling
d. SIO
Answer: (a) Sentinel

15. Which of these refers to a systems programming language for the Intel family microcomputers?
a. PLA
b. PL/CT
c. PL/M
d. PL/C
Answer: (c) PL/M
16. Out of the following, which one is still useful if we want to add numbers?
a. UNIVAC
b. Abacus
c. ENIAC
d. EDSAC
Answer: (b) Abacus
17. What is the number used to control the forms of other numbers known as?
a. Mask
b. Map
c. Marker
d. Mantissa
Answer: (a) Mask
18. Which of these is a high-level machine-oriented language for the machines that are of the GEC
4080 series?
a. ALGOL
b. Babbage
c. SNOBOL
d. LOGO

Answer: (b) Babbage


19. Which of these output devices are used for the translation of information from any computer into
a pictorial form on the papers?
a. Card punch
b. Touch panel
c. Plotter
d. Mouse
Answer: (c) Plotter
20. A list of various coded instructions is known as:
a. Flowchart
b. Utility programs
c. Algorithm
d. Computer program
Answer: (d) Computer program

Multiple-choice Questions on Advance Java


1. Which of the following is used for session migration?

a. Persisting the session in database


b. URL rewriting
c. Creating new database connection
d. Kill session from multiple sessions

Answer (a)

2. Which of the below is not a session tracking method?

a. URL rewriting
b. History
c. Cookies
d. SSL sessions

Answer (b)
3. Which of the following is stored at the client side?

a. URL rewriting
b. Hidden form fields
c. SSL sessions
d. Cookies

Answer (d)
4. Which of the following leads to high network traffic?

a. URL rewriting
b. Hidden form fields
c. SSL sessions
d. Cookies

Answer (a)
5. Which of the following is not true about session?

a. All users connect to the same session


b. All users have the same session variable
c. Default timeout value for session variable is 20 minutes
d. New session cannot be created for a new user

Answer (c)
6. What is the maximum size of cookie?

a. 4 KB
b. 4 MB
c. 4 bytes
d. 40 KB

Answer (a)
7. How can we invalidate a session?

a. session.discontinue()
b. session.invalidate()
c. session.disconnect()
d. session.falsify()

Answer (b)
8. Which method creates unique fields in the HTML, which are not shown to the user?

a. User authentication
b. URL writing
c. HTML Hidden field
d. HTML invisible field

Answer (c)
9. Which object is used by spring for authentication?

a. ContextHolder
b. SecurityHolder
c. AnonymousHolder
d. SecurityContextHolder

Answer (d)
10. Which page directive should be used in JSP to generate a PDF page?

a. contentType
b. generatePdf
c. typePDF
d. contentPDF

Answer (a)
11. Which tag should be used to pass information from JSP to included JSP?

a. Using <%jsp:page> tag


b. Using <%jsp:param> tag
c. Using <%jsp:import> tag
d. Using <%jsp:useBean> tag

Answer (a)
12. Application is an instance of which class?

a. javax.servlet.Application
b. javax.servlet.HttpContext
c. javax.servlet.Context
d. javax.servlet.ServletContext

Answer (d)
13. Which option is true about session scope?

a. Objects are accessible only from the page in which they are created
b. Objects are accessible only from the pages which are in the same session
c. Objects are accessible only from the pages which are processing the same request
d. Objects are accessible only from the pages which reside in the same application

Answer (b)
14. Which one is the correct order of phases in the JSP life cycle?

a. Initialization, Cleanup, Compilation, Execution


b. Initialization, Compilation, Cleanup, Execution
c. Compilation, Initialization, Execution, Cleanup
d. Cleanup, Compilation, Initialization, Execution

Answer (c)
15. “request” is an instance of which one of the following classes?

a. Request
b. HttpRequest
c. HttpServletRequest
d. ServletRequest

Answer (c)
16. Which is not a directive?

a. include
b. page
c. export
d. useBean

Answer (c)
17. Which is mandatory in <jsp:useBean /> tag?

a. id, class
b. id, type
c. type, property
d. type,id

Answer (a)
18. Which one of the following is correct for directive in JSP?

a. <%@directive%>
b. <%!directive%>
c. <%directive%>
d. <%=directive%>

Answer (a)
19. Which of the following action variables is used to include a file in JSP?

a. jsp:setProperty
b. jsp:getProperty
c. jsp:include
d. jsp:plugin

Answer (c)
20. Which attribute uniquely identifies an element?

a. ID
b. Class
c. Name
d. Scope

Answer (a)
21. “out” is the implicit object of which class?

a. javax.servlet.jsp.PrintWriter
b. javax.servlet.jsp.SessionWriter
c. javax.servlet.jsp.SessionPrinter
d. javax.servlet.jsp.JspWriter

Answer (d)
22. Which object stores references to the request and response objects?

a. sessionContext
b. pageContext
c. HttpSession
d. sessionAttribute

Answer (b)
23. What temporarily redirects response to the browser?

a. <jsp:forward>
b. <%@directive%>
c. response.sendRedirect(URL)
d. response.setRedirect(URL)

Answer (c)
24. Which tag is used to set a value of a JavaBean?

a. <c:set>
b. <c:param>
c. <c:choose>
d. <c:forward>

Answer (a)
25. Java code is embedded under which tag in JSP?

a. Declaration
b. Scriptlet
c. Expression
d. Comment

Answer (b)
Java MCQ Questions
1. Which of these components are used in a Java program for compilation, debugging, and
execution?
a. JDK
b. JVM
c. JRE
d. JIT
Answer: (a) JDK
2. Which of these literals can be contained in a float data type variable?
a. -3.4e+050
b. +1.7e+308
c. -3.4e+038
d. -1.7e+308
Answer: (b) -3.4e+038
3. What is BigDecimal.ONE?
a. it is a custom-defined statement
b. it is a wrong statement
c. it is a static variable that has a value of 1 on a scale of 0
d. it is a static variable that has a value of 1 on a scale of 10
Answer: (c) it is a static variable that has a value of 1 on a scale of 0
4. When an expression consists of int, double, long, float, then the entire expression will get
promoted into a data type that is:
a. float
b. double
c. int
d. long
Answer: (b) double
5. Which of the following operators can operate on a boolean variable?
A. &&
B. ==
C. ?:
D. +=
a) C & B
b) A & D
c) A, B & D
d) A, B & C
Answer: (d) A, B & C
6. Out of these statements, which ones are incorrect?
a. The Brackets () have the highest precedence
b. The equal to = operator has the lowest precedence
c. The addition operator + and the subtraction operator – have an equal precedence
d. The division operator / has comparatively higher precedence as compared to a multiplication
operator
Answer: (d) The division operator / has comparatively higher precedence as compared to a
multiplication operator
7. What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
int p = 1;
int q = 2;
int r = 3;
p |= 4;
q >>= 1;
r <<= 1;
p ^= r;
System.out.println(q + ” ” + q + ” ” + r);
}
}
a. 3 3 6
b. 2 3 4
c. 2 2 3
d. 3 1 6
Answer: (d) 3 1 6
8. What will be the output of the following Java code snippet?
class P
{
}
enum Enums extends P
{
PQR, QRS, RST, STU;
}
a) Compilation Error
b) Runtime Error
c) EnumNotDefined Exception
d) It runs successfully
Answer: (a) Compilation Error

9. When does Overloading not occur?


a. When more than a single method have the same name, yet different types or number of
parameters and different method signature
b. When more than a single method have the same name, the same signature, but have different
numbers of signature
c. When more than a single method have the same signature, same name, and the same number of
parameters have different types
d. When more than a single method have the same name, the same number and types of
parameters, and yet different signatures
Answer: (d) When more than a single method have the same name, the same number and types of
parameters, and yet different signatures
10. What is it called when the child object also gets killed when the parent object is killed in the
program?
a. Encapsulation
b. Association
c. Aggregation
d. Composition
Answer: (d) Composition
11. How does one identify if a compilation unit is an interface or class from a .class file?
a. Extension of the compilation unit
b. Java source file header
c. The class and interface cannot be differentiated
d. The unit type must be used to postfix interface or class name
Answer: (b) Java source file header
12. Out of these methods of the String class, which one can be used for testing the strings for
equality?
a. isequals()
b. isequal()
c. equals()
d. equal()
Answer: (c) equals()

13. What would happen to the thread whenever the garbage collection kicks off?
a. The garbage collection won’t happen until the running of the thread
b. The thread would continue its operation
c. The garbage collection and the thread don’t interfere with each other
d. The thread would be paused while the running of the garbage collection
Answer: (d) The thread would be paused while the running of the garbage collection
14. Out of these, which one is the correct way of calling a constructor that has no parameters of the
superclass A by the subclass B?
a. superclass.();
b. super(void);
c. super();
d. super.A();
Answer: (c) super();
15. Out of these methods of the Object class, which one can clone an object?
a. Object clone()
b. clone()
c. Object copy()
d. copy()
Answer: (a) Object clone()
16. Out of these packages, which one contains an abstract keyword?
a. java.util
b. java.lang
c. java.system
d. java.io
Answer: (b) java.lang
17. Out of these methods, which one can be used for converting all the characters present in a
String into an Array of characters?
a. both getChars() & toCharArray()
b. both charAt() & getChars()
d. charAt()
d. all of the mentioned
Answer: (a) both getChars() & toCharArray()
18. What value is returned by the compareTo() function in case the invoking string happens to be
greater than the compared string?
a. a value that is greater than zero
b. a value that is less than zero
c. zero
d. none of the above
Answer: (a) a value that is greater than zero
19. Out of these exceptions, which one is thrown by the compareTo() method that is defined in a
double wrapper?
a. SystemException
b. ClassCastException
c. IOException
d. CastException
Answer: (b) ClassCastException
20. Where does the String Pool get stored?
a. Metaspace
b. Java Stack
c. Java Heap
d. Permanent Generation
Answer: (c) Java Heap
21. Out of these data members of the HttpResponse class, which one is used for the storage of the
response that is from an http server?
a. address
b. status
c. statusCode
d. statusResponse
Answer: (c) statusCode
22. Out of these methods, which one makes the raw MIME formatted string?
a. toString()
b. getString()
c. parse()
d. parseString()
Answer: (c) parse()
23. The remover() method throws which of these exceptions:
a. ObjectNotFoundException
b. IllegalStateException
c. IOException
d. SystemException
Answer: (b) IllegalStateException

24. Out of the following, which one is a superclass of all the exception type classes?
a. String
b. RuntimeExceptions
c. Catchable
d. Throwable
Answer: (d) Throwable

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
Answer: (c) Itdepends on the OS
26. Out of these classes, which one is used for reading strings and characters in Java from the
console?
a. StringReader
b. BufferedReader
c. InputStreamReader
d. BufferedStreamReader
Answer: (b) BufferedReader
27. Out of these operators, which one can be used to get the run time info about an object?
a. Info
b. getInfo
c. getinfoof
d. instanceof
Answer: (d) instanceof
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
Answer: (c) SimpleDateFormat
29. Which method can we use in an applet to output a string?
a. transient()
b. drawString()
c. print()
d. display()
Answer: (b) drawString()
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
Answer: (a) the start index of the previous match

31. Which one is a superclass of the ContainerEvent class out of the following?
a. ComponentEvent
b. InputEvent
c. ItemEvent
d. WindowEvent
Answer: (a) ComponentEvent
32. _______ is a superclass of all the Adapter classes.
a. ComponentEvent
b. Applet
c. InputEvent
d. Event
Answer: (b) Applet
33. Which method in Java generates boolean random values?
a. randomBoolean()
b. nextBoolean()
c. generateBoolean()
d. previousBoolean()
Answer: (b) nextBoolean()
34. Which class produces objects with respect to their geographical locations?
a. Simple TimeZone
b. Date
c. Locale
d. TimeZone
Answer: (c) Locale
35. Which method is used for notifying the observer about the change in the observed object?
a. notify()
b. update()
c. observed()
d. check()
Answer: (b) update()
36. Which package is used to remotely invoke a method?
a. java.awt
b. java.rmi
c. java.applet
d. java.util
Answer: (b) java.rmi
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
Answer: (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
Answer: (a) Packages
39. The configuration is stored in which of the file database tables:
a. .sql
b. .ora
c. .hbm
d. .dbm
Answer: (c) .hbm

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
Answer: (a) reads the lines that are from a file as the Stream

41. Which keywords for the purpose of upper bound a wildcard?


a. bound
b. stop
c. implements
d. extends
Answer: (d) extends

42. Out of the following statements, which one is not true about the Java beans?
a. It extends the java.io.Serializable class
b. It implements the java.io.Serializable interface
c. It provides getter and setter methods for its properties
d. It provides us with no argument constructor
Answer: (a) It extends the java.io.Serializable class
43. What does the abbreviation MVC pattern stand for?
a. Model View Class
b. Mock View Class
c. Mock View Controller
d. Model View Control
Answer: (d) Model View Control
44. The advantage of using the PreparedStatement in Java is:
a. More memory usage
b. Prevents SQL injection
c. Encourages SQL injection
d. Slow performance
Answer: (b) Prevents SQL injection
45. How does one move from some desired step to another one?
a. logger.error
b. logger.log
c. System.out.println
d. breakpoints
Answer: (d) breakpoints
46. What would happen if the IP Address of the host can’t be determined?
a) IOException is thrown
b) The system will exit with no message
c) Temporary IP Address will be assigned
d) UnknownHostException is thrown
Answer: (d) UnknownHostException is thrown
47. The storage capacity of a single cookie is:
a) 4095 MegaBytes
b) 4095 bytes
c) 2048 bytes
d) 2048 MegaBytes
Answer: (b) 4095 bytes

48. Which action variable helps in including a file in the JSP?


a) jsp:plugin
b) jsp:include
c) jsp:getProperty
d) jsp:setProperty
Answer: (b) jsp:include

49. ______ file defines dependency in maven.


a) dependency.xml
b) build.xml
c) version.xml
d) pom.xml
Answer: (d) pom.xml
50. The main difference between AutoCloseable and Closeable is that:
a) AutoCloseable throws IOException; Closeable throws Exception
b) AutoCloseable is an implementation; Closeable is a concept
c) AutoCloseable throws Exception; Closeable throws IOException
d) AutoCloseable is a concrete class and Closeable is an interface
Answer: (c) AutoCloseable throws Exception; Closeable throws IOException

Multiple-choice Questions on Web Technology


1. Which one of the following is an example of an ‘internet search engine?
a. LINUX
b. Google
c. MS Word
d. Windows

Answer (b)

2. At which port number, Simple Network Management Protocol (SNMP) operates


a. 160
b. 163
c. 164
d. 161

Answer (d)

3. Which of the following is not an HTML tag?


a. < select >
b. < input >
c. < textarea >
d. < list >

Answer (d)

4. Which among these is not a Web browser?


a. www
b. Chrome
c. Opera
d. NetSurf

Answer (a)

5. World Wide Web was invented by


a. Ted Nelson
b. Tim Berners-Lee
c. Linus Torvalds
d. Robert E. Kahn

Answer (b)

6. What does W3C stand for?


a. World Wide Web Consortium
b. World Wide Website Consortium
c. World Wide Website Community
d. World Wide Web Community

Answer (a)
7. What does HTML stand for?
a. Hyper Text Markup Language
b. High Text Markup Language
c. Hyper Tabular Markup Language
d. None of these

Answer (a)

8. The following statements are about three important browser objects in JavaScript.

I. window object : The highest of all objects in the client-side JavaScript object hierarchy.
II. navigator object : A collection of information about the browser. Useful in browser sniffing.
III. document object : Provides access to the document being viewed.
Which of the above statements is/are true?

a. Only (I) above


b. Only (II) above
c. Only (III) above
d. All (I), (II) and (III) above

Answer (d)

9. The following message is displayed on the browser, while trying to access a URL

Server; Error 403


The reason for the message:

a. The requested HTML file is not available


b. The URL refers to a CGI script and the header of the script does not indicate where
the interpreter is located
c. The path to the interpreter of the script file is invalid
d. The requested HTML file or CGI script has insufficient permission

Answer (d)

10. Which of the following statements is true regarding HTTP?


a. Web browsers use only HTTP as a communication protocol with servers
b. It does not maintain any connection information on previous transactions
c. It is designed to route information based on content
d. It refers to resources using their Universal Resource Identifier (URI)

Answer (b)

11. Which one among these is used with tag as an attribute to specify alternate text for an
image, if the image is not displayed for some reason?
a. alt
b. Alternate
c. Duplicate
d. Auxiliary

Answer (a)

12. Which among the following options is correct regarding HTML?


a. Modelling Language
b. DTP language
c. Partial programming language
d. Used to structure web documents
e. Answer (d)
13. HTTPs stands for
a. Hyper Text Transfer Protocol Secure
b. High Text Transfer Protocol Secure
c. Hyper Transfer Protocol Secure
d. Hyper Transfer Protocol Standard

Answer (a)

14. XML stands for


a. Extensible Mask Language
b. Extensible Markup Language
c. Extended Markup Language
d. Extension Markup Language

Answer (b)

15. Which of the following is NOT true regarding JavaScript?


a. JavaScript is a loosely typed language
b. JavaScript is event driven
c. JavaScript is not an object-based language
d. JavaScript can not run in standalone mode

Answer (b)

16. What are Empty elements and is it valid?


a. No, there are no such terms as Empty Elements
b. Empty elements are element with no data
c. No, it is not valid to use Empty Element
d. None of these

Answer (b)

17. Which method of the Component class is used to set the position and size of a component in
JSP?
a. setSize()
b. setBounds()
c. setPosition()
d. setPositionSize()

Answer (b)

18. Which of the following is a container?


a. <SELECT>
b. <BODY>
c. <INPUT>
d. Both (a) and (b)

Answer (d)

19. In JSP, a Canvas object provides access to a Graphics object via one of its method called
a. getCanvas()
b. getGraphics()
c. paint()
d. getPaint()

Answer (c)
20. How can you open a link in a new browser window?
a. < a href = “url” target = “new”>
b. <a href = “url” target= “_blank”>
c. <a href = “url”.new>
d. <a href = “url” target =”open”>

Answer (b)

21. The tag used to create a hypertext relationship between current document and another URL
is
a. <ISINDEX>
b. <A>
c. <LINK>
d. None of these

Answer (c)

22. Which tag creates a number/order list?


a. <UL>
b. <OL>
c. <OT>
d. None of these

Answer (b)

23. Consider the following statement:

GET /cgi-bin/dispenser.pl&want=whatsnew.html HTTP/1.0


Which of the following options is the correct one?

a. The above statement is a part of a request from a web client


b. The above statement is a part of the input to a CGI program
c. Want is a variable and whatsnew.html is a value
d. Dispenser.pl may be a CGI program

Answer (d)

24. Which of the following is a Valid Name?


a. <_person>
b. <123 person>
c. Both (a) and (b)
d. None of these

Answer (A)

25. Which of the following statements is not true regarding JavaScript?


a. JavaScript is a loosely typed language
b. JavaScript is an object-based language
c. JavaScript is event driven
d. A JavaScript embedded in an HTML document is compiled and executed by the
client browser

Answer (d)
IoT Multiple-Choice Questions
1. Which network is used by a sensor?
a. PAN and LAN
b. PAN and HAN
c. HAN and LAN
d. HAN, PAN, and LAN
Answer: (d) HAN, PAN, and LAN
2. A gateway software must be smart enough so that it can handle _____________.
a. Sensors
b. Logging
c. Message
d. GPS
Answer: (b) Logging
3. Dell uses which of these Edge gateway models?
a. 3500
b. 4000
c. 4500
d. 5000
Answer: (d) 5000

4. UDP and TCP are called ________ protocols:


a. Network
b. Transport
c. Session
d. Application
Answer: (b) Transport

5. The __________________ layer provides a security based connection:


a. Transport
b. Application
c. Session
d. Network
Answer: (a) Transport
6. WOT reduces the ________ of HTTP:
a. Load
b. Overload
c. Overhead
d. Overrun
Answer: (c) Overhead
7. In which message format is the Statue line present?
a. Response message
b. Request message
c. Both response and request
d. Neither response nor request
Answer: (a) Response message
8. Which type of elements helps in streaming XMPP?
a. XHL
b. XPL
c. MPL
d. XML
Answer: (d) XML
9. XMPP supports __________.
a. Jabber ID
b. Federation
c. Foundation
d. Structured data
Answer: (b) Federation
10. The Buffer overrun could be reduced using:
a. Data integrity
b. Byte orientation
c. Flow control
d. Traffic control
Answer: (c) Flow control

11. MAC addresses is used in the form of ________.


a. IP addresses
b. Network address
c. Burned in address
d. Hardware address
Answer: (b) Network addresses

12. The address of the original IEEE 802 MAC comes from ___________.
a. Http
b. Ethernet address
c. IP address
d. MAC address
Answer: (b) Ethernet address
13. Gateway provides the connection between _________ and _________.
a. Controller and device
b. Network and Controller
c. Network and Cloud
d. Cloud and Controller
Answer: (d) Cloud and Controller
14. ___________ introduced the Wind River:
a. Intel
b. IBM
c. Syntel
d. Tech Mahindra
Answer: (a) Intel
15. The __________ transportation brings some new control:
a. Building Automation
b. Smart Energy
c. Industrial automation
d. Route Navigation
Answer: (a) Building Automation
16. The XMPP implementation utilises ______________.
a. Gaming
b. CoAP
c. Polling
d. Email
Answer: (c) Polling

17. XMPP uses the ________ architecture:


a. Public/subscriber
b. Message
c. Centralized client-server
d. Decentralized client-server
Answer: (d) Decentralized client-server

18. IRC is an abbreviation for __________:


a. Interconnect Reduce Chat
b. Internet Relay Chat
c. Interconnection Relay Chat
d. Internet Reduce Chat
Answer: (b) Internet Relay Chat
19. The Network layer protocol is present in the _____________.
a. Bridges
b. Packets
c. Switches
d. Host
Answer: (d) Host
20. The ________ filtering is a security measure on various wireless networks:
a. IP
b. OUI
c. MAC
d. NIC
Answer: (c) MAC

PHP Multiple-Choice Questions


1. In PHP, the variable name starts with:
a. # (Hash)
b. & (Ampersand)
c. $ (Dollar)
d. ! (Exclamation)
Answer: (c) $ (Dollar)
2. In PHP, out of the following, which one is NOT a variable scope?
a. Global
b. Static
c. Local
d. Extern
Answer: (d) Extern
3. Which of these is the correct way in which we can add a comment in PHP?
a. // ……
b. /* …… */
c. & …… &
d. Both (a) and (b)
Answer: (d) Both (a) and (b)
4. In PHP, which of these is the use of the strlen() function?
a. It returns the string’s type
b. It returns the string’s length
c. It returns the string’s value
d. It returns string’s both type and value
Answer: (b) It returns the string’s length
5. In PHP, which of these starts with a double underscore (__)?
a. Default constants
b. Magic constants
c. User-defined constants
d. Inbuilt constants
Answer: (b) Magic constants
6. In PHP, which of these is used for concatenation?
a. * (Asterisk)
b. + (plus)
c. append()
d. . (dot)
Answer: (d) . (dot)
7. In PHP, which of these is the correct way in which we can create a function?
a. New_function myFunction()
b. Function myFunction()
c. Create myFunction()
d. None of the above
Answer: (b) Function myFunction()
8. In PHP, which of these is the correct way in which we can define a variable?
a. $variable name as value;
b. $variable_name = value
c. $variable_name = value;
d. $variable name = value;
Answer: (c) $variable_name = value;

9. In PHP, which of these functions is used to find various files?


a. fold()
b. file()
c. glob()
d. None of the above
Answer: (c) glob()

10. In PHP, which of these functions is used to get any ASCII value of the given character?
a. chr()
b. ascii()
c. asc()
d. val()
Answer: (a) chr()
11. Which of these functions is used for sorting an array in a descending order?
a. rsort()
b. dsort()
c. asrot()
d. sort()
Answer: (a) rsort
12. In PHP, which of these do we use to end a statement?
a. ; (semicolon)
b. . (dot)
c. / (slash)
d. ! (exclamation)
Answer: (a) ; (semicolon)
13. In PHP, what is the correct way in which we can print “Hello World”?
a. write(“Hello World”);
b. echo “Hello World”;
c. “Hello World”;
d. None of the above
Answer: (b) echo “Hello World”;
14. Out of the following functions in PHP, which of these is used to compress a string?
a. zip_compress()
b. compress()
c. zip()
d. gzcompress()
Answer: (d) gzcompress()

15. Out of the following functions, which one converts a string to all uppercases?
a. strtoupper()
b. struppercase()
c. uppercase()
d. upper()
Answer: (a) strtoupper()

16. In PHP, _____________ is a function that can be used for concatenating array elements for the
formation of a single delimited string:
a. concat()
b. implode()
c. concatenate()
d. explode()
Answer: (b) implode()
17. The output of this program would be:
<?php
echo ucwords(“visit us at thinkLearn.com”);
?>
a. Visit us at thinkLearn.com
b. visit us at thinkLearn.com
c. Visit Us At ThinkLearn.com
d. Visit us at ThinkLearn.com
Answer (c) Visit Us At ThinkLearn.com
18. The output of the program mentioned below would be:
<?php
$a = array(16, 5, 2);
echo array_product($a);
?>
a. 32
b. 80
c. 1652
d. 160
Answer: (d) 160

19. Which of these PHP functions would perform the conversion of an English text datetime into the
Unix timestamp?
a. strtotime()
b. str_to_time()
c. strtodate()
d. None of the above
Answer: (a) strtotime()
20. In PHP, which of the following functions would return the time of the sunrise on a particular day
and at a particular location?
a. sunrise()
b. date_sunrise()
c. date-sunrise()
d. None of the above
Answer: (b) date_sunrise()
JavaScript Multiple-Choice Questions
1. The ” var” and “function” are known as _____________.
a. Data types
b. Keywords
c. Prototypes
d. Declaration statements
Answer: (d) Declaration statements
2. Which of these is the correct way in which we can call the JavaScript code?
a. Triggering Event
b. Preprocessor
c. Function/Method
d. RMI
Answer: (c) Function/Method
3. Which of these functions of the Number Object would format a number with different numbers of
digits to the decimal’s right?
a. toFixed()
b. toExponential()
c. toLocaleString()
d. toPrecision()
Answer: (a) toFixed()
4. Out of the following functions of the string object, which one would return the character in any
string via the specified number of characters starting at a specified position?
a. search()
b. substr()
c. split()
d. slice()
Answer: (b) substr()
5. Look at the snippets given below and check the one in which the variable “a” isn’t equal to the
“NULL”.
a. if (a!)
b. if(a!=null)
c. if(a!==null)
d. if(a!null)
Answer: (c) if(a!==null)
6. In JavaScript, what do we use for calling the expression for function definition?
a. Function literal
b. Function prototype
c. Function declaration
d. Function calling
Answer: (a) Function literal
7. Which of these is used in JavaScript for calling a method or a function?
a. Functional Expression
b. Property Access Expression
c. Primary Expression
d. Invocation Expression
Answer: (d) Invocation Expression
8. Which of these operators are used for checking if a specific property exists?
a. in
b. within
c. exist
d. exists
Answer: (a) in

9. “The expression that can appear legally on an assignment expression’s left side” is a common
explanation for variables, elements of arrays, and properties of objects. These are known as
__________:
a. Prototypes
b. Properties
c. Lvalue
d. Definition
Answer: (c) Lvalue

10. Which of these is a correct output for the JavaScript code given below?
string X= “Hey”;
string Y=”There”;
alert(X+Y);
a. Hey There
b. Hey_There
c. HeyThere
d. undefined
Answer: (c) HeyThere

11. Which of these is known as the Equality operator used for checking whether both the values are
equal?
a. =
b. ==
c. ===
d. &&
Answer: (b) ==
12. In case a value of an operator is NULL, then the unary operator would return the ____________
typeof.
a. object
b. boolean
c. string
d. undefined
Answer: (d) undefined
13. Which of these is not a keyword?
a. debugger
b. use strict
c. with
d. if
Answer: (b) use strict
14. Which of these symbols is used to create comments in JavaScript?
a. //
b. \\
c. \* */
d. \* *\
Answer: (a) //
15. In the line of code given below, what will the “datatype” written in brackets be called?
article[datatype]=assignment_value;
a. An object
b. A String
c. Floating point
d. An integer
Answer: (b) A String
16. In the line of code given below, the prototype represents the _____________.
functionx(){};
a. Prototype of a function
b. Function x
c. Not valid
d. A custom constructor
Answer: (a) Prototype of a function
17. Which of these methods or operators are used for identifying an array?
a. isarrayType()
b. ===
c. ==
d. Typeof
Answer: (a) isarrayType()
18. A function’s execution would stop whenever a program control would encounter the _________
statement in the function’s body.
a. goto statement
b. break statement
c. continue statement
d. return statement
Answer: (d) return statement
19. Which of these codes is equivalent to the code given below?
a.x(g,h);
a. a [ “x” ] ( g , h );
b. x (g) &&a.x (h);
c. x( g&&h );
d. a (x )[ “g” , “h” ];
Answer: (a) a [ “x” ] ( g , h );
20. Which of these keywords is used to define various functions in JavaScript?
a. function
b. main
c. init
d. Void
Answer: (a) function

HTML Multiple-Choice Questions


1. Which of these elements in HTML can be used for making a text bold?
a. <a>
b. <pre>
c. <br>
d. <b>
Answer: (d) <b>
2. Which tag do we use in HTML for inserting a line-break?
a. <a>
b. <br>
c. <b>
d. <pre>
Answer: (b) <br>
3. How to create a hyperlink in HTML?
a. <a link = “www.thinkandlearn.com”> thinkandlearn.com </a>
b. <a> www.thinkandlearn.com <thinkandlearn.com /a>
c. <a href = “www.thinkandlearn.com”> thinkandlearn.com </a>
d. <a url = “www.thinkandlearn.com” thinkandlearn.com /a>
Answer: (c) <a href = “www.thinkandlearn.com”> thinkandlearn.com </a>
4. In HTML, how do we insert an image?
a. <img src = “jtp.png” />
b. <img href = “jtp.png” />
c. <img link = “jtp.png” />
d. <img url = “jtp.png” />
Answer: (a) <img src = “jtp.png” />
5. Which tag do we use to define the options present in the drop-down selection lists?
a. <list>
b. <option>
c. <dropdown>
d. <select>
Answer: (b) <option>
6. In HTML, which of these would add a background color?
a. <marquee bgcolor = “plum”>
b. <marquee bg color: “plum”>
c. <marquee color = “plum”>
d. <marquee bg-color = “plum”>
Answer: (a) <marquee bgcolor = “plum”>

7. Which HTML tag do we use to display text along with a scrolling effect?
a. <div>
b. <scroll>
c. <marquee>
d. None of the above
Answer: (c) <marquee>

8. In HTML, we use the <hr> tag for ___________.


a. horizontal ruler
b. new line
c. new paragraph
d. vertical ruler
Answer: (a) horizontal ruler
9. What is the correct way of sending mail in HTML?
a. <mail ab@b</mail>
b. <a href = “ab@b”>
c. <a href = “mailto: ab@b”>
d. None of the above

Answer: (c) <a href = “mailto: ab@b”>

10. In HTML, the tags are __________.


a. in upper case
b. case-sensitive
c. in lowercase
d. not case sensitive
Answer: (d) not case sensitive

11. Which of these tags helps in the creation of a drop-down box or a combo box?
a. <input type = “dropdown”>
b. <list>
c. <ul>
d. <select>
Answer: (d) <select>
12. Which tag is used in HTML5 for the initialization of the document type?
a. <Doctype HTML>
b. <!DOCTYPE html>
c. <Doctype>
d. <\Doctype html>
Answer: (b) <!DOCTYPE html>
13. What is the correct way in which we can start an ordered list that has the numeric value count of
5?
a. <ol type = “1” start = “5”>
b. <ol type = “1” num = “5”>
c. <ol type = “1” begin = “5”>
d. <ol type = “1” initial = “5”>
Answer: (a) <ol type = “1” start = “5”>
14. Which one is the HTML document’s root tag?
a. <head>
b. <body>
c. <title>
d. <html>
Answer: (d) <html>
15. Which HTML tag do we use for displaying the power in the expression, (x² – y²)?
a. <p>
b. <sub>
c. <sup>
d. None of the above
Answer: (c) <sup>
16. In HTML, the correct way of commenting out something would be using:
a. ## and #
b. <!– and –>
c. </– and -/->
d. <!– and -!>
Answer: (b) <!– and –>
17. How does the <bdo> element work?
a. changes direction of the ltr text
b. override the direction of the rtl text
c. stops writing in current direction of text
d. override the text direction
Answer: (d) override the text direction

18. What attribute do we use for data binding?


a. datasrc
b. mayscript
c. name
d. datafld
Answer: (a) datasrc

19. The non-ASCII characters would be replaced with ________ by the process of URL encoding.
a. “+”
b. “%”
c. “&”
d. “*”
Answer: (b) “%”

20. Which of these entities is not defined in the XML?


a. apos
b. quot
c. copy
d. gt
Answer: (c) copy
21. The ____________ entity is used for the arrow.
a. &zeta
b. &crarr
c. &oelig
d. &upsih
Answer: (b) &crarr
22. Which of these doesn’t support the MP3 format?
a. Opera
b. Safari
c. Chrome
d. Firefox
Answer: (a) Opera
23. Which one of these helps us test if an old browser supports the geolocation?
a. Modernizr.geolocation
b. Modernizr
c. Modernizr.js
d. Navigator.userAgent
Answer: (d) Navigator.userAgent
24. Which of these classes helps make a text stand out?
a. .small
b. .lead
c. .text-center
d. .text-left
Answer: (b) .lead
25. What do we call after initializing a plug-in to get A scripting interface?
a. NP_GetMIMEDescription
b. NP_Initialize
c. NPP_GetValue
d. NP_GetValue
Answer: (c) NPP_GetValue
Software Engineering Multiple-Choice Questions
1. Which of these does not affect different types of software as a whole?
a. Security
b. Business and social change
c. Flexibility
d. Heterogeneity
Answer: (c) Flexibility
2. The 4GT Model acts as a package of ______________.
a. Software Tools
b. Software Programs
c. CASE tools
d. None of the above
Answer: (a) Software tools

3. ___________ originally proposed the spiral model.


a. Pressman
b. Royce
c. IBM
d. Barry Boehm
Answer: (d) Barry Boehm

4. Out of the following, which one is not a workbench tool for Requirement Management?
a. RDD 100
b. Rational Suite
c. DOORS
d. RTM
Answer: (b) Rational Suite
5. In system modelling, which model depicts a system’s static nature?
a. Data Model
b. Structural Model
c. Context Model
d. Behavioural Model
Answer: (b) Structural Model
6. Source code translation and Program modularisation are the activities of_____________.
a. Reverse engineering
b. Forward Engineering
c. Reengineering and Reverse Engineering
d. Reengineering
Answer: (d) Reengineering
7. Which of these reliability requirements is concerned with maintaining various system copies?
a. Ambiguous Requirements
b. Redundancy Requirements
c. Recovery Requirements
d. Checking Requirements
Answer: (c) Recovery Requirements
8. The worst form of module cohesion is___________.
a. Coincidental Cohesion
b. Functional Cohesion
c. Temporal Cohesion
d. Logical Cohesion
Answer: (a) Coincidental Cohesion
9. How does the implementation of generalisation occur in Object-Oriented programming
languages?
a. Encapsulation
b. Abstract Classes
c. Inheritance
d. Polymorphism
Answer: (c) Inheritance
10. Out of these early OOD methods, which one incorporates both a “macro development process”
and a “micro development process.”?
a. Wirfs-Brock method
b. Booch method
c. Coad and Yourdon method
d. Rumbaugh method
Answer: (b) Booch Method
11. Out of these web engineering metrics, which one measures the relatedness extent between
multiple web pages?
a. Static Content Objects Numbers
b. Dynamic Content Objects Numbers
c. Internal Page Links Number
d. Web Page Similarity
Answer: (d) Web Page Similarity

12. Which one isn’t a stage of the COCOMO-II?


a. Model of Application Composition estimation
b. Model of Early design estimation
c. Model of Post architecture estimation
d. Model of Comprehensive cost estimation
Answer: (b) Model of Early design estimation
13. Which one isn’t an approach to estimate the cost of the software?
a. Heuristic
b. Empirical
c. Critical
d. Analytical
Answer: (c) Critical
14. The aviation industry follows which of these standards?
a. RTCADO-178B
b. CTRADO-172B
c. CTCADO-178B
d. RTRADO-178B
Answer: (a) RTCADO-178B
15. We generally use the ___________ for Software Maintenance.
a. Integration Testing
b. Unit Testing
c. System Testing
d. Regression Testing
Answer: (d) Regression Testing
16. The language-processing system performs the translation of an XML data description to
a___________.
a. alternative XML representation
b. machine code
c. software module
d. alternative XML representation and machine code
Answer: (d) alternative XML representation and machine code

17. What establishes the profile of end-users of the system?


a. system image
b. mental image
c. user’s model
d. design model
Answer: (c) user’s model

18. Which is a stimuli category?


a. Management stimuli
b. Hardware stimuli
c. Software stimuli
d. Periodic stimuli
Answer: (d) Periodic stimuli
19. An object does NOT provide this service:
a. Deactivating & Activating Objects
b. Files implementing the identified entities in the ERD
c. Registering object implementation
d. Security features
Answer: (b) Files implementing the identified entities in the ERD

20. Out of these, which one isn’t a business process’s example?


a. purchasing services
b. testing software
c. designing a new product
d. hiring an employee
Answer: (b) testing software

21. Which one of these is a data problem?


a. record organisation problem
b. hardware problems
c. loss of comments
d. heavy computational demands
Answer: (a) record organisation problems

22. The FIT (Failure In Time) is another way in which one can REPORT __________.
c. MTBF
d. MTSF
a. MTTF
b. MTTR
Answer: (a) MTBF
23. What do we mean by Six Sigma?
a. A widely used strategy to implement statistical quality assurance
b. Six standard deviations
c. A widely used strategy that maintains statistical quality assurance and six standard deviations
d. An FTR (Formal Technical Review) guideline for inspection or a quality walkthrough
Answer: (c) A widely used strategy that maintains statistical quality assurance and six standard
deviations
24. Name an evaluation technique to assess the quality of test cases.
a. Validation
b. Mutation analysis
c. Performance analysis
d. Verification
Answer: (b) Mutation analysis
25. Code is checked in which type of testing?
a. White box testing
b. Black box testing
c. Green box testing
d. Red box testing
Answer: (a) White box testing

Data Structure Multiple-Choice Questions


1. A queue follows _________:
a. LIFO principle
b. FIFO principle
c. Linear tree
d. Ordered array
Answer: (b) FIFO principle

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)
Answer: (a) O(n)

3. Which of these is a postfix expression?


a. a+b-c
b. +ab
c. abc*+de-+
d. a*b(c+d)
Answer: (c) abc*+de-+
4. Which data structure do we use for testing a palindrome?
a. Heap
b. Tree
c. Priority queue
d. Stack
Answer: (d) Stack
5. Which of these will form an inversion in this given array?
arr = {2,8,5,3}
a. (2,8)
b. (8,5), (8,3)
c. (2,8), (2,5), (1,3)
d. (8,5), (8,3), (5,3)
Answer: (d) (8,5), (8,3), (5,3)
6. Which one isn’t the property of the XOR lists?
a. X⊕0 = X
b. X⊕X = 0
c. X⊕0 = 1
d. (X⊕Y)⊕Z = X⊕(Y⊕Z)
Answer: (c) X⊕0 = 1
7. The tango tree is a type of:
a. Binary Search Tree
b. K-ary Tree
c. Ternary Tree
d. AVL Tree
Answer: (a) Binary Search Tree
8. In an AA-tree, we can remove a left horizontal link by:
a. inserting a new element
b. deleting both the elements
c. performing left rotation
d. performing right rotation
Answer: (d) performing right rotation
9. We can use a self–balancing binary search tree for implementing the:
a. Hash table
b. Priority queue
c. Heap sort and Priority queue
d. Heap sort
Answer: (b) Priority Queue

10. A splay operation refers to:


a. the removal of leaf node
b. the movement of root to leaf
c. the movement of a node to root
d. the movement of parent node to a child node’s down
Answer: (c) the movement of a node to root
11. Out of these, which one is NOT true about a 2-3 tree?
a. it is perfectly balanced
b. the leaves are always at the same level
c. it refers to a B-tree of the order 3
d. postorder traversal would yield the elements in a sorted order
Answer: (d) postorder traversal would yield the elements in a sorted order
12. How do we define the Ackermann’s function?
a. for i<1, A(1,i) = i+1
b. for i = j, A(i,j) = i+j
c. for i>=j, A(i,j) = i+j
d. for i>=1, A(1,i) = i+1
Answer: (d) for i>=1, A(1,i) = i+1

13. A recursive implementation would presumably fail in skew heaps because:


a. lack of stack space
b. time complexity
c. these heaps are self adjusting
d. efficiency gets reduced
Answer: (a) lack of stack space

14. Which operation can we NOT perform directly in a d-heap?


a. create
b. find
c. delete
d. insert
Answer: (b) find

15. The time does taken for the construction of suffix tree is:
a. Linear to the Length of Tree
b. Exponential to the Length of Tree
c. O (M!)
d. O (log M)
Answer: (a) Linear to the Length of Tree
16. The best technique for handling collision is:
a. Separate chaining
b. Double hashing
c. Linear probing
d. Quadratic probing
Answer: (d) Quadratic probing
17. 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
Answer: (c) it must cause less collisions
18. What is the time complexity for checking if an undirected graph with E edges and V vertices is
Bipartite, given its adjacency matrix?
a. O(E)
b. O(V)
c. O(E*E)
d. O(V*V)
Answer: (d) O(V*V)
19. 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
Answer: (b) Closer to 1
20. The polynomial-time graph manipulation algorithms can’t implement which of these logical
operations using the Binary Decision Diagrams?
a. Tautology Checking
b. Negation
c. Disjunction
d. Conjunction
Answer: (a) Tautology Checking

DBMS MCQ Questions


1. ____________ offers the ability to query the data and insert, alter, and delete tuples.
a. Transaction Control Language (TCL)
b. Data Control Language (DCL)
c. Data Definition Language (DDL)
d. Data Manipulation Language (DML)
Answer: (d) Data Manipulation Language (DML)
2. We can add or remove the user IDs using which of these fixed roles?
a. db_setupadmin
b. db_securityadmin
c. db_accessadmin
d. db_sysadmin
Answer: (c) db_accessadmin
3. Section (sect name, wing, expenses) and Student (student_ID, name, sect name, fees).
Here in both of these relations, the sect_name attribute appears commonly. In this case, using
common attributes in the relation schema is a way in which we can relate the ___________
relations.
a. Tuple of common
b. Attributes of common
c. Attributes of distinct
d. Tuple of distinct
Answer: (d) Tuple of distinct
4.
SELECT title
FROM teacher
WHERE fees <= 200000 AND fees >= 80000;
We can replace this query by which of these?
a.
SELECT title
FROM teacher
WHERE fees BETWEEN 200000 AND 80000;
b.
SELECT title
FROM staff
WHERE fees BETWEEN 80000 AND 200000;
c.
SELECT title
FROM staff
WHERE fees <= 80000 AND fees >=200000;
d.
SELECT title
FROM teacher
WHERE fees BETWEEN 80000 AND 200000;
Answer: (d)
SELECT title
FROM teacher
WHERE fees BETWEEN 80000 AND 200000;
5. Which symbol do we use in place of the except?
a. ~
b. ¬
c. V
d. ^
Answer: (b) ¬
6. What is an alternative name for a weak entity?
a. Dominant
b. Owner
c. Child
d. All of the above
Answer: (c) Child
7. Assume a relation X (M, N, O, P, Q) that has the following functional dependencies:
MNO -> PQ and
P -> MN
The total number of superkeys of X would be:
a. 12
b. 10
c. 7
d. 2
Answer: (b) 10
8. Fifth Normal form is concerned with:
a. Join dependency
b. Domain-key
c. Multivalued dependency
d. Functional dependency
Answer: (a) Join dependency
9. The _____ system does not require a password to travel across the internet.
a. Response
b. Challenge-response
c. Manipulation
d. Readable
Answer: (b) Challenge-response
10. We can force a log switch by using:
a. ALTER SYS LOGFILES
b. ALTER SYSTEM SWITCH LOGS
c. ALTER SYSTEM LOG
d. ALTER SYSTEM SWITCH LOGFILE
Answer: (d) ALTER SYSTEM SWITCH LOGFILE
11. When recovering from a failure:
a. examination of each pair of physical blocks occurs
b. examination of a specified pair of physical blocks occurs
c. examination of the first pair of physical blocks occurs
d. none of the above
Answer: (a) examination of each pair of physical blocks occurs
12. The Optical disk technology utilises:
a. RAID
b. A laser beam
c. DAT
d. Helical scanning
Answer: (a) RAID
13. The node pointing towards another node in a B+ tree is known as:
a. External node
b. Leaf node
c. Internal node
d. Final node
Answer: (c) Internal node

14. Identify the statement among the following that is FALSE:


a. The relation in which all keys have only a single attribute is in its 2NF
b. A relation that has two attributes is in its BCNF
c. The prime attribute can depend transitively on any key in the case of a relation that is in its BCNF
d. The prime attribute can depend transitively on any key in the case of a relation that is in its 3 NF
Answer: (c) The prime attribute can depend transitively on any key in the case of a relation that is in
its BCNF

15. A transaction enters into its _______ state when it finishes the final statement.
a. Abort state
b. Partially committed state
c. Committed state
d. Active state
Answer: (b) Partially committed state
16. An operator shall provide the transaction file’s name, and the file consisting of the edited
transactions (that are ready for execution) must be called:
a. Trans. Exe
b. Batch. Exe
c. Edit. Exe
d. Opt. Exe
Answer: (d) Opt. Exe
17. In crabbing, the protocol locking goes:
a. down the tree, back up
b. up the tree, back down
c. down the tree, releases
d. up the tree, releases
Answer: (a) down the tree, back up
18. The name of the very first microprocessor chip available commercially was:
a. Intel 4004
b. Intel 639
c. Intel 308
d. Motorola 33
Answer: (a) Intel 4004
19. The easiest way in which we can transfer control is when the old backup site sends __________
to the old primary.
a. Redo logs
b. Primary Logs
c. Undo Logs
d. All of the above
Answer: (b) Primary Logs
20. A linear search algorithm’s complexity would be:
a. O(n2)
b. O(n log n)
c. O(n)
d. O(log n)
Answer: (c) O(n)

C Programming MCQ Questions


1. 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

Answer: (c) 97.000000


2. Which of these is NOT a relational or logical operator?
a. =
b. ||
c. ==
d. !=

Answer: (a) =

3. 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

Answer: (a) Syntax error

4. Out of the following, which one is not valid as an if-else statement?


a. if ((char) x){}
b. if (x){}
c. if (func1 (x)){}
d. if (if (x == 1)){}

Answer: (d) if (if (x == 1)){}

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


a. while
b. for
c. if-else
d. do-while
Answer: (c) if-else
6. The output of the C code mentioned below would be:
#include <stdio.h>
int main()
{
int a = 0, b = 0;
l1: while (a < 2)
{
a++;
while (b < 3)
{
printf(“find\n”);
goto l1;
}
}
}
a. loop loop find loop
b. Infinite error
c. find loop
d. Compile time loop
Answer: (c) find loop
7. The global variables are ____________.
a. External
b. Internal
c. Both External and Internal
d. None of the above
Answer: (a) External
8. 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
Answer: (d) All of the above
9. The #include <stdio.h> is a ______________.
a. Inclusion directive
b. File inclusion directive
c. Preprocessor directive
d. None of the above
Answer: (c) Preprocessor directive
10. 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
Answer: (d) All of the above

11. 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
Answer: (a) type_of_return name_of_function (argument type);

12. 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
Answer: (b)
int sum(int x, int y)
{return (x + y);}

13. 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
Answer: (c) A pointer “p” to an array
14. The output of the C code mentioned below would be:
#include <stdio.h>
struct employee
{
int id;
char rank[5];
}
void main()
{
struct employee e;
s.no = 30;
printf(“howdy”);
}
a. hello
b. Compile-time error
c. 5, 30
d. Varies
Answer: (b) Compile-time error
15. We can test the presence of a loop in a linked list by ________.
a. Comparing the node’s address with the address of all the other nodes
b. Travelling the list. In case we encounter the NULL, then no loop exists
c. Comparing the stored values of a node with the values present in all the other nodes
d. None of the above
Answer: (a) Comparing the node’s address with the address of all the other nodes
16. Determine what’s true for x, if we define x as “int *x[10];”?
a. This definition will only allocate 10 pointers but will not initialize them
b. The initialization must be explicitly performed
c. The definition will only allocate 10 pointers but will not initialize them. Also, the initialization has to
be explicitly performed
d. Error
Answer: (c) The definition will only allocate 10 pointers but will not initialize them. Also, the
initialization has to be explicitly performed
17. 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”;
Answer: (c) string p = “Hello”;
18. We can determine the size of a union with the help of the size of __________.
a. The sum of all the members’ sizes
b. The biggest member of the union
c. The last member of the union
d. The first member of the union
Answer: (b) The biggest member of the union
19. How much percentage of memory will be saved if we use bit-fields for the given C structure as
compared to when we don’t use bit-fields for this very structure? (Assume the size of int to be 4).
struct temp
{
int m : 1;
int n : 2;
int o : 4;
int p : 4;
}s;
a. 33.3%
b. 75%
c. 25%
d. 50%
Answer: (b) 75%
20. Out of the following snippet, which one will generate random numbers effectively?
a. rand(time(NULL));
b. rand(10);
c. rand();
d. all of the above
Answer: (c) rand();
21. We can achieve the modulus for float by:
a. x % y
b. modulus(x, y);
c. fmod(x, y);
d. mod(x, y);
Answer: (c) fmod(x, y);
22. __________ tells a compiler that the data would be defined somewhere and it would be
connected to the linker.
a) variable
b) yvals
c) errno
d) extern
Answer: (d) extern
23. The definition of the function abort() is in which header file?
a) stdlib.h
b) assert.h
c) stdio.h
d) stdarg.h
Answer: (a) stdlib.h
24. 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
Answer: (d) Causes a preprocessor to report some fatal error
25. _____________ is a condition in which the memory is dynamically reserved but isn’t accessible
to any program.
a) Pointer Leak
b) Frozen Memory
c) Dangling Pointer
d) Memory Leak
Answer: (a) Memory Leak

Operating System MCQ Questions


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
Answer: (a) the total number of blocks that have been used for the index, size of all the blocks
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
Answer: (a) Save process data
3. Out of these page replacement algorithms, which one suffers from Belady’s anomaly?
a. LRU
b. FIFO
c. Both LRU and FIFO
d. Optimal Page Replacement
Answer: (b)FIFO
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
Answer: (a) Fewer page faults occur
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. 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
Answer: (c) There would no longer be a requirement for hardware support for memory management
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
Answer: (a) An illusion of a large main memory

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
Answer: (b) 15 bits
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
Answer: (a) The processes on the system access pages and not memory frequently
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
Answer: (a) The requested page isn’t in the memory
10. Consider a computer that uses 32–bit physical address, 46–bit virtual address, along with a page
table organisation that is three-level. Here, the base register of the page table stores the T1 (first–
level table) base address, which occupies exactly one page. Every entry of the T1 stores the T2
(second-level table) page’s base address. Similarly, every entry of T2 stores the T3 (third-level table)
page’s base address and every entry of T3 stores a PTE (page table entry). The size of PTE is 32
bits. In the computer, the processor has a 1 MB 16 way virtually indexed set-associative physically
tagged cache. If the size of the cache block is 64 bytes, then what is the size of a page in this
computer in Kilobytes?
a. 4
b. 2
c. 16
d. 8
Answer: (d) 8
11. Consider that the page fault service time in a computer is 10ms and the average memory access
time is 20ns. If, in case, it generates a page fault every 10^6 memory accesses, then what would be
the effective access time for this memory?
a. 30ns
b. 21ns
c. 35ns
d. 23ns
Answer: (a) 30ns
12. FIFO policy is used in a system for page replacement. It consists of 4-page frames, and no
pages loaded, to start with. This system initially accesses 100 separate pages in a particular order. It
then accesses these same 100 pages. The difference is that now they are in the reverse order.
Considering this, how many page faults would occur here?
a. 192
b. 195
c. 196
d. 197
Answer: (c) 196

13. 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
Answer: (a) Page frame number
14. When translating a virtual address to a physical address, a multilevel page table is always a
preference as compared to a single level page because it:
a. Helps in the reduction of the total page faults in the page replacement algorithms
b. Reduces the total memory access time for reading or writing a memory location
c. Helps in the reduction of the page table size required for implementing a process’s virtual address
space
d. Is required by the lookaside buffer translation
Answer: (c) Helps in the reduction of the page table size required for implementing a process’s
virtual address space
15. Consider a processor that uses 32-bit virtual addresses, 36-bit physical addresses, and a 4 KB
page frame size. Each page table entry is 4 bytes in size. Here, a page table of three-level is used
for the translation of virtual to a physical address. The virtual address, in this case, is used as
follows:
• Bits 12-20 are utilised for indexing into the page table of the third level
• Bits 21-29 are utilised for indexing into the page table of the second level
• Bits 30-31 are utilised for indexing into the page table of the first level, and • Bits 0-11 are utilised
as an offset within the page.
Thus, the total number of bits needed to address the next level page frame or page table for the first-
level, second-level and third-level page table entry are respectively:
a. 25, 25 and 24
b. 24, 24 and 20
c. 24, 24 and 24
d. 20, 20 and 20
Answer: (c) 24, 24 and 24
16. Consider that a virtual memory system uses a FIFO page replacement policy. For a process, it
allocates a fixed number of frames. Now consider these statements:
A: An increase in the number of page frames that are allocated to a
process sometimes leads to an increase in the page fault rate.
B: A few programs do not display the locality of reference.
Which one of these statements is TRUE?
a. A is false, but B is true
b. Both A and B are false
c. Both A and B are true, and B is the reason for A
d. Both A and B are true, but B isn’t the reason for A
Answer: (d)Both A and B are true, but B isn’t the reason for A
17. 3 page frames have been allocated to a process. Here, we assume that none of the process’s
pages is available initially in the memory, and the process creates this sequence of page references:
1, 2, 1, 3, 7, 4, 5, 6, 3, 1 (reference string). If an optimal page replacement policy is utilised, then
how many page faults would occur for the reference string mentioned above?
a. 10
b. 9
c. 8
d. 7
Answer: (d) 7
18. Consider paging hardware that has a TLB. Let us assume that the page table and the pages are
in their physical memory. Searching the TLB takes 10 milliseconds, and accessing the physical
memory takes 80 milliseconds. In case the TLB hit ratio is 0.6, then the effective memory access
time is _________ (in milliseconds).
a. 124
b. 122
c. 120
d. 118
Answer: (b) 122

19. A system that has 32-bit virtual addresses & 1 KB page size, it is not practical to use one-level
page tables for translating virtual to a physical address, due to:
a. a large amount of external fragmentation
b. a large amount of internal fragmentation
c. a large computation overhead in the process of translation
d. a large memory overhead when maintaining the page tables
Answer: (d)a large memory overhead when maintaining the page tables

20. Which of these isn’t an advantage of using dynamically linked, shared libraries, as compared to
statically linked libraries?
a. Faster program startup
b. The existing programs do not need to be re-linked so as to take advantage of the newer library
versions
c. Lesser page fault rate in a system
d. Smaller sizes of executable files

Answer: (a) Faster program startup


21. Out of all the following, which one isn’t a form of memory?
a. translation lookaside buffer
b. instruction opcode
c. instruction register
d. instruction cache
Answer: (b)instruction opcode

22. The process of dynamic linking can generate security concerns because:
a. Linking is insecure
b. The cryptographic procedures aren’t available for the process of dynamic linking
c. Security is dynamic
d. The path of the searching dynamic libraries isn’t known until the runtime
Answer: (b)The cryptographic procedures aren’t available for the process of dynamic linking
23. Which of these is a false statement?
a. The virtual memory translates a program‘s address space into their physical memory address
space.
b. The virtual memory allows every program to exceed the primary memory’s size.
c. The virtual memory leads to an increase in the degree of multiprogramming
d. The virtual memory leads to a reduction of the context switching overhead
Answer: (d)The virtual memory leads to a reduction of the context switching overhead

24. ________ is the process in which load addresses are assigned to a program’s various parts, and
the code and date are adjusted in the program for the reflection of the assigned addresses.
a. Symbol resolution
b. Assembly
c. Parsing
d. Relocation
Answer: (d)Relocation

25. Which one of these is NOT shared by the same process’s threads?
a. Address Space
b. Stack
c. Message Queue
d. File Descriptor Table
Answer: (b)Stack

26. In the case of a particular Unix OS, every data block is 1024 bytes in size. Every node consists
of 10 direct data block addresses along with three additional addresses: one for a triple, one for
double, and one for a single indirect block. Each block here can consist of addresses for 128 blocks.
Out of the following, which one is the approximate maximum size of the files in a file system?
a. 16 GB
b. 8 GB
c. 2 GB
d. 512 MB
Answer: (c) 2GB

27. Which of these disk scheduling policies results in minimum head movement?
a. Circular scan
b. Elevator
c. FCS
d. None of the above
Answer: (a) Circular scan
28. Consider a hard disk that has 63 sectors/track. It has 10 platters each – 2 recording surfaces &
1000 cylinders. A sector’s address is displayed as a triple (c, h, s). Here, c refers to the cylinder
number, h refers to the surface number, and s refers to the sector number. The 0th sector here is
addressed as (0, 0, 0), then the 1st sector will be addressed as (0, 0, 1), and so on. According to
this, the address (400,16,29) would correspond to the sector number:
a. 505038
b. 505037
c. 505036
d. 505035
Answer: (b)505037
29. In a magnetic disk that consists of concentric circular tracks, its seek latency isn’t proportional
linearly to the seek distance, because of:
a. the use of arm scheduling policies that are unfair
b. a higher track capacity on the platter’s periphery
c. a starting and stopping inertia for arms
d. a non-uniform distribution of all the requests
Answer: (c) a starting and stopping inertia for arms
30. Out of the following statements, which ones are NOT true about asynchronous and synchronous
I/O?
a. In a synchronous I/O, any process that is waiting for the I/O’s completion is woken up by the
Interrupt Service Routine that is invoked after the I/O gets completed.
b. The processes that make the synchronous I/O call wait until I/O gets completed, but the
processes that make an asynchronous I/O call don’t wait for the completion of the I/O.
c. In both asynchronous and synchronous I/O, an Interrupt Service Routine (ISR) is invoked after the
I/O is finally completed.
d. The ISR is invoked after completing the I/O in synchronous I/O. It does not do so in the case of
asynchronous I/O.
Answer: (d) The ISR is invoked after completing the I/O in synchronous I/O. It does not do so in the
case of asynchronous I/O.
31. The usage of some larger block size in a file system of a fixed block size leads to:
a. a better disk space utilisation but poorer disk throughput
b. a poorer disk space utilisation and poorer disk throughput
c. a poorer disk space utilisation but better disk throughput
d. a better disk space utilisation and better disk throughput
Answer: (c) a poorer disk space utilisation but better disk throughput
32. Out of the following, which one needs a device driver?
a. Main memory
b. Disk
c. Register
d. Cache
Answer: (b)Disk
33. The onboard memory of a graphics card is about 1 MB. Out of the modes mentioned below,
which one does the card not support?
a. A resolution of 1600 x 400 and a 17-inch monitor with 256 colours.
b. A resolution of 1600 x 400 and a 14-inch monitor with 16 million colours.
c. A resolution of 800 x 400 and a 17-inch monitor with 16 million colours.
d. A resolution of 800 x 800 and a 14-inch monitor with 256 colours.
Answer: (b) A resolution of 1600 x 400 and a 14-inch monitor with 16 million colours.
34. Out of the following interrupt handling mechanisms and DMA transfer modes, which one enables
the highest bandwidth for I/O:
a. Polling interrupts and Transparent DMA
b. Vectored interrupts and Cycle-stealing
c. Vectored interrupts and Block transfer
d. Polling interrupts and Block transfer
Answer: (c) Vectored interrupts and Block transfer
35. Assume three processes with process IDs 0, 1, and 2, respectively. They have computed time
bursts of 2, 4, and 8 units, and all the processes arrive at time 0. Now consider the LRTF (longest
remaining time first) scheduling algorithm. In the case of LRTF, the ties are broken by prioritising the
process that has the lowest process ID. Here, the average turnaround time would be:
a. 16 units
b. 15 units
c. 14 units
d. 13 units

Answer: (d)13 units

36. Out of these statements, which ones are/is true?


P. The shortest remaining time in the first scheduling may lead to starvation
Q. Preemptive scheduling may lead to starvation
R. In terms of responsive time, Round robin is comparatively much better than FCFS
a. P only
b. P and R only
c. Q and R only
d. P, Q and R
Answer: (d)P, Q and R
37. An OS utilises the SRT or Shortest Remaining Time first process scheduling algorithm. Let us
consider the execution time and arrival time for these processes:
Process Arrival time Execution time
P1 : 0 20
P2 : 15 25
P3 : 30 10
P4 : 45 15
The total waiting time for the P2 process would be:
a. 55
b. 40
c. 15
d. 5
Answer: (c) 15
38. In a computer system that consists of n number of CPUs, the maximum processes that can exist
in the Ready State would be:
a. Independent of n
b. 2n
c. n^2
d. n
Answer: (a) Independent of n
39. Out of the following, which one is FALSE about Shortest Job First Scheduling (SJF)?
X1: It can lead to starvation
X2: It can lead to a minimum average waiting time
a. Only X1
b. Only X2
c. Neither X2 nor X1
d. Both X2 and X1
Answer: (c) Neither X2 nor X1
40. In a process, the following code is executed:
fork();
fork();
fork();
As a result, a total of _______ number of child processes will be created.
a. 8
b. 7
c. 4
d. 3
Answer: (b)7
41. The total time taken for switching between the user and the kernel modes of execution is t1,
while the total time taken for switching between two processes is t2. Out of the following, which one
is TRUE?
a. t2 > t1
b. t2 = t1
c. t2 < t1
d. We cannot say anything about the relation between t2 and t1
Answer: (a) t2 > t1
42. We can define a thread as a “lightweight process”. It is because an OS (operating system)
maintains much shorter data structures for a thread instead of a process. Concerning this, which of
the following statements is TRUE?
a. The Operating System maintains only the CPU register state on a per-thread basis
b. The OS does not maintain each thread’s separate stack
c. The Operating System does not maintain a virtual memory state on a per-thread basis
d. The Operating System maintains only accounting and scheduling information on a per-thread
basis
Answer: (c) The Operating System does not maintain a virtual memory state on a per-thread basis
43. Which one of these statements about kernel-level threads and user-level threads is FALSE?
a. The context switch time is comparatively longer for the kernel-level threads, as compared to the
ones for the user-level threads.
b. The user-level threads don’t require any support for hardware.
c. We can schedule the related kernel-level threads in a multi-processor system on different
processors.
d. When one kernel-level thread is blocked, then all the related threads will be blocked.
Answer: (d) When one kernel-level thread is blocked, then all the related threads will be blocked.
44. Which of these doesn’t interrupt a running process?
a. Power failure
b. Scheduler process
c. Timer
d. A device
Answer: (b)Scheduler process
45. Which of these need not be saved necessarily during context switching between various
processes?
a. Translation look-aside buffer
b. General-purpose registers
c. Program counter
d. None of the above
Answer: (a) Translation look-aside buffer
46. In the case of a working-set strategy, which of these is done by the OS to prevent thrashing?
P. If there are enough extra frames, it initiates another process.
Q. It selects any process for suspending in case the sum of the working sets’ sizes exceed the
number of available frames.
a. P only
b. Q only
c. Neither P nor Q
d. Both P and Q
Answer: (d)Both P and Q
47. An OS implements a policy that needs a process to release all of the resources before it makes
any requests for another resource. Out of all the statements below, select the one that is TRUE:
a. Both deadlock and starvation can occur
b. Deadlock cannot occur, but starvation can occur
c. Deadlock can occur, but starvation cannot occur
d. Neither deadlock nor starvation can occur
Answer: (b)Deadlock cannot occur, but starvation can occur
48. Multiple words are put in a single cache block for:
a. reducing the miss penalty
b. exploiting the reference’s temporal locality in a program
c. exploiting the reference’s spatial locality in a program
d. none of the above
Answer: (c) exploiting the reference’s spatial locality in a program
49. The lowest number of page frames that are bound to be allocated in an environment of virtual
memory to a running process is determined by:
a. the page size
b. the instruction set architecture
c. the total number of processes in memory
d. the size of the physical memory
Answer: (b)the instruction set architecture
50. Consider a file whose ordering key field is 10 bytes long, the primary index has been created for
the file, and the block pointer is 6 bytes long. In this case, if we wish to search a record with the help
of an index, then how many block access do we require?
a. 11
b. 10
c. 9
d. 8
Answer: (b)10

You might also like