Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Algo Mystery college level round 1

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the average time it takes to find an item in a hash table?

a)

O(1)

b)

O(n^2)

c)

O(n)

d)

O(log n)

2.

What is the main difference between a stack and a queue?

a)

A stack uses FIFO, while a queue uses LIFO.

b)

A stack allows random access, while a queue does not.

c)

A stack uses LIFO, while a queue uses FIFO.

d)

A stack is a type of list, while a queue is also a type of list.

3.

What does polymorphism mean in object-oriented programming?

a)

Polymorphism means combining different classes into one.

b)

Polymorphism allows different classes to be used as if they are the same class through a shared interface.

c)

Polymorphism is about hiding how a class works from the user.

d)

Polymorphism means a class can inherit from more than one parent class.

4.

What is inheritance in Object-Oriented Programming (OOP)?

a)

Inheritance allows classes to be created without any relationship to existing classes.

b)

Inheritance is a process where classes are deleted to simplify code structure.

c)

Inheritance is a method for classes to operate independently without sharing features.

d)

Inheritance is a way for a new class to use properties and behaviors from an existing class, which helps in reusing code.

5.

What is a binary search tree and how is it different from a binary tree?

a)

A binary tree is a type of binary search tree with unordered nodes.

b)

A binary search tree is a binary tree where the nodes are arranged in a specific order, which helps in searching for values quickly, while a binary tree does not have this order.

c)

A binary search tree is a tree with random nodes, making searches slow.

d)

A binary search tree can have duplicate values, while a binary tree cannot.

6.

What does a constructor do in a class?

a)

A constructor helps to create methods for a class.

b)

A constructor is used to manage errors in a class.

c)

A constructor helps to remove an object from memory.

d)

A constructor is used to set up the properties of an object.

7.

What is a linked list?

a)

A data structure that consists of nodes, where each node contains data and a reference to the next node.

b)

A type of array that can grow and shrink in size.

c)

A collection of elements that are stored in a fixed-size block of memory.

d)

A data structure that allows for fast access to elements by index.

8.

What is the main difference between deep copy and shallow copy?

a)

Shallow copy makes new objects; deep copy keeps the originals.

b)

Shallow copy keeps the original objects; deep copy makes new copies of everything.

c)

Shallow copy makes new copies of everything; deep copy keeps the originals.

d)

Deep copy is quicker than shallow copy; shallow copy takes more time.

9.

What is encapsulation in Object-Oriented Programming (OOP)?

a)

Encapsulation means keeping data and methods together in one place and controlling access to them.

b)

Encapsulation is when data and methods are separated in OOP.

c)

Encapsulation is about sharing properties between classes.

d)

Encapsulation allows creating many copies of a class.

10.

What is the average time it takes to find an item in a balanced binary search tree?

a)

Very fast (O(1))

b)

Fast (O(log n^2))

c)

Moderately fast (O(log n))

d)

Slow (O(n))

11.

What are the basic concepts of object-oriented programming?

a)

Creating objects, Breaking down problems, Saving data, Changing functions

b)

Hiding details, Using parent-child relationships, Changing forms, Simplifying ideas

c)

Hiding details, Combining parts, Using parent-child relationships, Looking back at code

d)

Combining parts, Working together, Passing messages, Using rules

12.

What is the main difference between a priority queue and a regular queue?

a)

A priority queue processes items in a random order, while a regular queue processes them in the order they arrive.

b)

A priority queue removes items based on their importance, while a regular queue removes items in the order they were added.

c)

A priority queue can have repeated items, while a regular queue cannot.

d)

A priority queue has a fixed size, while a regular queue can change size as needed.

13.

What does the 'this' keyword represent in programming?

a)

'this' keyword is used to create new functions.

b)

'this' keyword helps to understand the context in which a function is executed.

c)

'this' keyword always points to the main program.

d)

'this' keyword is used to store data in programming.

14.

What is the main difference between an array and a linked list?

a)

Linked lists are faster to access than arrays.

b)

Arrays use more memory than linked lists.

c)

Arrays are fast and have a fixed size, while linked lists can grow and are easier to change.

d)

Arrays can change size and linked lists cannot.

15.

What is a graph in simple terms, and how can we show it in programming?

a)

A graph is just a bunch of random numbers, shown as text in programming.

b)

A graph is a type of database, shown using SQL commands and tables.

c)

A graph is a structure with points only, shown using basic lists.

d)

A graph is a way to connect points, shown in programming using lists that show connections, tables, or lists of edges.