wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ME-dsaCSsp

Total questions: 71

Worksheet time: 36mins

Name
Class
Date
1.

What is programming?

a)

Writing detailed recipes for chefs

b)

Solving mathematical equations

c)

Encoding an algorithm into a programming language to be executed by a computer

d)

Drawing graphical designs

2.

What is an algorithm?

a)

A computer language

b)

A step-by-step solution to a problem

c)

A type of hardware

d)

A recipe for cooking

3.

What is the purpose of a programming language?

a)

To translate human language into binary code

b)

To represent data and algorithms in a structured way for a computer to execute

c)

To communicate with other developers

d)

To create art

4.

What is a real-life example of an algorithm?

a)

Baking a cake by following a recipe

b)

Watching a movie

c)

Driving a car

d)

Running a marathon

5.

In programming, which of the following is comparable to selecting the language of a recipe?

a)

Choosing the ingredients

b)

Selecting the programming language

c)

Using different kitchen tools

d)

Deciding the cooking time

6.

What does a variable represent in programming?

a)

A fixed value

b)

A place to store data

c)

A mathematical equation

d)

A physical object

7.

What data type would you use to store the number of eggs in a recipe?

a)

Boolean

b)

String

c)

Integer

d)

Double

8.

Which data type is used to represent true or false values?

a)

String

b)

Boolean

c)

Integer

d)

Float

9.

In the analogy of cooking, if oil is represented as a variable, what type might it be in programming?

a)

String

b)

Boolean

c)

Double

d)

Integer

10.

Which of the following is an example of a primitive data type?

a)

Class

b)

Array

c)

Boolean

d)

Method

11.

What is a control construct in programming?

a)

A method for handling errors

b)

A way to control the flow of execution in a program

c)

A tool to draw user interfaces

d)

A storage location for data

12.

What is the purpose of the sequence control structure?

a)

To repeat actions until a condition is met

b)

To allow decisions based on conditions

c)

To execute statements one by one in order

d)

To display data to the user

13.

Which control structure allows decision-making based on conditions?

a)

Sequence

b)

Selection

c)

Iteration

d)

Data types

14.

What does the iteration control structure do?

a)

It chooses between two options

b)

It executes statements sequentially

c)

It repeatedly executes a sequence of statements as long as a condition is true

d)

It defines data types

15.

Which of the following is an example of a selection control structure?

a)

for-loop

b)

if-statement

c)

while-loop

d)

switch-case

16.

What is an Abstract Data Type (ADT)?

a)

A type of hardware

b)

A class for objects defined by a set of operations without specifying implementation details

c)

A data type built into programming languages

d)

A control structure for managing loops

17.

Why is it called an abstract data type?

a)

Because it is visualized on paper

b)

Because it is implemented without concrete details provided to the user

c)

Because it involves abstract concepts

d)

Because it is used only in theoretical programming

18.

Which of the following describes abstraction in programming?

a)

Displaying all implementation details

b)

Focusing on essential features while hiding the complexity

c)

Building software without using data types

d)

Using only low-level programming languages

19.

What is a data structure in programming?

a)

A visual representation of data

b)

A way of organizing and storing data for efficient access and modification

c)

A control structure for handling decision-making

d)

A type of algorithm

20.

Which of the following is an example of an abstract data type?

a)

Integer

b)

Linked List

c)

Boolean

d)

String

21.

What is the role of an algorithm in programming?

a)

To store data

b)

To design the user interface

c)

To provide a step-by-step solution to a problem

d)

To define the data types used in a program

22.

Which of the following is a characteristic of a good algorithm?

a)

It should consume as much memory as possible

b)

It should be complex and difficult to understand

c)

It should be efficient in terms of time and space

d)

It should require constant manual intervention

23.

How does the complexity of an algorithm affect a program?

a)

Complex algorithms are always better

b)

Simpler algorithms generally lead to faster and more efficient programs

c)

Complexity does not matter in algorithm design

d)

More complex algorithms use less memory

24.

What does a control structure do in relation to algorithms?

a)

It defines the problem to be solved

b)

It provides a mechanism to control the flow of the algorithm

c)

It stores the algorithm's output

d)

It handles errors in the algorithm

25.

Why is abstraction important in solving complex problems?

a)

It increases the complexity of the problem

b)

