Programming (50 MCQs with Answers)
1. Which of the following is NOT a statically typed programming language?
a) C++ b) Java c) Python d) Go
Answer: c) Python
2. What does the keyword def signify in Python?
a) End function b) Define function c) Delete function d) Default value
Answer: b) Define function
3. Which operator is used for logical AND in most programming languages?
a) && b) || c) & d) !
Answer: a) &&
4. What is the output of print("Hello"[::-1]) in Python?
a) Hello b) olleH c) Error d) "Hello"
Answer: b) olleH
5. In Java, what is the default value of a boolean variable?
a) true b) false c) null d) 0
Answer: b) false
6. What is recursion in programming?
a) Repeating a loop b) Function calling itself c) Data sorting d) Avoiding
loops
Answer: b) Function calling itself
7. Which keyword is used to declare a constant in C?
a) final b) static c) const d) let
Answer: c) const
8. What does OOP stand for?
a) Open Output Processing b) Object-Oriented Programming c) Order Of
Processing d) Output Of Program
Answer: b) Object-Oriented Programming
9. Which of the following is NOT a primitive data type in Java?
a) int b) boolean c) string d) char
Answer: c) string (it's a class)
10.What symbol is used in C to access the member of a struct through a
pointer?
a) . b) -> c) & d) *
Answer: b) ->
11.Which exception handling keyword is used in Java to define code that
may throw an error?
a) catch b) finally c) try d) throw
Answer: c) try
12.What does the static keyword denote in Java?
a) Variable lifetime tied to instance b) Variable belonging to class c)
Variable dynamic memory d) Variable mutable
Answer: b) Variable belonging to class
13.In Python, what data type does type([]) return?
a) <class 'list'> b) <type 'list'> c) list d) error
Answer: a) <class 'list'>
14.What is the correct way to declare an array in C?
a) int arr = [1, 2,int arr[] = {1, 2, 3}; c) arr int[]; d) array int arr;
Answer: b) int arr[] = {1, 2, 3};
15.Which data structure does FIFO (First In First Out) principle apply to?
a) Stack b) Queue c) Tree d) Graph
Answer: b) Queue
16.What will be the output of: System.out.println(3 + 4 + "5"); in Java?
a) 345 b) 75 c) 12 d) 35
Answer: b) 75
17.In C++, a class is essentially a:
a) Function b) Object c) User-defined data type d) Variable
Answer: c) User-defined data type
18.What is the primary purpose of the interface keyword in Java?
a) To create abstract classes b) To define contracts without
implementation c) To inherit classes d) To implement methods
Answer: b) To define contracts without implementation
19.What is a lambda function in Python?
a) A named function b) A function without arguments c) An anonymous
function d) A loop
Answer: c) An anonymous function
20.Which of the following is NOT a loop in programming?
a) for b) if c) while d) do-while
Answer: b) if
21.Which of the following is used for dynamic memory allocation in C?
a) malloc b) calloc c) realloc d) All of the above
Answer: d) All of the above
22.Which method in Java is the entry point of any Java program?
a) start() b) main() c) init() d) run()
Answer: b) main()
23.The break statement in loops is used to:
a) Skip current iteration b) Exit loop c) Continue loop d) None of the
above
Answer: b) Exit loop
24.Which keyword is used to inherit a class in C++?
a) inherit b) extends c) derives d) : (colon)
Answer: d) : (colon)
25.The ternary operator in C-like languages is represented as:
a) ?: b) && c) || d) ==
Answer: a) ?:
26.What is the file extension of a Python file?
a) .py b) .java c) .cpp d) .txt
Answer: a) .py
27.What is the output of print(2**3) in Python?
a) 6 b) 8 c) 9 d) Error
Answer: b) 8
28.How is a single-line comment denoted in Java?
a) /* comment */ b) // comment c) <!--comment--> d) # comment
Answer: b) // comment
29.What is the size of an int data type in C on most systems?
a) 2 bytes b) 4 bytes c) 8 bytes d) Depends on compiler
Answer: d) Depends on compiler (but often 4 bytes on 32/64 bit)
30.What is encapsulation in OOP?
a) Hiding data b) Overloading functions c) Inheriting classes d)
Polymorphism
Answer: a) Hiding data
31.Which method is used to create a thread in Java?
a) run() b) start() c) execute() d) init()
Answer: b) start()
32.What keyword is used to define a function in JavaScript?
a) function b) def c) func d) fn
Answer: a) function
33.In Python, which of the following converts a string to an integer?
a) int() b) str() c) float() d) toInt()
Answer: a) int()
34.Which language uses cout for output?
a) Python b) C++ c) Java d) C
Answer: b) C++
35.What is the output of the expression 5 == '5' in JavaScript?
a) true b) false c) Error d) undefined
Answer: a) true (because == performs type coercion)
36.Which of these is NOT a valid Python data structure?
a) list b) tuple c) tree d) set
Answer: c) tree
37.Which keyword is used to inherit from a base class in Java?
a) extends b) implements c) inherits d) super
Answer: a) extends
38.What is the outcome if a Python function does not explicitly return a
value?
a) None b) 0 c) empty string d) error
Answer: a) None
39.Which operator adds a key-value pair to a dictionary in Python?
a) [] b) {} c) () d) !=
Answer: a) []
40.What is the default access modifier for class members in Java?
a) public b) private c) protected d) package-private (default)
Answer: d) package-private (default)
41.Which of the following is used for single inheritance in C++?
a) class Derived: Base {}; b) class Derived extends Base {}; c) class Derived
inherits Base {}; d) None
Answer: a) class Derived: Base {};
42.What is the result of True and False in Python?
a) True b) False c) None d) Error
Answer: b) False
43.How do you declare a pointer in C?
a) int ptr; b) int *ptr; c) pointer int ptr; d) &int ptr;
Answer: b) int *ptr;
44.What does the continue statement do inside a loop?
a) Exits loop b) Skips current iteration c) Restarts loop completely d)
None
Answer: b) Skips current iteration
45.Which of these is NOT a valid way to declare variables in Python?
a) x = 10 b) 10 = x c) x, y = 1, 2 d) x = y = 3
Answer: b) 10 = x
46.What is the output of this Java code snippet?
System.out.println(10/3);
a) 3.33 b) 3 c) 3.0 d) Error
Answer: b) 3 (integer division)
47.Who is considered the father of the C programming language?
a) Bjarne Stroustrup b) Dennis Ritchie c) James Gosling d) Ken Thompson
Answer: b) Dennis Ritchie
48.What does SQL stand for?
a) Structured Query Language b) Simple Query Language c) Standard
Query Language d) Sequential Query Language
Answer: a) Structured Query Language
49.Which of the following is a valid way to declare an array in Java?
a) int[] arr = new int; b) int arr[] = new int; c) Both a and b d) None of
above
Answer: c) Both a and b
50.What does NaN stand for in programming?
a) Not a Number b) Not an Name c) Null and Nil d) None and Null
Answer: a) Not a Number
Data Structures (50 MCQs with Answers)
1. Which data structure follows Last In First Out (LIFO)?
a) Stack b) Queue c) Array d) Tree
Answer: a) Stack
2. Which data structure is best for implementing recursion?
a) Queue b) Stack c) Graph d) Linked List
Answer: b) Stack
3. In a Binary Search Tree (BST), what are the time complexities (average) of
search, insert, and delete?
a) O(n) b) O(log n) c) O(1) d) O(n log n)
Answer: b) O(log n)
4. What data structure is used in Breadth First Search (BFS) algorithm?
a) Stack b) Queue c) Priority Queue d) Tree
Answer: b) Queue
5. What is the worst-case time complexity of searching an element in a
linked list?
a) O(1) b) O(n) c) O(log n) d) O(n log n)
Answer: b) O(n)
6. Which of the following data structures uses key-value pairs?
a) Stack b) Queue c) Hash Table d) Tree
Answer: c) Hash Table
7. Which traversal is used to get sorted data from a Binary Search Tree?
a) Preorder b) Inorder c) Postorder d) Level Order
Answer: b) Inorder
8. What is the space complexity of adjacency matrix representation of a
graph with n vertices?
a) O(n) b) O(n^2) c) O(log n) d) O(n log n)
Answer: b) O(n^2)
9. What is a circular queue?
a) A queue without front and rear pointers b) Last position connected to
the first c) Queue implemented via linked list d) Infinite-sized queue
Answer: b) Last position connected to the first
10.Which data structure is used to implement recursion?
a) Queue b) Stack c) Tree d) Graph
Answer: b) Stack
11.What kind of graph contains edges with directions?
a) Undirected Graph b) Directed Graph c) Weighted Graph d) Cyclic
Graph
Answer: b) Directed Graph
12.Which of the following is NOT a tree traversal method?
a) Inorder b) Preorder c) Postorder d) Randomorder
Answer: d) Randomorder
13.The height of a balanced binary tree with n nodes is approximately:
a) O(n) b) O(log n) c) O(1) d) O(n^2)
Answer: b) O(log n)
14.Which data structure is best suited for implementing a priority queue?
a) Array b) Heap c) Stack d) Queue
Answer: b) Heap
15.What property must a heap maintain?
a) Complete tree and Heap property (min or max) b) Balanced tree c)
Sorted array d) Linked nodes
Answer: a) Complete tree and Heap property (min or max)
16.What is the average case complexity of accessing an element in an array
by index?
a) O(1) b) O(n) c) O(log n) d) O(n log n)
Answer: a) O(1)
17.What is a doubly linked list?
a) List with no pointers b) List where each node has pointers to both
previous and next nodes c) List with nodes pointing only forward d) Tree
structure
Answer: b) List where each node has pointers to both previous and next
nodes
18.Collision in hash tables can be resolved by:
a) Chaining b) Open addressing c) Both a and b d) None
Answer: c) Both a and b
19.What is a stride in an array?
a) Number of elements b) Distance between elements c) Step to next
element in memory d) Size of each element
Answer: c) Step to next element in memory
20.Which of these is used to detect cycles in a graph?
a) BFS b) DFS c) Both d) None
Answer: c) Both (commonly DFS)
21.In which data structure do elements get arranged in a hierarchical order?
a) Array b) Graph c) Tree d) Queue
Answer: c) Tree
22.Which of these is NOT a property of a Binary Search Tree (BST)?
a) Left child value < root b) Right child value > root c) Duplicate values
allowed anywhere d) Unique values usually
Answer: c) Duplicate values allowed anywhere
23.Which data structure can be used to implement undo functionality?
a) Queue b) Stack c) Linked List d) Heap
Answer: b) Stack
24.What is the time complexity of inserting an element at the end of a
linked list if tail pointer is available?
a) O(1) b) O(n) c) O(log n) d) O(n^2)
Answer: a) O(1)
25.Which is the simplest way to represent a graph?
a) Adjacency matrix b) Adjacency list c) Edge list d) None
Answer: c) Edge list
26.Which traversal method visits nodes level by level?
a) DFS b) BFS c) Preorder d) Postorder
Answer: b) BFS
27.In graph theory, what is a vertex?
a) Edge b) Node c) Path d) Cycle
Answer: b) Node
28.How many pointers does each node in a binary tree contain?
a) 1 b) 2 c) 3 d) Depends on tree type
Answer: b) 2 (left and right child)
29.Which data structure is ideal for breadth-first traversal?
a) Stack b) Queue c) Priority Queue d) Tree
Answer: b) Queue
30.Which data structure supports fast search, insert, and delete operations?
a) Array b) Linked List c) Hash Table d) Stack
Answer: c) Hash Table
31.What is the size of a pointer variable in most 64-bit systems?
a) 2 bytes b) 4 bytes c) 8 bytes d) 16 bytes
Answer: c) 8 bytes
32.Which of the following best describes a "deque"?
a) FIFO Queue b) LIFO Stack c) Double-ended queue d) Priority queue
Answer: c) Double-ended queue
33.In a min heap, the minimum element is located at:
a) Root b) Leaf c) Left child d) Right child
Answer: a) Root
34.What is the main disadvantage of linked lists compared to arrays?
a) Dynamic size b) Random access c) Memory consumption d) None
Answer: b) Random access
35.Which of the following traversals is NOT depth-first?
a) Inorder b) Preorder c) Postorder d) Level-order
Answer: d) Level-order
36.Which data structure is commonly used for implementing undo
functionality?
a) Stack b) Queue c) Linked List d) Graph
Answer: a) Stack
37.What mechanism is generally used in hash tables to resolve collisions?
a) Linear probing b) Chaining c) Rehashing d) All of the above
Answer: d) All of the above
38.How many children can a node have in a binary tree?
a) 1 b) 2 c) Any number d) None
Answer: b) 2
39.What is the main feature of a graph compared to a tree?
a) No cycles b) Directed edges c) Can have cycles d) Only one root
Answer: c) Can have cycles
40.Which data structure is used internally by function calls to store local
variables and return addresses?
a) Queue b) Stack c) Linked List d) Heap
Answer: b) Stack
41.Which traversal prints nodes in order of increasing value in a BST?
a) Preorder b) Postorder c) Inorder d) Level order
Answer: c) Inorder
42.Which data structure is ideal for implementing LRU cache?
a) Stack b) Queue c) Hashtable with double linked list d) Tree
Answer: c) Hashtable with double linked list
43.Which is NOT a type of linked list?
a) Singly linked list b) Doubly linked list c) Circular linked list d) Array
linked list
Answer: d) Array linked list
44.What does the term "depth" refer to in trees?
a) Number of leaves b) Number of child nodes c) Number of edges from
root to node d) Number of siblings
Answer: c) Number of edges from root to node
45.In the context of graphs, what is a weighted edge?
a) Edge with direction b) Edge with a cost or value c) Edge without cost
d) Edge with multiple connections
Answer: b) Edge with a cost or value
46.What is the purpose of a priority queue?
a) FIFO b) LIFO c) Serve elements based on priority d) Random access
Answer: c) Serve elements based on priority
47.Which data structure is used to implement a recursive function's call
stack?
a) Queue b) Stack c) Linked list d) Tree
Answer: b) Stack
48.What occurs when hash table load factor increases?
a) Increased collisions b) Faster search c) Less memory used d)
Decreased collision
Answer: a) Increased collisions
49.Which of the following is a self-balancing binary tree?
a) AVL tree b) BST c) Binary tree d) Trie
Answer: a) AVL tree
50.Which of these is a disadvantage of adjacency matrix representation of a
graph?
a) Consumes more memory for sparse graphs b) Slow for edge lookup c)
Hard to implement d) None
Answer: a) Consumes more memory for sparse graphs
Networking (50 MCQs with Answers)
1. What does OSI layer 3 represent?
a) Physical b) Data Link c) Network d) Transport
Answer: c) Network
2. Which protocol is connection-oriented and reliable?
a) UDP b) TCP c) IP d) ICMP
Answer: b) TCP
3. What is the purpose of DHCP?
a) Assign dynamic IPs b) Translate domain names c) Route packets d)
Encrypt data
Answer: a) Assign dynamic IPs
4. What does NAT stand for?
a) Network Address Translation b) Network Access Technology c) Node
Access Transfer d) None
Answer: a) Network Address Translation
5. What is the size of an IPv4 address?
a) 16 bits b) 32 bits c) 64 bits d) 128 bits
Answer: b) 32 bits
6. Which device connects different networks?
a) Switch b) Router c) Hub d) Repeater
Answer: b) Router
7. What system resolves domain names to IP?
a) DNS b) DHCP c) FTP d) HTTP
Answer: a) DNS
8. Which protocol is faster but unreliable?
a) TCP b) UDP c) FTP d) SMTP
Answer: b) UDP
9. What is a MAC address?
a) Logical address b) Physical address c) IP address d) Network address
Answer: b) Physical address
10.Which of the following is NOT a physical network topology?
a) Bus b) Star c) Ring d) TCP/IP
Answer: d) TCP/IP
11.What is ARP used for?
a) Resolving IP to MAC b) Assigning IP address c) Routing packets d)
Encryption
Answer: a) Resolving IP to MAC
12.What layer does TCP belong to in the OSI model?
a) Network b) Transport c) Data Link d) Session
Answer: b) Transport
13.HTTP works over which transport layer protocol?
a) TCP b) UDP c) IP d) FTP
Answer: a) TCP
14.FTP is used for:
a) Web browsing b) File Transfer c) Email d) Remote desktop
Answer: b) File Transfer
15.Which port number is the default for HTTP?
a) 21 b) 22 c) 80 d) 443
Answer: c) 80
16.SSL is used to:
a) Encrypt data b) Compress data c) Route packets d) Assign IPs
Answer: a) Encrypt data
17.ICMP is mainly used for:
a) Routing b) Error messages c) File transfer d) Email transfer
Answer: b) Error messages
18.VPN stands for:
a) Virtual Private Network b) Very Private Network c) Visual Private
Network d) None
Answer: a) Virtual Private Network
19.What is a subnet mask used for?
a) IP filtering b) Determining network and host portions c) Encryption d)
Data compression
Answer: b) Determining network and host portions
20.TCP uses which method to ensure reliability?
a) None b) Acknowledgements and retransmissions c) Encryption d)
Compression
Answer: b) Acknowledgements and retransmissions
21.SMTP is used for:
a) Web browsing b) Email sending c) File transfer d) Remote control
Answer: b) Email sending
22.Which of the following is NOT a routing protocol?
a) OSPF b) BGP c) HTTP d) RIP
Answer: c) HTTP
23.The physical layer transmits data as:
a) Bits b) Packets c) Frames d) Segments
Answer: a) Bits
24.What does SSL/TLS provide?
a) Data compression b) Data encryption c) Error correction d) Routing
Answer: b) Data encryption
25.A firewall's purpose is to:
a) Route packets b) Filter traffic c) Assign IPs d) Resolve DNS
Answer: b) Filter traffic
26.The maximum length of an Ethernet frame is:
a) 1500 bytes b) 1518 bytes c) 512 bytes d) 1024 bytes
Answer: b) 1518 bytes
27.IP addresses are assigned by:
a) DHCP b) DNS c) FTP d) HTTP
Answer: a) DHCP
28.Which layer of OSI communicates with the user?
a) Session b) Presentation c) Application d) Transport
Answer: c) Application
29.Which protocol is used to map a hostname to IP?
a) DHCP b) DNS c) ARP d) ICMP
Answer: b) DNS
30.Which of the following is NOT a TCP flag?
a) SYN b) ACK c) FIN d) ECHO
Answer: d) ECHO
31.Which IP address class supports the largest number of hosts?
a) Class A b) Class B c) Class C d) Class D
Answer: a) Class A
32.The port number for HTTPS is:
a) 80 b) 21 c) 443 d) 22
Answer: c) 443
33.In wireless networking, what does SSID stand for?
a) Secure Service ID b) Service Set Identifier c) Server Set ID d) Secure Set
ID
Answer: b) Service Set Identifier
34.Which wireless security protocol is considered the most secure?
a) WEP b) WPA c) WPA2 d) Open
Answer: c) WPA2
35.What is the primary function of a switch?
a) Broadcast data b) Forward data to specific devices c) Assign IPs d)
Encrypt data
Answer: b) Forward data to specific devices
36.What is the default subnet mask for Class C IP?
a) 255.0.0.0 b) 255.255.0.0 c) 255.255.255.0 d) 255.255.255.255
Answer: c) 255.255.255.0
37.A MAC address is:
a) 32-bit b) 48-bit c) 64-bit d) 128-bit
Answer: b) 48-bit
38.Which protocol does Ping use?
a) TCP b) UDP c) ICMP d) FTP
Answer: c) ICMP
39.Which protocol is used for secure file transfer?
a) FTP b) SFTP c) HTTP d) SMTP
Answer: b) SFTP
40.The 3-way handshake in TCP consists of:
a) SYN, SYN-ACK, ACK b) SYN-ACK, SYN, ACK c) ACK, SYN, SYN-ACK d) ACK,
ACK, SYN
Answer: a) SYN, SYN-ACK, ACK
41.What is the role of DNS server?
a) Map domain names to IP addresses b) Assign IP addresses c) Encrypt
data d) Route packets
Answer: a) Map domain names to IP addresses
42.Which of these protocols is used to get IP address automatically?
a) DHCP b) DNS c) FTP d) SMTP
Answer: a) DHCP
43.What device breaks a network into segments?
a) Router b) Hub c) Switch d) Bridge
Answer: d) Bridge
44.SSL operates at which OSI layer?
a) Application b) Presentation c) Session d) Network
Answer: c) Session
45.What is latency in networking?
a) Data size b) Delay in transmission c) Throughput d) Bandwidth
Answer: b) Delay in transmission
46.FTP uses which port by default?
a) 20 and 21 b) 80 c) 23 d) 22
Answer: a) 20 and 21
47.What does HTTP stand for?
a) Hyper Text Transfer Protocol b) Hyper Tool Transfer Protocol c) Hyper
Text Transmission Protocol d) None
Answer: a) Hyper Text Transfer Protocol
48.What is a broadcast address?
a) Address for one device b) Address to communicate with all devices on
a subnet c) Address of network router d) None
Answer: b) Address to communicate with all devices on a subnet
49.VPN operates by creating a:
a) Secure tunnel b) Physical connection c) Public link d) Broadcast
channel
Answer: a) Secure tunnel
50.In IPv6, the length of address is:
a) 32 bits b) 64 bits c) 128 bits d) 256 bits
Answer: c) 128 bits
Microprocessors (50 MCQs with Answers)
1. What does ALU stand for?
a) Arithmetic Logic Unit b) Automatic Logic Unit c) Analog Logic Unit d)
Advanced Logic Unit
Answer: a) Arithmetic Logic Unit
2. Which register holds the address of the next instruction?
a) Program Counter (PC) b) Stack Pointer (SP) c) Instruction Register (IR)
d) Accumulator (ACC)
Answer: a) Program Counter (PC)
3. What is the function of the Control Unit?
a) Perform arithmetic b) Control timing and execution c) Store data d)
Manage interrupts
Answer: b) Control timing and execution
4. Intel 8086 is a:
a) 8-bit b) 16-bit c) 32-bit d) 64-bit microprocessor
Answer: b) 16-bit
5. What does DMA stand for?
a) Direct Memory Access b) Data Management Architecture c) Dynamic
Memory Allocation d) Data Memory Access
Answer: a) Direct Memory Access
6. Which register in 8086 points to the top of the stack?
a) SP b) BP c) IP d) AX
Answer: a) SP
7. How many general-purpose registers does 8086 have?
a) 4 b) 8 c) 16 d) 32
Answer: a) 4 (AX, BX, CX, DX)
8. What is Interrupt?
a) A hardware signal b) A software routine c) A way to reboot d) None of
above
Answer: a) A hardware signal
9. The size of the address bus in 8086 is:
a) 16 bits b) 20 bits c) 32 bits d) 64 bits
Answer: b) 20 bits
10.Which instruction moves data from one register to another?
a) MOV b) ADD c) JMP d) CMP
Answer: a) MOV
11.What is the function of the accumulator register?
a) Hold arithmetic results b) Control execution c) Store data d) Manage
stack
Answer: a) Hold arithmetic results
12.How many bytes can 8086 access directly?
a) 64KB b) 1MB c) 16MB d) None
Answer: b) 1MB
13.What does the flag register indicate?
a) Data b) Status of operations c) Memory address d) Instruction code
Answer: b) Status of operations
14.Which unit decodes instructions in a microprocessor?
a) ALU b) Control Unit c) Register Unit d) Cache
Answer: b) Control Unit
15.What is the maximum clock speed of Intel 8086?
a) 5 MHz b) 10 MHz c) 16 MHz d) 20 MHz
Answer: a) 5 MHz (original model)
16.What do interrupts allow?
a) Multi-tasking b) Execute instructions faster c) Communicate with
peripherals d) Store data
Answer: c) Communicate with peripherals
17.Which component holds the current instruction being executed?
a) IR (Instruction Register) b) PC c) SP d) AX
Answer: a) IR (Instruction Register)
18.What is pipelining in microprocessors?
a) Executing multiple instructions simultaneously b) Storing instructions
c) Fetching only d) Single instruction execution
Answer: a) Executing multiple instructions simultaneously
19.What is the purpose of segment registers in 8086?
a) Address different memory sections b) Store instructions c) Cache data
d) None
Answer: a) Address different memory sections
20.Which of the following is NOT a segment register?
a) CS b) DS c) SS d) GR
Answer: d) GR
21.The instruction JMP is used for:
a) Data movement b) Jumping to another instruction c) Arithmetic d)
Logic operations
Answer: b) Jumping to another instruction
22.Which type of memory is fastest?
a) RAM b) ROM c) Cache d) Hard disk
Answer: c) Cache
23.The 8086 microprocessor can address how much memory?
a) 64 KB b) 1 MB c) 16 MB d) 4 GB
Answer: b) 1 MB
24.Which register handles I/O operations in 8086?
a) AX b) BX c) DX d) CX
Answer: c) DX
25.What does the NOP instruction do?
a) Nothing (No operation) b) Add c) Jump d) Halt
Answer: a) Nothing (No operation)
26. What is the function of the Bus Interface Unit in a
microprocessor?
a) Execute arithmetic instructions
b) Handle data transfer on address and data buses
c) Control timing and sequencing
d) Store temporary data
Answer: b) Handle data transfer on address and data buses
27. Which of the following is an example of a RISC
microprocessor?
a) Intel 8086
b) ARM Cortex-M
c) Intel Pentium
d) Motorola 68000
Answer: b) ARM Cortex-M
28. What is the function of the stack segment register (SS) in
8086?
a) Points to code segment
b) Points to data segment
c) Points to the stack in memory
d) Points to extra data segment
Answer: c) Points to the stack in memory
29. What is the word size of the Intel 8086 microprocessor?
a) 8 bits
b) 16 bits
c) 32 bits
d) 64 bits
Answer: b) 16 bits
30. How many flags are there in the flag register of the 8086
processor?
a) 6
b) 8
c) 10
d) 12
Answer: c) 10
31. Which register is used to hold the address of the current
instruction being executed in a microprocessor?
a) Instruction Register (IR)
b) Program Counter (PC)
c) Stack Pointer (SP)
d) Data Register (DR)
Answer: b) Program Counter (PC)
32. The term "clock speed" in microprocessors refers to:
a) Number of instructions processed per second
b) Frequency of the internal clock signal
c) Number of cores in the CPU
d) Size of the cache memory
Answer: b) Frequency of the internal clock signal
33. What is the typical size of the data bus in Intel 8086?
a) 8 bits
b) 16 bits
c) 32 bits
d) 64 bits
Answer: b) 16 bits
34. Which instruction is used to halt the CPU until the next
interrupt?
a) WAIT
b) HLT
c) NOP
d) STOP
Answer: b) HLT
35. What is the purpose of segmented memory architecture in
8086?
a) To increase speed of the processor
b) To increase memory addressability beyond 64KB
c) To simplify programming
d) To reduce power consumption
Answer: b) To increase memory addressability beyond 64KB
36. The 8086 microprocessor was introduced in which year?
a) 1978
b) 1980
c) 1985
d) 1990
Answer: a) 1978
37. What type of microprocessor is Intel 8086?
a) CISC (Complex Instruction Set Computer)
b) RISC (Reduced Instruction Set Computer)
c) DSP (Digital Signal Processor)
d) Microcontroller
Answer: a) CISC (Complex Instruction Set Computer)
38. Which bus carries the memory addresses in a
microprocessor?
a) Data bus
b) Address bus
c) Control bus
d) None of the above
Answer: b) Address bus
39. What is the function of the Instruction Register (IR)?
a) Stores the currently executed instruction
b) Stores data to be processed
c) Counts the number of executed instructions
d) Holds the address of next instruction
Answer: a) Stores the currently executed instruction
40. Which register is primarily used to point to the base of a data
segment?
a) CS
b) DS
c) ES
d) SS
Answer: b) DS (Data Segment)
41. How many bytes are there in an 8086 instruction word?
a) 1
b) 2
c) Variable length (1 to 6 bytes)
d) Fixed 4 bytes
Answer: c) Variable length (1 to 6 bytes)
42. In 8086, what is the purpose of the extra segment (ES)
register?
a) Points to code segment
b) Used for additional data storage
c) Points to stack segment
d) None of the above
Answer: b) Used for additional data storage
43. What is the main characteristic of a microcontroller
compared to a microprocessor?
a) Less integrated components
b) Includes memory and peripherals on-chip
c) Runs faster
d) Uses only RISC architecture
Answer: b) Includes memory and peripherals on-chip
44. The term “throughput” of a microprocessor refers to:
a) Number of instructions completed per unit time
b) Clock speed frequency
c) Number of transistors on the chip
d) Size of the instruction set
Answer: a) Number of instructions completed per unit time
45. What is the typical power supply voltage for the original
8086 microprocessor?
a) +5V
b) +12V
c) +3.3V
d) +1.8V
Answer: a) +5V
46. Which of the following is responsible for interrupt handling
in microprocessor systems?
a) Interrupt Vector Table
b) Program Counter
c) Stack Pointer
d) Accumulator
Answer: a) Interrupt Vector Table
47. In microprocessor terminology, what is "instruction cycle"?
a) Time taken to execute multiple instructions
b) Time to fetch and execute one instruction
c) Time taken to decode an instruction
d) Time taken to access memory
Answer: b) Time to fetch and execute one instruction
48. How does an indirect addressing mode work?
a) Operand is the actual data
b) Operand is an address of the data
c) Operand is a register code
d) Operand is not used
Answer: b) Operand is an address of the data
49. Which part of the microprocessor controls the timing and
sequencing of operations?
a) ALU
b) Control Unit
c) Register Array
d) Cache
Answer: b) Control Unit
50. What is the function of the stack pointer (SP) in
microprocessors?
a) Points to current instruction
b) Points to top of stack
c) Holds data to be processed
d) Points to code segment
Answer: b) Points to top of stack
51.