0% found this document useful (0 votes)
7 views15 pages

70 Practice Questions

The document contains 70 practice questions focused on computer architecture and programming concepts, covering topics such as CPU components, instruction cycles, types of computer architecture, high-level languages, parameter passing techniques, and programming language concepts. Each question is followed by multiple-choice answers, with an answer key provided at the end. This resource is designed to test knowledge and understanding of fundamental concepts in computer science.

Uploaded by

eseosaosaghae4
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)
7 views15 pages

70 Practice Questions

The document contains 70 practice questions focused on computer architecture and programming concepts, covering topics such as CPU components, instruction cycles, types of computer architecture, high-level languages, parameter passing techniques, and programming language concepts. Each question is followed by multiple-choice answers, with an answer key provided at the end. This resource is designed to test knowledge and understanding of fundamental concepts in computer science.

Uploaded by

eseosaosaghae4
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/ 15

70 Practice Questions on Computer Architecture & Programming Concepts

Computer Architecture: Basic Components

1. Which part of the CPU performs arithmetic and logical operations?

A. Control Unit

B. ALU

C. Registers

D. Cache

2. What does RAM stand for?

A. Random Access Memory

B. Read Access Memory

C. Read-Only Memory

D. Run Access Memory

3. Which bus carries memory addresses?

A. Data Bus

B. Address Bus

C. Control Bus

D. Power Bus

4. The control unit is responsible for directing operations inside the CPU. True or False?

A. True

B. False

C. Depends on architecture

D. None

5. Which memory type is fastest?

A. RAM

B. ROM

C. Cache

D. Hard Disk

6. Registers are located inside the which component?

A. ALU

B. Control Unit
C. CPU

D. Motherboard

7. Cache memory is __________ to the CPU.

A. External

B. Internal

C. Slower

D. Volatile

8. Which register holds the address of the next instruction?

A. Instruction Register

B. Program Counter

C. Stack Pointer

D. Data Register

9. What does PC in CPU stand for?

A. Program Counter

B. Process Control

C. Program Control

D. Processor Counter

10. Which part decodes the instruction?

A. ALU

B. Control Unit

C. Registers

D. Cache

11. The size of a register is measured in:

A. Bits

B. Bytes

C. Seconds

D. Cycles

12. General-purpose registers are used for:

A. Specific tasks

B. Temporary data

C. Only arithmetic
D. Only logic

Instruction Cycle (Fetch-Decode-Execute)

13. What is the first step of the instruction cycle?

A. Decode

B. Execute

C. Fetch

D. Store

14. During decode, the control unit interprets the instruction. True or False?

A. True

B. False

C. Only in RISC

D. Only in CISC

15. Execute phase involves the ALU. True or False?

A. True

B. False

C. Depends

D. None

16. After execution, results are stored. This is called:

A. Fetch

B. Decode

C. Execute

D. Store

17. Which register holds data to be written/read from memory?

A. MAR

B. MDR

C. PC

D. IR

18. MAR stands for:

A. Memory Address Register

B. Memory Access Register

C. Machine Address Register


D. Machine Access Register

19. MDR stands for:

A. Memory Data Register

B. Machine Data Register

C. Memory Decode Register

D. Machine Decode Register

20. The instruction cycle continues until:

A. Error occurs

B. All instructions execute

C. User interrupts

D. Half instructions

21. In pipelined CPU, multiple instruction phases overlap. True or False?

A. True

B. False

C. Only in CISC

D. Not possible

22. Instruction Register (IR) stores:

A. Current instruction

B. Next instruction

C. Data

D. Address

23. Fetch-decode-execute occurs in:

A. Software

B. Hardware

C. GPU

D. ALU

24. Which step involves reading from memory?

A. Fetch

B. Decode

C. Execute

D. Store
Types of Computer Architecture

25. Von Neumann architecture uses single memory. True or False?

A. True

B. False

C. Depends

D. Only in Harvard

26. Harvard architecture separates instruction and data memory. True or False?

A. True

B. False

C. Depends

D. Only in RISC

27. RISC focuses on simple instructions. True or False?

A. True

B. False

C. Depends

D. Only in CISC

28. CISC stands for Complex Instruction Set Computer. True or False?

A. True

B. False

C. Depends

D. None

29. Which architecture is common in microcontrollers?

A. Von Neumann

B. Harvard

C. RISC

D. CISC

30. ARM processors are typically RISC. True or False?

A. True

B. False

C. Depends

D. In hybrid
31. x86 is an example of CISC architecture. True or False?

A. True

B. False

C. Depends

D. Only in Intel

32. Which uses more complex instructions per opcode?

A. RISC

B. CISC

