Quiz
Week 1 Training
This quiz has question types that open in the usual player.
Questions in this quiz (136)
1What is an Array List?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
2What is a Linked List?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
3What is a Map?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
4What is a Hash Map?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
5What is a Set?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
6Syntax for using an iterator to move through a collection
- Awhile (iterator.hasNext()) {}
- Bdo {
System.out.println("\t" + nums[j]);
} while(j >= 0); - Cfor (int n : nums) {
System.out.println("\t" + n);
} - Dwhile (j >= 0) {
System.out.println("\t" + nums[j]);
} do; - Efor (int n % nums) {
System.out.println("\t" + n);
}
7Syntax for a do-while loop
- Awhile (iterator.hasNext()) {}
- Bdo {
System.out.println("\t" + nums[j]);
} while(j >= 0); - Cfor (int n : nums) {
System.out.println("\t" + n);
} - Dwhile (j >= 0) {
System.out.println("\t" + nums[j]);
} do; - Efor (int n % nums) {
System.out.println("\t" + n);
}
8Syntax for a for-each loop
- Awhile (iterator.hasNext()) {}
- Bdo {
System.out.println("\t" + nums[j]);
} while(j >= 0); - Cfor (int n : nums) {
System.out.println("\t" + n);
} - Dwhile (j >= 0) {
System.out.println("\t" + nums[j]);
} do; - Efor (int n % nums) {
System.out.println("\t" + n);
}
9Select which methods can be used with Array Lists
- A.add("lemon")
- B.add(0, "lemon")
- C.get(0)
- D.remove(0)
- E.remove("lemon")
- F.put("yellow", "lemon")
- G.remove("yellow", "lemon")
- H.get("yellow")
10Select which methods can be used with Linked Lists
- A.add("lemon")
- B.add(0, "lemon")
- C.get(0)
- D.remove(0)
- E.remove("lemon")
- F.put("yellow", "lemon")
- G.remove("yellow", "lemon")
- H.get("yellow")
11Select which methods can be used with Sets
- A.add("lemon")
- B.add(0, "lemon")
- C.get(0)
- D.remove(0)
- E.remove("lemon")
- F.put("yellow", "lemon")
- G.remove("yellow", "lemon")
- H.get("yellow")
12Select which methods can be used with Maps
- A.add("lemon")
- B.add(0, "lemon")
- C.get(0)
- D.remove(0)
- E.remove("lemon")
- F.put("yellow", "lemon")
- G.remove("yellow", "lemon")
- H.get("yellow")
13What is encapsulation?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
14What is polymorphism?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
15What is abstraction?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
16What is inheritance?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
17What is multithreading?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- CSplitting up different tasks onto threads that run concurrently, so multiple tasks can be done at the same time
- DWhen a class has access to the data within a parent class.
18How do we perform encapsulation?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
19How do we perform polymorphism?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
20How do we perform abstraction?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
21How do we perform inheritance?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
22Interfaces can have both abstract and regular methods.
- ATrue
- BFalse
23Abstract classes can have both abstract and regular methods.
- ATrue
- BFalse
24What is a record [Java]?
- AEssentially a class, but it already has final properties, a fully parameterized constructor, getters, toString, hashCode, and equals methods.
- BA form of storing data.
- CA type of collection that operates with key-value-value collections for each node in the collection.
25Records have setters
- ATrue
- BFalse
26Method overriding
- AWhen a child class creates its own version of a parent class's method.
- BWhen there are multiple of the same method signature in the same class, but with different parameters and/or return types.
27Method overloading
- AWhen a child class creates its own version of a parent class's method.
- BWhen there are multiple of the same method signature in the same class, but with different parameters and/or return types.
28Coupling
- AA measure of how many dependencies a class has on other classes.
- BA measure of how many different tasks a class performs.
29Cohesion
- AA measure of how many dependencies a class has on other classes.
- BA measure of how many different tasks a class performs.
30Low cohesion
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
31High cohesion
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
32Low coupling
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
33High coupling
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
34Low cohesion is [blank_start]bad[blank_end], high cohesion is [blank_start]good[blank_end].
Low coupling is [blank_start]good[blank_end], high coupling is [blank_start]bad[blank_end].- Abad
- Bgood
- Cgood
- Dbad
- Egood
- Fbad
- Gbad
- Hgood
35What is a factory?
- AA design pattern in which a class is used to instantiate objects. Has one general class/interface with a bunch of child objects. Decouples your code; rather than your main class having to depend on all these child objects, it just depends on this.
- BA design pattern in which a class has one entity [typically a thread] that makes/receives data to be used, and one entity [also typically a thread] that processes/manages/manipulates said data.
- CA design pattern in which a class can only have ONE instance of itself. Useful when working with threads, since it ensures every thread is using the same object.
36What is a producer/consumer pattern?
- AA design pattern in which a class is used to instantiate objects. Has one general class/interface with a bunch of child objects. Decouples your code; rather than your main class having to depend on all these child objects, it just depends on this.
- BA design pattern in which a class has one entity [typically a thread] that makes/receives data to be used, and one entity [also typically a thread] that processes/manages/manipulates said data.
- CA design pattern in which a class can only have ONE instance of itself. Useful when working with threads, since it ensures every thread is using the same object.
37What is a singleton?
- AA design pattern in which a class is used to instantiate objects. Has one general class/interface with a bunch of child objects. Decouples your code; rather than your main class having to depend on all these child objects, it just depends on this.
- BA design pattern in which a class has one entity [typically a thread] that makes/receives data to be used, and one entity [also typically a thread] that processes/manages/manipulates said data.
- CA design pattern in which a class can only have ONE instance of itself. Useful when working with threads, since it ensures every thread is using the same object.
38Eager loading [singletons]
- AInstantiating the object for a singleton ASAP. Tradeoff is that it's faster, but if you don't use it for a while you're now wasting the memory allocated to it.
- BInstantiating the object for a singleton ASAP. Tradeoff is that it causes compilation of the class to take longer, but it makes your code cleaner.
- CInstantiating the object for a singleton when it's asked for, like in a getInstance() method. Tradeoff is it's slower because now it needs to be asked for, but no memory is wasted.
- DInstantiating the object for a singleton when it's asked for, like in a getInstance() method. Tradeoff is it causes the call to getInstance() to take longer, but it makes your code cleaner.
39Lazy loading [singletons]
- AInstantiating the object for a singleton ASAP. Tradeoff is that it's faster, but if you don't use it for a while you're now wasting the memory allocated to it.
- BInstantiating the object for a singleton ASAP. Tradeoff is that it causes compilation of the class to take longer, but it makes your code cleaner.
- CInstantiating the object for a singleton when it's asked for, like in a getInstance() method. Tradeoff is it's slower because now it needs to be asked for, but no memory is wasted.
- DInstantiating the object for a singleton when it's asked for, like in a getInstance() method. Tradeoff is it causes the call to getInstance() to take longer, but it makes your code cleaner.
40Select the pros of using PrintWriter over System.out
- AAllows queuing a bunch of prints and flushing them all at once
- BAllows colored text to be printed
- CAllows tabbing, newline, font sizes, etc
- DProvides an alternative to concatenation for printing strings that are made up of variables
41Syntax for printing a string with PrintWriter, given the following variables:
String name = "name";
int age = 0;
double height = 0.0;- AconsoleOut.printf("%s is %d years old and is %.2f ft tall.\n", name, age, height);
- BconsoleOut.printf("%s is %d years old and is %.2f ft tall.\n", name, age, height);
consoleOut.flush(); - CconsoleOut.printf("%s is %d years old and is %.2f ft tall.\n", name, age, height);
consoleOut.printLine(); - DconsoleOut.printf("%String is %digits years old and is %.2float ft tall.\n", name, age, height);
consoleOut.flush(); - EconsoleOut.printf("%String is %digits years old and is %.2float ft tall.\n", name, age, height);
42Order the following pseudocode for a try-catch block:
[blank_start]try[blank_end] { /// }
[blank_start]catch (SpecificException specException)[blank_end] { /// }
[blank_start]catch (Exception e)[blank_end] { /// }- Atry
- Bcatch (SpecificException specException)
- Ccatch (Exception e)
43Syntax for instantiating a FileInputStream
- AInputStream inputStream = new FileInputStream(inputFile);
- BFileInputStream inputStream = new FileInputStream(inputFile);
- CInputStream inputStream = FileIO.class.getClassLoader().getResourceAsStream(inputFile);
- DInputStream inputStream = FileIO.class.getClassLoader(inputFile);
44Syntax for instantiating an input stream using a class loader + resource stream
- AInputStream inputStream = new FileInputStream(inputFile);
- BFileInputStream inputStream = new FileInputStream(inputFile);
- CInputStream inputStream = FileIO.class.getClassLoader().getResourceAsStream(inputFile);
- DInputStream inputStream = FileIO.class.getClassLoader(inputFile);
45Syntax for instantiating a FileOutputStream
- AOutputStream outputStream = new FileOutputStream(outputFile);
- BFileOutputStream outputStream = new FileOutputStream(outputFile);
- COutputStream outputStream = FileIO.class.getClassLoader().getResourceAsStream(outputFile);
- DOutputStream outputStream = FileIO.class.getClassLoader(outputFile);
46Select the option that reads in data from an input stream and writes it to a file correctly.
- Aint byteData;
while ((byteData = inputStream.read()) != -1 {
outputStream.write(byteData);
} - Bwhile (inputStream.nextByte() != 0) {
outputStream.write(inputStream.nextByte());
}
- Aint byteData;
47What's the difference in behavior between using FileInputStream versus the Class Loader + Resource Stream for instantiating an inputStream?
- AUsing a Class Loader + Resource Stream is needed for apps not running exclusively on your local machine
- BUsing a FileInputStream is needed for apps not running exclusively on your local machine
- CUsing a Class Loader + Resource Stream allows the input to come from a remote server rather than the local machine
- DUsing a FileInputStream allows the input to come from a remote server rather than the local machine
48What is the main difference between the JVM, JRE, and JDK in Java?
- AThe JVM contains the JDK and JRE, and it handles compiling and packaging Java code into executable files.
- BThe JVM provides tools for developing Java programs, while the JDK is responsible for running them, and the JRE compiles source code into bytecode
- CThe JRE and JDK are identical, but the JVM is only used for debugging Java programs
- DThe JDK includes tools for developing and running Java programs, it includes the JRE and JVM themselves. The JRE provides the environment to run said programs, and the JVM executes the compiled bytecode.
49What is the JDK [Java Development Kit]/what does it contain? Note: Do not select things that fall under the JRE and JVM, if those fall within the JDK.
- AContains all tools needed to run Java code
- BThe code the programmer has written
- CCompiler
- DDebugger
- EVerifies bytecode
- FJRE
- GJVM
- HDynamically loads libraries and classes
- ILoads and executes bytecode, interpreting it into machine code so its machine agnostic
- JThe heap
50What is the JRE [Java Runtime Environment]/what does it contain? Note: Do not select things that fall under the JDK and JVM, if those fall within the JRE.
- AContains all tools needed to run Java code
- BCompiler
- CDebugger
- DVerifies bytecode
- EJDK
- FJVM
- GDynamically loads libraries and classes
- HLoads and executes bytecode, interpreting it into machine code so its machine agnostic
- IThe heap
- JThe stack
51What is the JVM [Java Virtual Machine]/what does it contain? Note: Do not select things that fall under the JDK and JRE, if those fall within the JVM.
- AContains all tools needed to run Java code
- BCompiler
- CDebugger
- DJDK
- EJVM
- FDynamically loads libraries and classes
- GLoads and executes bytecode, interpreting it into machine code so its machine agnostic
- HThe heap
- IThe stack
- JThe code the programmer wrote
521. [blank_start]Java code compiled in compiler by JDK[blank_end]
2. [blank_start]Compiler converts code to bytecode[blank_end]
3. [blank_start]Bytecode is verified by the JRE[blank_end]
4. [blank_start]JRE passes bytecode into the JVM[blank_end]
5. [blank_start]JVM executes bytecode[blank_end]- AJava code compiled in compiler by JDK
- BCompiler converts code to bytecode
- CBytecode is verified by the JRE
- DJRE passes bytecode into the JVM
- EJVM executes bytecode
53Label the diagram for how memory management is performed in Java

- ACode
- BCompiler
- CDebugger
- DJDK
- EJRE
- FJVM
- GBytecode
54Select the features of the heap
- AManages objects and JRE classes
- BHierarchical memory management [Organized as a red-black tree]
- CHas the garbage collector, which does mark & sweep [When adding an object, it’s marked with a 0 by default. If accessible, the garbage collector changes that to a 1. If an obj is deleted [ie no longer reachable], it’s now marked as 0 and removed.]
- DManages methods, local variables, and reference variables
- EMemory managed linearly LIFO style
- F1 heap per thread, so there CAN be multiple heaps
- GWhen a method is called, it's added to the heap. Once it's done, it's removed from the heap.
55Select the features of the stack
- AManages objects and JRE classes
- BHierarchical memory management [Organized as a red-black tree]
- CHas the garbage collector, which does mark & sweep [When adding an object, it’s marked with a 0 by default. If accessible, the garbage collector changes that to a 1. If an obj is deleted [ie no longer reachable], it’s now marked as 0 and removed.]
- DManages methods, local variables, and reference variables
- EMemory managed linearly LIFO style
- F1 stack per thread, so there CAN be multiple stacks
- GWhen a method is called, it's added to the stack. Once it's done, it's removed from the stack.
56Definition of NEW thread state
- ACreated but not started yet [entered when you call new Thread()]
- BThread has started [Entered when you call thread.Start()]
- CThread is waiting on some lock to be lifted before continuing [needed resource is locked down]
- DTold to wait by program indefinitely until it's told to stop waiting (thread.join() or thread.wait())
- EWaiting for specified amount of time (thread.join(3000))
- FThread is finished
57Definition of RUNNABLE thread state
- ACreated but not started yet [entered when you call new Thread()]
- BThread has started [Entered when you call thread.Start()]
- CThread is waiting on some lock to be lifted before continuing [needed resource is locked down]
- DTold to wait by program indefinitely until it's told to stop waiting (thread.join() or thread.wait())
- EWaiting for specified amount of time (thread.join(3000))
- FThread is finished
58Definition of BLOCKED thread state
- ACreated but not started yet [entered when you call new Thread()]
- BThread has started [Entered when you call thread.Start()]
- CThread is waiting on some lock to be lifted before continuing [needed resource is locked down]
- DTold to wait by program indefinitely until it's told to stop waiting (thread.join() or thread.wait())
- EWaiting for specified amount of time (thread.join(3000))
- FThread is finished
59Definition of WAITING thread state
- ACreated but not started yet [entered when you call new Thread()]
- BThread has started [Entered when you call thread.Start()]
- CThread is waiting on some lock to be lifted before continuing [needed resource is locked down]
- DTold to wait by program indefinitely until it's told to stop waiting (thread.join() or thread.wait())
- EWaiting for specified amount of time (thread.join(3000))
- FThread is finished
60Definition of TIMED-WAITING thread state
- ACreated but not started yet [entered when you call new Thread()]
- BThread has started [Entered when you call thread.Start()]
- CThread is waiting on some lock to be lifted before continuing [needed resource is locked down]
- DTold to wait by program indefinitely until it's told to stop waiting (thread.join() or thread.wait())
- EWaiting for specified amount of time (thread.join(3000))
- FThread is finished
61Definition of TERMINATED thread state
- ACreated but not started yet [entered when you call new Thread()]
- BThread has started [Entered when you call thread.Start()]
- CThread is waiting on some lock to be lifted before continuing [needed resource is locked down]
- DTold to wait by program indefinitely until it's told to stop waiting (thread.join() or thread.wait())
- EWaiting for specified amount of time (thread.join(3000))
- FThread is finished
62What is a runnable interface?
- AA functional interface [interface with one method] for defining how threads will run
- BAn interface for defining how threads will run
- CAn interface that determines what order threads run in
- DAn interface that controls thread states
63Correct syntax for creating a runnable interface [There is more than 1 right answer]
- Aclass RunnableTask implements Runnable {
public RunnableTask() {//code}
@Override
public void run() { //code }
} - Bclass RunnableTask extends Thread {
public RunnableTask() {//code}
@Override
public void run() { //code }
} - Cclass RunnableTask implements Runnable {
public RunnableTask() {//code}
public void running() { //code }
} - Dclass RunnableTask extends Thread {
public RunnableTask() {//code}\
public void running() { //code }
}
- Aclass RunnableTask implements Runnable {
64What does a 'thread-safe' version of something ensure?
- AIt ensures that it will not terminate threads that touch it
- BIt ensures that there is synchronicity across all threads touching it
- CIt ensures that threads that touch it will not change its value
65Every thread has its own stack
- ATrue
- BFalse
66What does the volatile keyword do?
- AAllows other threads to manipulate the instance variable even when currently being altered, so that its value is synced across threads. Can only be used on fields.
- BKeeps the variable the same across all instances of a class by creating only 1 reference of it in memory, rather than 1 reference per instance. Can be used for fields and methods.
- C"All or none". Only the entire process occurs start-to-finish, or it doesn't happen at all. Can be used for fields and methods.
67What does the static keyword do?
- AAllows other threads to manipulate the instance variable even when currently being altered, so that its value is synced across threads. Can only be used on fields.
- BKeeps the variable the same across all instances of a class by creating only 1 reference of it in memory, rather than 1 reference per instance. Can be used for fields and methods.
- C"All or none". Only the entire process occurs start-to-finish, or it doesn't happen at all. Can be used for fields and methods.
68What does the atomic version of a value do?
- AAllows other threads to manipulate the instance variable even when currently being altered, so that its value is synced across threads. Can only be used on fields.
- BKeeps the variable the same across all instances of a class by creating only 1 reference of it in memory, rather than 1 reference per instance. Can be used for fields and methods.
- C"All or none". Only the entire process occurs start-to-finish, or it doesn't happen at all. Can be used for fields and methods.
69What is a lost update in multithreading?
- AWhen a variable is updated by one thread, but is then overridden by another thread.
- BA logic error in which a thread's state does not get updated when it was supposed to be.
- CAn error in which a thread fails to terminate.
70How can you create and run a thread in Java?
- ABy using the ThreadPool class without defining any run() method
- BBy importing the java.threading package and calling Thread.execute()
- CBy creating a Thread object and directly calling its run() method
- DBy instantiating a Thread object, passing into its constructor an object of a runnable interface, then calling start() on it.
71How does locking and unlocking work when managing threads in Java?
- ALocks are automatically managed by the JVM and cannot be controlled by the programmer
- BA thread can only lock itself but cannot unlock resources held by another thread
- CA thread can acquire a lock (using synchronized blocks or Lock objects) to ensure exclusive access to shared resources, and must release it when finished to prevent deadlocks
- DLocking is only required when using Thread.sleep() or wait() methods
72What is Test Driven Development?
- AWriting tests to cover every scenario that could run through your program, both alongside the rest of development, before, and afterwards.
- BWriting tests to cover every scenario that could run through your program before developing the code to which those tests will apply.
- CThe practice of testing the smallest chunks of an application as possible in isolation from the rest of the program.
73What is unit testing?
- AWriting tests to cover every scenario that could run through your program, both alongside the rest of development, before, and afterwards.
- BWriting tests to cover every scenario that could run through your program before developing the code to which those tests will apply.
- CThe practice of testing the smallest chunks of an application as possible in isolation from the rest of the program.
74What is Maven?
- AAutomates the process of having to import and update dependencies manually.
- BSets up the dev environment [src folder containing main and test] in a new project, and manages build cycle of said project, for the developer.
- CGenerates JUnit tests for the developer
- DBoth automates the process of having to import and update dependencies manually, and sets up the dev environment [src folder containing main and test] in a new project, and manages build cycle of said project, for the developer.
- EA testing framework for developing and running unit tests for your code.
75What is JUnit?
- AAutomates the process of having to import and update dependencies manually.
- BSets up the dev environment [src folder containing main and test] in a new project, and manages build cycle of said project, for the developer.
- CA tool that generates unit tests for the developer
- DBoth automates the process of having to import and update dependencies manually, and sets up the dev environment [src folder containing main and test] in a new project, and manages build cycle of said project, for the developer.
- EA testing framework for developing and running unit tests for your code.
76What does the @BeforeAll annotation do?
- AHas the method run once before all test methods
- BHas the method run once before each test method
- CHas the method run once before the rest of the class
77What does the @BeforeEach annotation do?
- AHas the method run once before all test methods
- BHas the method run once before each test method
- CHas the method run once before the rest of the class
78What does the @AfterAll annotation do?
- AHas the method run once after all test methods
- BHas the method run once after each test method
- CHas the method run once after the rest of the class
79What does the @AfterEach annotation do?
- AHas the method run once after all test methods
- BHas the method run once after each test method
- CHas the method run once after the rest of the class
80What does the @Test annotation do?
- ADeclares the method beneath it to be ran as a test case
- BDeclares the method beneath it to be in progress
- CDeclares the method beneath it to be a draft
81Which annotation prevents its following method from running?
- A@Disabled
- B@Stop
- C@Disengage
82Which annotation allows a specific title to be printed when its assigned test is ran?
- A@DisplayName("Title")
- B@DisplayTitle("Title")
- C@Name("Title")
- D@Title("Title")
83Select the correct syntax for a test case method with JUnit
- A@Test
public void testSampleMethod() { //code } - Bpublic TestResult testSampleMethod() { //code }
- C@TestCase
public void testSampleMethod() { //code }
- A@Test
84What are feature branches?
- AGit branches used to develop code for a specific feature
- BGit branches that are only used to resolve merge conflicts
- CGit branches used to resolve bugs
- DGit branches that are automatically created by GitHub
85What does the Push command for GitHub do?
- AMoves code from local to remote
- BMoves code from remote to local
- CMoves to a new branch in the repo
- DCombines branches
- EPuts new/altered files into staging
- FSaves everything added to the repo locally
86What does the Pull command for GitHub do?
- AMoves code from local to remote
- BMoves code from remote to local
- CMoves to a new branch in the repo
- DCombines branches
- EPuts new/altered files into staging
- FSaves everything added to the repo locally
87What does the Checkout command for GitHub do?
- AMoves code from local to remote
- BMoves code from remote to local
- CMoves to a new branch in the repo
- DCombines branches
- EPuts new/altered files into staging
- FSaves everything added to the repo locally
88What does the Merge command for GitHub do?
- AMoves code from local to remote
- BMoves code from remote to local
- CMoves to a new branch in the repo
- DCombines branches
- EPuts new/altered files into staging
- FSaves everything added to the repo locally
89What does the Add command for GitHub do?
- AMoves code from local to remote
- BMoves code from remote to local
- CMoves to a new branch in the repo
- DCombines branches
- EPuts new/altered files into staging
- FSaves everything added to the repo locally
90What does the Commit command for GitHub do?
- AMoves code from local to remote
- BMoves code from remote to local
- CMoves to a new branch in the repo
- DCombines branches
- EPuts new/altered files into staging
- FSaves everything added to the repo locally
91[Github] What is staging?
- AThe first step of making a commit in GitHub. It's the act of putting code into the staging area, which is where code goes when you want to commit it.
- BIt's the act of saving files that belong in a repository on your local machine.
92Drag and drop the order of sending local code to the GitHub server repo
1. [blank_start]Add[blank_end]
2. [blank_start]Commit[blank_end]
3. [blank_start]Push[blank_end]- AAdd
- BStage
- CCommit
- DPush
- EPull
- FMerge
93A database table can have multiple primary keys.
- ATrue
- BFalse
94What are typically used in database schemas to handle many-to-many relationships?
- AComposite Primary Keys
- BNothing. Modern relational database management systems can handle many-to-many relationships.
- CComposite Foreign Keys
- DJunction Tables
95Label the tables with Lookup Table or Junction Table

- ALookup Table
- BJunction Table
- CLookup Table
- DJunction Table
- ELookup Table
- FJunction Table
96What is data modeling?
- AA representation of a database, it shows the relationship between tables and should be easy to understand.
- BA software that handles the representation of a database to the end user.
97Order the stages of data modeling
1. [blank_start]Conceptual model[blank_end]
2. [blank_start]Logical model[blank_end]
3. [blank_start]Physical model[blank_end]- AConceptual model
- BLogical model
- CPhysical model
98What is a conceptual model?
- AA model that displays an abstract view of data and relationships. Only contains tables[entities], not any attributes or descriptions.
- BA model that includes attributes [primary keys, foreign keys, email, name, etc], what type of relationship [1:1, 1:M, M:N] each entity has with each other. Think ERD.
- CA model used to create a database, so you must include all attributes and assign data types.
99What is a logical model?
- AA model that displays an abstract view of data and relationships. Only contains tables[entities], not any attributes or descriptions.
- BA model that includes attributes [primary keys, foreign keys, email, name, etc], what type of relationship [1:1, 1:M, M:N] each entity has with each other. Think ERD.
- CA model used to create a database, so you must include all attributes and assign data types.
100What is a physical model?
- AA model that displays an abstract view of data and relationships. Only contains tables[entities], not any attributes or descriptions.
- BA model that includes attributes [primary keys, foreign keys, email, name, etc], what type of relationship [1:1, 1:M, M:N] each entity has with each other. Think ERD.
- CA model used to create a database, so you must include all attributes and assign data types.
101[DB] What is an entity?
- AA row in a table in a database
- BA table/collection of attributes in a database, like Person or Car
- CA property of a table in a database, like age or name
102[DB] What is an attribute?
- AA row in a table in a database
- BA table/collection of attributes in a database, like Person or Car
- CA property of a table in a database, like age or name. Represented as a column in a table.
103[DB] What is a record?
- AA row in a table in a database
- BA table/collection of attributes in a database, like Person or Car
- CA property of a table in a database, like age or name. Represented as a column in a table.
104[DB] What is a strong entity?
- AA table with exclusively a primary key. It doesn’t rely on other entities to exist.
- BA table with a foreign key[s]. Needs to rely on another entity to exist.
105[DB] What is a weak entity?
- AA table with exclusively a primary key. It doesn’t rely on other entities to exist.
- BA table with a foreign key[s]. Needs to rely on another entity to exist.
106All primary keys are candidate keys
- ATrue
- BFalse
107All candidate keys are primary keys
- ATrue
- BFalse
108What is a candidate key?
- AAny attribute/set of attributes that uniquely identifies a row [record] in a table. Every entry under this column must be unique.
- BA key with a single attribute/column to identify records. Primary keys fall under this. EX: Student ID in a Student table/entity
- CMultiple attributes/columns make up a singular key. A primary key can not also be this. EX: Student ID + Course ID in a Student_Course table/entity
- DAn auto-incremented primary key.
- EAn attribute used to uniquely identify records in an entity. All of them are candidate keys.
- FAn attribute used to link a table to the one it depends on's primary key. They do not have to be unique.
109What is a simple key?
- AAny attribute/set of attributes that uniquely identifies a row [record] in a table. Every entry under this column must be unique.
- BA key with a single attribute/column to identify records. Primary keys fall under this. EX: Student ID in a Student table/entity
- CMultiple attributes/columns make up a singular key. A primary key can not also be this. EX: Student ID + Course ID in a Student_Course table/entity
- DAn auto-incremented primary key.
- EAn attribute used to uniquely identify records in an entity. All of them are candidate keys.
- FAn attribute used to link a table to the one it depends on's primary key. They do not have to be unique.
110What is a composite key?
- AAny attribute/set of attributes that uniquely identifies a row [record] in a table. Every entry under this column must be unique.
- BA key with a single attribute/column to identify records. Primary keys fall under this. EX: Student ID in a Student table/entity
- CMultiple attributes/columns make up a singular key. A primary key can not also be this. EX: Student ID + Course ID in a Student_Course table/entity
- DAn auto-incremented primary key.
- EAn attribute used to uniquely identify records in an entity. All of them are candidate keys.
- FAn attribute used to link a table to the one it depends on's primary key. They do not have to be unique.
111What is a surrogate key?
- AAny attribute/set of attributes that uniquely identifies a row [record] in a table. Every entry under this column must be unique.
- BA key with a single attribute/column to identify records. Primary keys fall under this. EX: Student ID in a Student table/entity
- CMultiple attributes/columns make up a singular key. A primary key can not also be this. EX: Student ID + Course ID in a Student_Course table/entity
- DAn auto-incremented primary key.
- EAn attribute used to uniquely identify records in an entity. All of them are candidate keys.
- FAn attribute used to link a table to the one it depends on's primary key. They do not have to be unique.
112What is a primary key?
- AAny attribute/set of attributes that uniquely identifies a row [record] in a table. Every entry under this column must be unique.
- BA key with a single attribute/column to identify records. Primary keys fall under this. EX: Student ID in a Student table/entity
- CMultiple attributes/columns make up a singular key. A primary key can not also be this. EX: Student ID + Course ID in a Student_Course table/entity
- DAn auto-incremented primary key.
- EAn attribute used to uniquely identify records in an entity. All of them are candidate keys.
- FAn attribute used to link a table to the one it depends on's primary key. They do not have to be unique.
113What is a foreign key?
- AAny attribute/set of attributes that uniquely identifies a row [record] in a table. Every entry under this column must be unique.
- BA key with a single attribute/column to identify records. Primary keys fall under this. EX: Student ID in a Student table/entity
- CMultiple attributes/columns make up a singular key. A primary key can not also be this. EX: Student ID + Course ID in a Student_Course table/entity
- DAn auto-incremented primary key.
- EAn attribute used to uniquely identify records in an entity. All of them are candidate keys.
- FAn attribute used to link a table to the one it depends on's primary key. They do not have to be unique.
114What relationship type in databases does the following describe:
A single record [row] in table A relates to a single record [row] in table B. Typically used exclusively for security purposes to create a critical relationship between tables, like how a person only has 1 drivers license and vice versa.- AOne-to-One [1:1]
- BOne-to-Many [1:M]
- CMany-to-Many [M:N]
- DRight-skewed relationship
- ELeft-skewed relationship
- FCentral relationship
115What relationship type in databases does the following describe:
A single record [row] in table A relates to multiple records [rows] in table B.- AOne-to-One [1:1]
- BOne-to-Many [1:M]
- CMany-to-Many [M:N]
- DRight-skewed relationship
- ELeft-skewed relationship
- FCentral relationship
116What relationship type in databases does the following describe:
Multiple records [rows] in table A relate to multiple records [rows] in table B. These generally require a junction table to connect the two entities, which are now lookup tables.- AOne-to-One [1:1]
- BOne-to-Many [1:M]
- CMany-to-Many [M:N]
- DRight-skewed relationship
- ELeft-skewed relationship
- FCentral relationship
117What is a junction table?
- AA table connecting two entities, used when joining the related tables together. Contains the primary keys for the connecting tables.
- BA regular table with a set of unique values that stores data referenced by other tables.
- CA table that results from JOINing multiple tables together.
- DA table that stores common SQL queries for quick querying
118What is a lookup table?
- AA table connecting two entities, used when joining the related tables together. Contains the primary keys for the connecting tables.
- BA regular table with a set of unique values that stores data referenced by other tables.
- CA table that results from JOINing multiple tables together.
- DA table that stores common SQL queries for quick querying
119What is the process of organizing attributes of a database to reduce/eliminate data redundancy and improve efficiency, consistency, and accuracy called?
- ANormalization
- BOrganization
- CQuerying
- DChunking
120[DB] What is an insertion anomaly?
- AWhen it’s impossible to insert certain types of data into the database
- BWhen updating the value of an attribute leads to database inconsistencies
- CWhen the deletion of data causes unintended loss :.|:;
121[DB] What is an update anomaly?
- AWhen it’s impossible to insert certain types of data into the database
- BWhen updating the value of an attribute leads to database inconsistencies
- CWhen the deletion of data causes unintended loss :.|:;
122[DB] What is a deletion anomaly?
- AWhen it’s impossible to insert certain types of data into the database
- BWhen updating the value of an attribute leads to database inconsistencies
- CWhen the deletion of data causes unintended loss :.|:;
123What are normal forms?
- AA set of progressive rules for relational databases that reduce redundancy and prevent data anomalies. The higher the normal form, the more tables you have and the less data contained in each table.
- BA set of rules for the organization of relational databases. Each have their own style and their own pros and cons, but following different ones is ultimately up to preference.
124Select the rules/properties of 1NF [1st Normal Form] [Not including the rules of the form before it]
- AEvery table must have a primary key, so that every record is unique
- BPrevents insertion anomaly
- CColumns must have unique names and only have 1 data type
- DOnly 1 value per record can be put under a column
- ENo partial dependencies; each non-key attribute in a table must be dependent on the entire primary key.
- FNon-key attributes must only rely on key attributes. They can’t rely on other non-key attributes, either directly or indirectly. No transitive dependencies [When an attribute depends on an attribute that depends on another attribute]
- GSatisfies 2NF
125Select the rules/properties of 2NF [2nd Normal Form] [Not including the rules of the form before it]
- AEvery table must have a primary key, so that every record is unique
- BPrevents insertion anomaly
- CColumns must have unique names and only have 1 data type
- DOnly 1 value per record can be put under a column
- ENo partial dependencies; each non-key attribute in a table must be dependent on the entire primary key.
- FNon-key attributes must only rely on key attributes. They can’t rely on other non-key attributes, either directly or indirectly. No transitive dependencies [When an attribute depends on an attribute that depends on another attribute]
- GSatisfies 1NF
- HSatisfies 3NF
126Select the rules/properties of 3NF [3rd Normal Form] [Not including the rules of the form before it]
- AOnly 1 value per record can be put under a column
- BNo partial dependencies; each non-key attribute in a table must be dependent on the entire primary key.
- CNon-key attributes must only rely on key attributes. They can’t rely on other non-key attributes, either directly or indirectly. No transitive dependencies [When an attribute depends on an attribute that depends on another attribute]
- DSatisfies 2NF
- ESatisfies BCNF
- FSatisfies 4NF
- GEvery non-trivial functional dependency must be a superkey. EX: If Instructor depends on StudentID and CourseID, but one of them is not a superkey, it violates 3NF.
127Select the rules/properties of BCNF [Boyce-Codd Normal Form] [Not including the rules of the form before it]
- ANon-key attributes must only rely on key attributes. They can’t rely on other non-key attributes, either directly or indirectly. No transitive dependencies [When an attribute depends on an attribute that depends on another attribute]
- BSatisfies 3NF
- CSatisfies BCNF
- DSatisfies 4NF
- EEvery non-trivial functional dependency must be a superkey. EX: If Instructor depends on StudentID and CourseID, but one of them is not a superkey, it violates BCNF.
- FNo multi-valued dependencies. EX: In a Student table, students can have multiple languages and multiple hobbies. This causes many different combinations despite them being independent traits, so the table must be split into two.
128Select the rules/properties of 4NF [4th Normal Form] [Not including the rules of the form before it]
- ASatisfies 5NF
- BSatisfies BCNF
- CSatisfies 3NF
- DEvery non-trivial functional dependency must be a superkey. EX: If Instructor depends on StudentID and CourseID, but one of them is not a superkey, it violates 4NF.
- ENo multi-valued dependencies. EX: In a Student table, students can have multiple languages and multiple hobbies. This causes many different combinations despite them being independent traits, so the table must be split into two.
- FAll join dependencies are eliminated; every table is decomposed into the smallest possible size without losing data. EX: If there’s a dependency that requires multiple combinations of columns in a table, split it into multiple tables to remove redundancy.
129Select the rules/properties of 5NF [5th Normal Form] [Not including the rules of the form before it]
- ASatisfies 4NF
- BSatisfies 6NF
- CEvery non-trivial functional dependency must be a superkey. EX: If Instructor depends on StudentID and CourseID, but one of them is not a superkey, it violates 4NF.
- DNo multi-valued dependencies. EX: In a Student table, students can have multiple languages and multiple hobbies. This causes many different combinations despite them being independent traits, so the table must be split into two.
- EAll join dependencies are eliminated; every table is decomposed into the smallest possible size without losing data. EX: If there’s a dependency that requires multiple combinations of columns in a table, split it into multiple tables to remove redundancy.
130[SQL] What does using Inner Join in a SELECT query do?
- AReturns ONLY matching rows between tables being joined on a shared column [PK and FK] between them
- BReturns ALL rows from both tables being joined on a shared column [PK and FK]
- CReturns ALL rows from the first table and ONLY matching rows from the second table being joined on a shared column [PK and FK]
- DReturns ONLY matching rows from the first table and ALL rows from the second table being joined on a shared column [PK and FK]
- EIndiscriminately joins everything in tables being joined, does not join on any column
- FA regular join, but the table is joined with itself [using an alias]. They're for when you want a table to reference itself. Used for hierarchical or parent/child data, but quite rarely used.
131[SQL] What does using Outer Join in a SELECT query do?
- AReturns ONLY matching rows between tables being joined on a shared column [PK and FK] between them
- BReturns ALL rows from both tables being joined on a shared column [PK and FK]
- CReturns ALL rows from the first table and ONLY matching rows from the second table being joined on a shared column [PK and FK]
- DReturns ONLY matching rows from the first table and ALL rows from the second table being joined on a shared column [PK and FK]
- EIndiscriminately joins everything in tables being joined, does not join on any column
- FA regular join, but the table is joined with itself [using an alias]. They're for when you want a table to reference itself. Used for hierarchical or parent/child data, but quite rarely used.
132[SQL] What does using Left Join in a SELECT query do?
- AReturns ONLY matching rows between tables being joined on a shared column [PK and FK] between them
- BReturns ALL rows from both tables being joined on a shared column [PK and FK]
- CReturns ALL rows from the first table and ONLY matching rows from the second table being joined on a shared column [PK and FK]
- DReturns ONLY matching rows from the first table and ALL rows from the second table being joined on a shared column [PK and FK]
- EIndiscriminately joins everything in tables being joined, does not join on any column
- FA regular join, but the table is joined with itself [using an alias]. They're for when you want a table to reference itself. Used for hierarchical or parent/child data, but quite rarely used.
133[SQL] What does using Right Join in a SELECT query do?
- AReturns ONLY matching rows between tables being joined on a shared column [PK and FK] between them
- BReturns ALL rows from both tables being joined on a shared column [PK and FK]
- CReturns ALL rows from the first table and ONLY matching rows from the second table being joined on a shared column [PK and FK]
- DReturns ONLY matching rows from the first table and ALL rows from the second table being joined on a shared column [PK and FK]
- EIndiscriminately joins everything in tables being joined, does not join on any column
- FA regular join, but the table is joined with itself [using an alias]. They're for when you want a table to reference itself. Used for hierarchical or parent/child data, but quite rarely used.
134[SQL] What does using Cross Join in a SELECT query do?
- AReturns ONLY matching rows between tables being joined on a shared column [PK and FK] between them
- BReturns ALL rows from both tables being joined on a shared column [PK and FK]
- CReturns ALL rows from the first table and ONLY matching rows from the second table being joined on a shared column [PK and FK]
- DReturns ONLY matching rows from the first table and ALL rows from the second table being joined on a shared column [PK and FK]
- EIndiscriminately joins everything in tables being joined, does not join on any column
- FA regular join, but the table is joined with itself [using an alias]. They're for when you want a table to reference itself. Used for hierarchical or parent/child data, but quite rarely used.
135[SQL] What does using Self Join in a SELECT query do?
- AReturns ONLY matching rows between tables being joined on a shared column [PK and FK] between them
- BReturns ALL rows from both tables being joined on a shared column [PK and FK]
- CReturns ALL rows from the first table and ONLY matching rows from the second table being joined on a shared column [PK and FK]
- DReturns ONLY matching rows from the first table and ALL rows from the second table being joined on a shared column [PK and FK]
- EIndiscriminately joins everything in tables being joined, does not join on any column
- FA regular join, but the table is joined with itself [using an alias]. They're for when you want a table to reference itself. Used for hierarchical or parent/child data, but quite rarely used.
136[SQL] Select the correct syntax for performing a join [that is not a cross join]
- ASELECT Album.AlbumId, Album.Title, Track.Name FROM Album
[JOIN] Track ON Album.AlbumId = Track.AlbumId; - BSELECT Album.AlbumId, Album.Title, Track.Name FROM Album, Track;
- CSELECT Album.AlbumId, Album.Title, Track.Name FROM Album, Track
[JOIN] ON Album.AlbumId = Track.AlbumId;
- ASELECT Album.AlbumId, Album.Title, Track.Name FROM Album
Information
- Description
- Full Stack Development SkillStorm Training Quiz on Week 1 Training, created by myc elium on 19/11/2025.
- Author
- myc elium
- Language
- English
- Views
- 51
- Tags
- Rating
- No ratings yet Rate this quiz