wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Structured and Object-Oriented Programming Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What is the main purpose of a programming paradigm?

a)

To define the syntax of a programming language

b)

To organize different ways or styles of solving problems using a programming language

c)

To determine the speed of a programming language

d)

To categorize programming languages based on their popularity

2.

Which programming paradigm involves sets of detailed instructions to instruct how to execute?

a)

Declarative programming paradigm

b)

Imperative programming paradigm

c)

Functional programming paradigm

d)

Logic programming paradigm

3.

Which of the following is an example of a procedural programming language?

a)

Python

b)

C

c)

Erlang

d)

SQL

4.

What is the primary concept of Object-Oriented Programming (OOP)?

a)

Data aggregation (grouping related variables)

b)

Objects (instances) that combine data and behavior

c)

Top-down approach

d)

Direct memory access

5.

Which programming paradigm divides the program into small modules called functions?

a)

Bottom-up approach

b)

Top-down approach

c)

Encapsulation

d)

Code reusability

6.

What is the unit used in Structured Programming?

a)

Class

b)

Struct

c)

Object

d)

Module

7.

How is data hiding achieved in Object-Oriented Programming (OOP)?

a)

By using public access specifiers

b)

By separating functions and structs

c)

By using private/protected access specifiers

d)

By direct memory access

8.

Which programming paradigm is associated with encapsulation?

a)

Structured Programming

b)

Object-Oriented Programming

c)

Top-down approach

d)

Data aggregation

9.

Which domain uses C for Unreal Engine, Unity, and most AAA game engines like Frostbite and CryEngine?

a)

Game Engines & AAA Games

b)

Web Browsers

c)

Databases

d)

Multimedia & Codecs

10.

What is the primary function of a compiler in programming?

a)

To execute the program directly without translation

b)

To translate the C program into machine-language code

c)

To debug runtime errors in the program

d)

To store the program in memory

11.

What is a syntax error in programming?

a)

An error that occurs during program execution

b)

An error that occurs when a statement violates the rules of the language

c)

An error caused by insufficient memory allocation

d)

An error that occurs due to incorrect output

12.

What are compile-time errors?

a)

Errors that occur during program execution

b)

Errors that occur when the program is being compiled

c)

Errors caused by incorrect user input

d)

Errors that occur due to hardware failure

13.

Which file extension is typically used for a compiled C program?

a)

.exe

b)

.c

c)

.o

d)

.txt

14.

What is the primary difference in how a compiler and an interpreter translate source code?

a)

A compiler translates the entire source code at once, while an interpreter translates it line-by-line.

b)

A compiler translates line-by-line, while an interpreter translates the entire source code at once.

c)

Both a compiler and an interpreter translate the entire source code at once.

d)

Both a compiler and an interpreter translate line-by-line.

15.

Which of the following is true about the execution speed of a compiler compared to an interpreter?

a)

A compiler is faster because it runs directly as machine code.

b)

An interpreter is faster because it translates the code all at once.

c)

A compiler is slower because it translates line-by-line.

d)

An interpreter is faster because it generates a standalone executable.

16.

What is a key advantage of using an interpreter over a compiler in terms of debugging?

a)

An interpreter stops exactly at the error line, making debugging easier.

b)

An interpreter shows all errors at once, making debugging easier.

c)

An interpreter generates a standalone executable for debugging.

d)

An interpreter requires recompilation for debugging.

17.

Which of the following programming languages is typically associated with compilers?

a)

C++

b)

Python

c)

JavaScript

d)

Ruby

18.

What is the portability difference between a compiler and an interpreter?

a)

A compiler requires recompilation for different platforms, while an interpreter is highly portable.

b)

A compiler is highly portable, while an interpreter requires recompilation for different platforms.

c)

Both a compiler and an interpreter are highly portable.

d)

Neither a compiler nor an interpreter is portable.

19.

Which of the following best describes Python as a programming language?

a)

Python is a general-purpose, procedural programming language.

b)

Python is an interpreted, high-level, general-purpose programming language.

c)

Python is a compiled, low-level programming language.

d)

Python is a language specifically designed for hardware programming.

20.

What is the main difference in execution speed between Python and C?

a)

Python executes faster than C because it is interpreted.

b)

C executes faster than Python because it is compiled.

c)

Both Python and C execute at the same speed.

d)

Python executes faster than C because it is high-level.

21.

Why is Python considered easier to write code in compared to C?

a)

Python has a simpler syntax and requires fewer lines of code.

b)

Python requires variable declaration, making it easier to debug.

c)

Python is a compiled language, making it faster to write code.

d)

Python has stricter rules for syntax, making it easier to follow.

22.

What is the key difference in variable declaration between Python and C?

a)

Python requires variable types to be declared, while C does not.

b)

C requires variable types to be declared, while Python does not.

c)

Both Python and C require variable types to be declared.

d)

Neither Python nor C requires variable types to be declared.

23.

How does error debugging differ between Python and C?

a)

Python compiles the entire source code before showing errors, while C shows errors instantly.

b)

Python shows errors instantly during execution, while C compiles the entire source code before showing errors.

c)

Both Python and C show errors instantly during execution.

d)

Both Python and C compile the entire source code before showing errors.

24.

Which programming language has a syntax that is easier to learn, write, and read?

a)

Python

b)

C

c)

Java

d)

Assembly Language

25.

What does Python use for memory management?

a)

Manual memory management

b)

Automatic garbage collector

c)

Pointers

d)

Curly braces

26.

Which programming language is generally used for hardware-related applications?

a)

Python

b)

C

c)

JavaScript

d)

Ruby

27.

Which programming language has a larger library of built-in functions?

a)

Python

b)

C

c)

Assembly Language

d)

Fortran

28.

What is a key difference between Python and C in implementing data structures?

a)

Python requires explicit implementation of functions for data structures.

b)

C provides built-in insert and append functions for data structures.

c)

Python gives ease of implementing data structures with built-in functions.

d)

Both Python and C require manual implementation of data structures.

29.

Which programming language supports pointers?

a)

Python

b)

C

c)

Java

d)

HTML

30.

What is the purpose of curly braces in C?

a)

To define a block of code

b)

To manage memory

c)

To implement pointers

d)

To create built-in functions