What is a graph?
A data structure with a collection of nodes and edges that link nodes together
Find the path from 1 to 2 using BFS, higher number takes priority.
1 9 12 2
What is the MVC relationship?
Model-View-Controller
What keyword is used to prevent multiple threads from accessing the same object at the same time?
synchronized
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.
What data structure is used to find the final path when it's solved?
Predecessor map (HashMap<Node, Node>)
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)
What is an observer?
An object that listens to events fired from another object
What is it called when every thread is waiting on a resource that nobody is using?
Deadlock
What data structure is used to represent a min/max heap?
Tree
(Bonus points if you said ArrayList internally!)
What is a directed graph?
A graph where edges go from node A to node B, but not node B to node A
When using backtracking to solve a puzzle, what does each neighbor configuration represent?
Every next possible move a player could make
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
What is the correct method to implement for Runnable and what method do you call to make a new thread from it?
run(), start()
Trace the path from A to B using Dijkstra's shortest path algorithm.
ADGB (Work should be included)
What is a weighted graph?
A graph where edges have a value
Find the path from 1 to 2 using DFS, higher number takes priority.
1 9 9 0 7 3 2
I couldn't think of a question to put here
free points!
Why are threads useful?
You can run two or more different computations with more efficiency
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
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
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
Draw a tree representing a JavaFX hierarchy for this UI.
I can't draw a tree here well so I'll judge it
What does wait() and notify() do?
wait() stops the current thread from running, and notify() wakes up another thread currently waiting.
Draw out the heap after removing 3 elements.
i cant write this out either