Python
Java
Algorithms
Code
Miscellaneous
100

This Python function displays text on the standard output console.

What is print()?

100

This is the signature needed for every Java application for its execution starting point.

public static void main(String[] args)

100

This data structure enforces a Last In, First Out (LIFO) access order.

What is a stack?

100

What value is assigned to myVariable in this Java script?

double myVariable = 5 / 2;

2.0 (must be exact)

100

This is the first index number of lists/arrays in nearly all modern programming languages.

What is zero?

200

This Python data type represents an ordered, mutable sequence and is declared with square brackets.

What is a list?

200

True or False? "String" is one of Java's primitive data types.

False

200

This is the search algorithm that repeatedly divides an already-sorted list in half.

What is binary search?

200

What will be output by the following Python script?

count = 0

def increment():

     count = 5

increment()

print(count)

0

200

What decimal value (regular number) is represented by the binary string 1010?

Ten

300

This keyword defines the start of a custom function in Python.

What is def?

300

This keyword makes a variable immutable after initialization.

final

300

This algorithm design breaks a problem into sub problems and stores its results to avoid redundant work.

What is memoization? (Also acceptable: dynamic programming or tabulation)

300

This error occurs when a recursive function lacks a base case.

What is StackOverflowError (Java) or Recursion error (Python)?

300

This is the person recognized as the world's first computer programmer after she wrote an algorithm for the Analytical Engine.

Who is Ada Lovelace?

400

What does the following Python script evaluate to?

True + True + True

3

400

What is the output of the following Java script?

String s1 = "hello world";

String s2 = new String("hello world");

System.out.println(s1 == s2);

System.out.println(s1.equals(s2));

false

true

(must be case-sensitive)

400

This sorting algorithm typically has a time complexity of n*log(n), but has a worst-case time complexity of n^2, depending on its 'pivot.'

What is Quicksort?

400

What is the output of this Python script?

print("Hello world" * 0)

"" (empty string)

400

This is the hybrid animal used by GitHub as its mascot.

What is an Octocat?

500

What is the difference between the "==" operator and the "is" keyword in Python?

"==" checks for equal values, while "is" checks for identical memory locations.

500

What does the following Java script output?

System.out.println('A' + 'B');

131

500
What is the maximum number of comparisons that a Binary Search algorithm will make for a sorted array of 1,000,000 items?

20

500

What happens if the following Python expression is evaluated?

bool("False")

It evaluates to the boolean True.

500

This is the common term for a malicious piece of code hidden inside an otherwise legitimate-looking software package or library.

What is a Trojan Horse? (also acceptable: Supply-Chain attack)