Algorithms
Data Structures
Written Problems
Other CS Junk
Riddles
100

This sort pieces together pre-sorted lists to sort the list.

What is merge sort?

100

In Java, these structures cannot be resized.

What are arrays?

100

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Find 10101101+ AF16 in base 10.

34810

100

Random, but not really; literally falsely random.

What is psuedorandom?

100

ANSWERS NOT REQUIRED IN QUESTION FORMAT

!happy

sad

200

This sort has notoriously bad runtimes, with average and worst case O(n2). However, in ideal situations it is O(n).

What is bubble sort?

200

This data structure stores key-value pairs.

What is a map?

200

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Find the format of the following code:

Math.round(2.5);

(no output)

(There's no System.out.print, why would it print anything?)

200

This action, Java's case, converts Java to executable bytecode.

What is compliation? (accept word forms)

200

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Pa[American]ris

American in Paris

300

Java uses a dual-pivot type of this sort in Collections.sort. It is eponymously fast.

What is quicksort?

300

This data structure prohibits storage of duplicates.

What is a set?

300

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Find the output of the following code:

System.out.prinf("%(6.2f%%%n", -23.3);

(23.3)%

(Note: the code meant at least 6 characters long with 2 decimal places along with parenthesis in case the number is negative, which it is. The %% means put a percent sign, and %n just means new line, like \n.)

300

Something that represents nothing

What is null? (accept equivalents)

300

ANSWERS NOT REQUIRED IN QUESTION FORMAT

A==B&&B==C
┗> A==C

A=B and B=C, thus A=C

(or transitive property of equality)

400

This type of sort is used to sort a hand of cards. It is rather inefficient, though, with a worst case of O(n2) on computers.

What is insertion sort?

(Just try sorting a hand of cards with merge sort and see how that goes.)

400

It follows its namesake property that parents need to be larger than children in a max type of these.

What is a heap?

(Max heap, right? Heap property?)

400

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Find the output of the following code:

char c = 'd';
System.out.println(Integer.toString(c, 16));

68

(Note: first find the decimal equivalent of the character according to ASCII, then convert that to base 16.)

400

Scripting languages use this to determine an object's type.

What is duck typing?

400

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Brighton := egg
b/c !reason

Brighton is an egg for no reason whatsoever (accept similar answers)

500

This type of sort is used when sorting by letter.

What is radix sort?

(Note: Radix sort sorts numbers by digits, similar to how people sort words by letter.)

500

This data structure implements the mantra, "first come, first served."

What is a queue?

Note: "first come, first served" is just normal people talk for First In, First Out

500

ANSWERS NOT REQUIRED IN QUESTION FORMAT

Find the output of the following code:

System.out.println((new Math[1])[0].sqrt(64.0));

8.0

(Note: you can create an array of a non-instantiate-able class, since you're filling it with null. Furthermore, you can cast null to anything. Then you can call a class method on a null object, and it will function as if you did Math.sqrt)

500

This is the ability of code to inspect and change itself at runtime.

What is reflection?

500

ANSWERS NOT REQUIRED IN QUESTION FORMAT

{2B || !2B} -> ?

To be or not to be, that is the question.

M
e
n
u