C. Both

D. Neither

33. Harvard architecture can improve speed due to separate buses. True or False?

A. True

B. False

C. Depends

D. None

34. Von Neumann bottleneck refers to:

A. CPU power

B. Memory bandwidth

C. Disk speed

D. GPU speed

35. Which architecture uses unified cache for data and instructions?

A. RISC

B. CISC

C. Von Neumann

D. Harvard

36. Split cache is associated with:

A. Von Neumann

B. Harvard

C. RISC

D. CISC

High-Level Languages
37. Which is NOT a high-level language?

A. Python

B. C

C. Assembly

D. Java

38. High-level languages improve portability. True or False?

A. True

B. False

C. Only Java

D. Only Python

39. Python is interpreted. True or False?

A. True

B. False

C. Only compiled

D. Depends

40. Java uses a virtual machine. True or False?

A. True

B. False

C. None

D. Depends

41. Which is statically typed?

A. Python

B. Java

C. JavaScript

D. Ruby

42. Which uses garbage collection?

A. C

B. C++

C. Java

D. Assembly

43. Which language introduced OOP concepts?


A. C

B. Fortran

C. Simula

D. Pascal

44. Which is primarily used for system programming?

A. Python

B. C

C. SQL

D. HTML

45. Which language is known for web scripting?

A. PHP

B. C

C. Assembly

D. Fortran

46. Which supports multiple paradigms (OOP, functional)?

A. C

B. Java

C. Python

D. Assembly

47. Which uses indentation for blocks?

A. C

B. Python

C. Java

D. Ruby

48. Which compiles to native code by default?

A. Java

B. C#

C. C

D. JavaScript

Parameter Passing Techniques

49. Pass by value passes a copy. True or False?


A. True

B. False

C. Only in Ada

D. Only in C

50. Pass by reference uses addresses. True or False?

A. True

B. False

C. Only in C

D. Only in Java

51. C++ supports pass by reference. True or False?

A. True

B. False

C. Depends

D. Only by pointer

52. Pass by pointer is used in which language?

A. Python

B. C

C. Java

D. Ruby

53. Value-result also called:

A. Copy-in copy-out

B. Delayed evaluation

C. Reference copy

D. None

54. Pass by name was in which language?

A. Algol

B. C

C. Java

D. Python

55. Pass by constant reference prevents modification. True or False?

A. True
B. False

C. Depends

D. None

56. In Java, objects are passed by:

A. Value

B. Reference

C. Value of reference

D. Pointer

57. In C, arrays decay to pointers when passed. True or False?

A. True

B. False

C. Only macros

D. Only functions

58. Pass by move semantics is used in C++11. True or False?

A. True

B. False

C. Only in C

D. Only in Java

59. Which avoids copying large objects?

A. Pass by value

B. Pass by reference

C. Pass by copy

D. Pass by name

60. Which requires use of '&' in C++?

A. Pass by value

B. Pass by reference

C. Pass by pointer

D. Pass by result

Programming Language Concepts

61. Compilation transforms code to:

A. Bytecode
B. Machine code

C. Source code

D. None

62. Interpretation happens at:

A. Compile time

B. Run time

C. Link time

D. None

63. Which is a dynamic language?

A. C++

B. Java

C. Python

D. Fortran

64. Which checks lexical errors?

A. Parser

B. Lexer

C. Compiler

D. Interpreter

65. Tail recursion optimization eliminates:

A. Loops

B. Stack frames

C. Variables

D. None

66. Which stores local variables?

A. Heap

B. Stack

C. Cache

D. Registers

67. Context switch saves state of:

A. Process

B. Thread
C. Function

D. None

68. Deadlock involves:

A. Two processes waiting

B. One process waiting

C. No waiting

D. None

69. Which is representation of instructions?

A. Opcode

B. Operand

C. Register

D. Flag

70. Endianness affects byte order of:

A. Registers

B. Memory

C. Cache

D. CPU
Answer Key

1. B
2. A
3. B
4. A
5. C
6. C
7. B
8. B
9. A
10. B
11. A
12. B
13. C
14. A
15. A
16. D
17. B
18. A
19. A
20. B
21. A
22. A
23. B
24. A
25. A
26. A
27. A
28. A
29. B
30. A
31. A
32. B
33. A
34. B
35. C
36. B
37. C
38. A
39. A
40. A
41. B
42. C
43. C
44. B
45. A
46. C
47. B
48. C
49. A
50. A
51. A
52. B
53. A
54. A
55. A
56. C
57. A
58. A
59. B
60. B
61. B
62. B
63. C
64. B
65. B
66. B
67. A
68. A
69. A
70. B

You might also like