It allows programmers to focus on high-level solutions without worrying about details

c)

It forces programmers to write more code

d)

It eliminates the need for data types

26.

What is a loop in programming?

a)

A section of code that runs only once

b)

A sequence that is skipped entirely

c)

A construct that repeats a set of instructions until a condition is met

d)

A data storage method

27.

Which of the following is an example of a count-controlled loop?

a)

if-statement

b)

for-loop

c)

while-loop

d)

switch-case

28.

What type of iteration uses the "while" and "endwhile" statements?

a)

Count-controlled

b)

Condition-controlled

c)

Infinite loop

d)

Selection-controlled

29.

What is the purpose of the "switch" statement?

a)

To handle different types of errors

b)

To perform iteration

c)

To execute one of several possible blocks of code based on a condition

d)

To perform mathematical operations

30.

What happens when a condition in a "while loop" is false?

a)

The loop continues to run

b)

The loop stops executing

c)

An error is generated

d)

The program restarts

31.

In the analogy of frying an egg, which programming concept does "cracking the egg" represent?

a)

Input

b)

Looping

c)

Decision-making

d)

Sequential processing

32.

Which of the following defines a "method" in programming?

a)

A way to store data

b)

A function that performs a specific task

c)

A loop that runs forever

d)

A type of variable

33.

What is a condition in programming?

a)

A fixed value

b)

A rule that controls the execution of a statement or block of code

c)

A piece of hardware

d)

A storage location

34.

Which of the following is used to check multiple conditions?

a)

if-else statement

b)

for-loop

c)

while-loop

d)

break statement

35.

Which construct is most commonly used for repetitive tasks?

a)

Selection

b)

Sequence

c)

Loop

d)

Data types

36.

Which of the following best defines a "good programmer"?

a)

Someone who can write code without any errors

b)

Someone who can build codes that solve specific problems effectively

c)

Someone who knows every programming language

d)

Someone who writes the most complex algorithms

37.

According to Ashish Arya, which of the following is NOT one of the 10 effective ways to become a good programmer?

a)

Work on Basics

b)

Start putting question tags with

38.

According to Ashish Arya, which of the following is NOT one of the 10 effective ways to become a good programmer?

a)

Work on Basics

b)

Start putting question tags with every set of code

c)

Avoid reading documentation

d)

Learn from others' code

39.

Why is it important to spend more time analyzing a problem before coding?

a)

It allows you to write more lines of code

b)

It helps you understand the problem better, reducing the time needed to fix issues later

c)

It makes the coding process more fun

d)

It ensures you use the latest technologies

40.

How can helping others improve your programming skills?

a)

It doesn't; you should focus solely on your own projects

b)

By exposing you to different problems and solutions, enhancing your learning

c)

By allowing you to take credit for others' work

d)

By reducing the amount of work you have to do

41.

What does Ashish Arya suggest about changing technologies?

a)

Always switch to the latest technology immediately

b)

Don't let the changing technology world discourage you

c)

Ignore new technologies and stick to what you know

d)

Focus only on outdated technologies

42.

Why should you be the first to analyze and review your code?

a)

To ensure it meets your personal coding style

b)

To identify and fix issues early, improving code quality

c)

To make the code longer and more complex

d)

To delay the project timeline

43.

Which practice helps in writing simple and understandable code?

a)

Using as many nested loops as possible

b)

Writing concise and logically structured code

c)

Avoiding comments and documentation

d)

Using obscure variable names

44.

What is the benefit of writing logical code?

a)

It makes the code run faster

b)

It ensures the code is easy to understand and maintain

c)

It makes the code look impressive

d)

It reduces the need for testing

45.

Why are work-arounds discouraged for long-term programming solutions?

a)

They are usually less efficient

b)

They can lead to unstructured and hard-to-maintain code

c)

They require more memory

d)

They are not supported by most programming languages

46.

How can reading documentation contribute to becoming a better programmer?

a)

It helps you memorize all functions and methods

b)

It allows you to understand and utilize libraries and tools effectively

c)

It saves time by avoiding the need to write code

d)

It is not necessary if you already know how to code

47.

What is a notation in the context of algorithms?

a)

A type of programming language

b)

A system of written symbols used to represent concepts

c)

A hardware component

d)

A software development methodology

48.

Which of the following best describes an algorithm?

a)

A hardware specification

