Definitions
Sorting
Linked Lists
Dynamic Programming & Sliding Window
Time & Space Complexity
100

Elements bubble to the end of the list by comparing and swapping adjacent elements

Bubble Sort

100

You are given an almost sorted array where each element is at most 2 positions away from its correct position. What is the most efficient sorting algorithm to use?

Insertion Sort

100

Which linked list allows bidirectional traversal?

Doubly Linked List

100

Which algorithmic method solves problems by storing and reusing the solutions to the subproblems?

Dynamic Programming

100

What is the time complexity of the second line of this program?

O(1)

200

First in, first out logic

Queue

200

Given an array of integers, find the maximum product of two elements in that array. What type of sorting algorithm would you use?

Answer choices: Merge Sort, Quick Sort, Heap Sort, Bubble Sort, Selection Sort

Bubble Sort

200

What is the main advantage of using a linked list compared to an array?

Size does not need to be known at compile time.

200

What technique or pattern is used by two pointers to process contiguous segments of an array efficiently?

Sliding Window

200

What is the time complexity of printing all elements in an array?

O(n)

300

At most 2 child nodes per parent node, left child less than parent node, and right child greater than parent node.

Binary Search Tree (BST)
300

You need to sort a list of student records based on their names while maintaining the relative order of students with the same name. Which sorting algorithm would be best for this stable sorting requirement?

Answer choices: Merge Sort, Quick Sort, Heap Sort, Bubble Sort, Selection Sort

Merge Sort

300

What is the main disadvantage of a double linked list compared to a singly linked list?

Increased memory use.

300

What are the two data elements used in the implementation of a sliding window algorithm?

A start pointer and an end pointer.

300

What is the worst time complexity for an insertion sort function and a bubble sort function?

O(n2)

400

Solving a problem by making the best choice at each step, or in other words, making the locally optimal decision.

Greedy Algorithm

400

You are given an unsorted array of integers and need to find a pair of numbers that sum up to a target value efficiently. Sorting the array first can help optimize the solution. What sorting algorithm would be most efficient?

Answer choices: Insertion Sort, Bubble Sort, QuickSort, Selection Sort, Heap Sort

Quick Sort

400

What is the extra node that’s added to the linked list to simplify handling edge cases during insertions and deletions?

Dummy Node

400

How does an O(n2) time complexity naive algorithm change after implementing the sliding window algorithm?

Changes to O(n).

400

What is the time complexity of a program that finds the greatest common divisor?

O(logn)

500

Classic problem where you maximize the total value of items in a container with limited weight capacity.

The Knapsack Problem

500

You need to find the top k largest elements in an unsorted array of size n. Which sorting algorithm would be most efficient for this task?

Answer choices: Insertion Sort, Bubble Sort, QuickSort, Selection Sort, Heap Sort

Heap Sort

500

How can you check if a singly linked list is palindrome in O(1) extra space?

Reverse the second half and compare it with the first half

500

How can you optimize a dynamic programming solution that relies on a range of previous states using a sliding window?

By using a deque to maintain and query candidate states efficiently.

500

What is the time complexity of this function?

O(2n)

M
e
n
u