Graphs & Searching
BFS & DFS
JavaFX GUIs
Threads
Everything Else
100

What is a graph?

A data structure with a collection of nodes and edges that link nodes together

100

Find the path from 1 to 2 using BFS, higher number takes priority.


1 9 12 2

100

What is the MVC relationship?

Model-View-Controller

100

What keyword is used to prevent multiple threads from accessing the same object at the same time?

synchronized

100

What is the difference between TCP and UDP, and what are good use cases for each?

TCP: A slower but more reliable protocol that ensures all packets are sent. Used for basically anything that requires all the information to stay intact like the web, email, and file transfers

UDP: A faster protocol that can potentially lose packets on the way to its recipient. Good for video streaming where lost packets don't matter as much.

200

What data structure is used to find the final path when it's solved?

Predecessor map (HashMap<Node, Node>)

200

What is the main difference between BFS and DFS?

BFS checks all the nodes 1 step away, then 2 steps away, and so on

DFS checks one node and immediately moves to the second step, and goes back if it runs into a dead end

(BFS returning the shortest path is also acceptable)

200

What is an observer?

An object that listens to events fired from another object

200

What is it called when every thread is waiting on a resource that nobody is using?

Deadlock

200

What data structure is used to represent a min/max heap?

Tree
(Bonus points if you said ArrayList internally!)

300

What is a directed graph?

A graph where edges go from node A to node B, but not node B to node A

300

When using backtracking to solve a puzzle, what does each neighbor configuration represent?

Every next possible move a player could make

300

Name four different types of JavaFX panes and what a pane does.

HBox, VBox, GridPane, BorderPane, FlowPane

Panes can hold a collection of other nodes

300

What is the correct method to implement for Runnable and what method do you call to make a new thread from it?

run(), start()

300

Trace the path from A to B using Dijkstra's shortest path algorithm.

ADGB (Work should be included)

400

What is a weighted graph?

A graph where edges have a value

400

Find the path from 1 to 2 using DFS, higher number takes priority.


1 9 9 0 7 3 2

400

I couldn't think of a question to put here

free points!

400

Why are threads useful?

You can run two or more different computations with more efficiency

400

What is the process of enqueueing and dequeueing elements on a heap?

Enqueue: Add to the end, then sift the node up until it is in the correct place

Dequeue: Sift the top node down until it's at the end of the heap, then remove it

500

Which algorithm do you use to find the shortest path between two nodes in a graph?

(Hint: There's more than one answer!)

BFS for unweighted graphs, and Dijkstra's for weighted graphs

500

What is the time complexity of BFS and DFS?

O|V+E|

where V is the number of vertices and E is the number of edges

500

Draw a tree representing a JavaFX hierarchy for this UI.

I can't draw a tree here well so I'll judge it

500

What does wait() and notify() do?

wait() stops the current thread from running, and notify() wakes up another thread currently waiting.

500

Draw out the heap after removing 3 elements.


i cant write this out either