b)

A sequence of computational steps to transform input into output

c)

A type of database

d)

A user interface design

49.

In algorithmic notation, what does the 'Go to' statement do?

a)

Repeats the current step

b)

Unconditionally transfers control to a specified step

c)

Terminates the algorithm

d)

Skips the next step

50.

Why should 'Go to' and 'Exitloop' statements be avoided in algorithms?

a)

They make the algorithm run slower

b)

They lead to unstructured and hard-to-maintain algorithms

c)

They are not supported in modern programming languages

d)

They consume more memory

51.

What is the purpose of the 'Exit' statement in an algorithm?

a)

To repeat a section of the algorithm

b)

To terminate the algorithm

c)

To transfer control to another step

d)

To initialize variables

52.

Which of the following is a valid variable name according to the given rules?

a)

1variable

b)

variable_name

c)

VariableName

d)

variable name

53.

What must every algorithm have according to the format conventions?

a)

A graphical representation

b)

An identifying name written in capital letters

c)

A list of all possible inputs

d)

A predefined output format

54.

In the sample algorithm for finding the largest element in a vector, what happens if the vector is empty?

a)

The algorithm initializes MAX to zero

b)

The algorithm terminates

c)

The algorithm throws an error

d)

The algorithm proceeds to the next step

55.

What does the subscript variable 'I' represent in the sample algorithm?

a)

The current maximum value

b)

The index of the next element to be compared

c)

The total number of elements

d)

The sum of all elements

56.

How are comments used in algorithm steps?

a)

To execute additional actions

b)

To help the reader understand the step without affecting execution

c)

To store temporary data

d)

To define variables

57.

Which property ensures that an algorithm will finish after a limited number of steps?

a)

Definiteness

b)

Input

c)

Finiteness

d)

Effectiveness

58.

What does the definiteness property of an algorithm require?

a)

Each step must be clearly and unambiguously defined

b)

The algorithm must have a finite number of steps

c)

The algorithm must produce at least one output

d)

The algorithm must be efficient

59.

Which property of an algorithm specifies the values given to it initially?

a)

Input

b)

Output

c)

Finiteness

d)

Definiteness

60.

What is meant by the effectiveness property of an algorithm?

a)

The algorithm uses the least amount of memory possible

b)

All operations can be performed exactly and in finite time

c)

The algorithm can handle any type of input

d)

The algorithm produces multiple outputs

61.

How is time complexity defined?

a)

The amount of memory an algorithm uses

b)

The running time of a program as a function of the input size

c)

The number of lines of code in a program

d)

The speed of the computer executing the algorithm

62.

Which asymptotic notation describes the upper bound of an algorithm's running time?

a)

Omega (Ω)

b)

Theta (θ)

c)

Big-O (O)

d)

Little-o (o)

63.

What does Big-O notation O(n²) indicate about an algorithm's complexity?

a)

The algorithm runs in constant time

b)

The algorithm's running time grows linearly with input size

c)

The algorithm's running time grows proportionally to the square of the input size

d)

The algorithm's running time grows exponentially with input size

64.

Which notation is used to describe the best-case scenario of an algorithm's complexity?

a)

Big-O (O)

b)

Omega (Ω)

c)

Theta (θ)

d)

Little-o (o)

65.

What does Theta (θ) notation represent in algorithm analysis?

a)

The worst-case complexity

b)

The best-case complexity

c)

Both the upper and lower bounds of the algorithm's complexity

d)

The average number of operations

66.

Which of the following best describes space complexity?

a)

The amount of time an algorithm takes to run

b)

The number of variables used in an algorithm

c)

The amount of memory an algorithm requires during execution

d)

The size of the source code

67.

What is the absolute value of -12.29?

a)

-12.29

b)

12.29

c)

0

d)

24.58

68.

How would you round off the number 59,899 to the nearest thousand?

a)

59,000

b)

60,000

c)

59,500

d)

59,900

69.

What does the floor function return for the number 4.7?

a)

5

b)

4

c)

4.7

d)

0

70.

Which Java method would you use to find the minimum of two integers, 23 and 17?

a)

Math.max(23, 17)

b)

Math.min(23, 17)

c)

Math.min(17, 23)

d)

Both B and C

71.

What is the result of 10 % 3 in Java?

a)

0

b)

1

c)

3

d)

10