Study Guide Flashcards

1
Q

What is Compilation

A

The process a computer takes to convert high level language to machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does it mean for Java to be strongly typed?

A

Every variable must be declared with a data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are primitive types?

A

Specifies the size and type of variable values and has no additional methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 8 primitive types in Java

A

byte
short
int
long
float
double
boolean
char

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a method?

A

A collection of statements grouped together to perform an operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does ‘return’ do?

A

Finishes the execution of a method and returns a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a return type?

A

A data type of the value returned from the method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the return type ‘void’ mean?

A

A method doesn’t return a value or contain a return statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a method parameter?

A

Values passed into a method to manipulate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the different boolean operators?

A

== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
&& Logical and
|| Logical or
! Logical not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Strings in Java?

A

Sequences of characters represented as an instance of the java.lang.String class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a Stack Trace?

A

List of method calls the application was in the middle of when an Exception was thrown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the main method?

A

Starting point for the JVM (Java Virtual Machine) to start execution of a Java program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the Syntax of the main method?

A

public static void main( String args[] ) {

{

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is OOP?

A

Object Oriented Programming. It organized software design around Data or Objects, rather than functions and logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are Objects?

A

Instances of a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What makes an Object different from a Primitive Type?

A

Objects are user-defined, default value is null, kept in a heap, and the reference variable is kept in the stack

Primitive Types are pre-defined, can’t contain null value as the default, and kept in the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the relationship between a Class and an Object in Java?

A

Objects are the instances of Classes.
Classes are the “blueprint” for Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are constructors?

A

Special methods used to initialize Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the default constructor?

A

Java compiler automatically creates a no arg constructor if we do not create any constructors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is an Array?

A

A collection of similar data elements stored at contiguous memory location. Can be accessed directly by it’s index value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How do I get an element of an Array?

A

Calling the index number.

String[] fruit = {apple, orange, bananan};

System.out.println(fruit[1]); // gets element “orange”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the different flow control statements in Java?

A

if statements
for loops
while loops
do while loops
switch statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How is a for loop written in Java?

A

for(int i = 0; i < 5; i++){
some code
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the difference between ++i and i++

A

++i pre-increment: we want to increment the value by one then use it
i++ post-increment: we want to use the value then increment it by one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the difference between a while loop and a do-while loop?

A

A do while loop runs through the loop at least once before checking the condition. A while loop must pass the condition before running through the loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are break statements?

A

They are used to terminate the enclosing loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What are continue statements?

A

They skip the rest of the loop where it is declared and then executes another iteration of the loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is JUnit?

A

A unit testing framework for Java with the idea of “first testing then coding”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is a unit test?

A

Individual units of source code that are tested to determine if they are fit for use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What are some annotations used in JUnit?

A

@test
@Before
@BeforeClass
@After
@AfterClass
@Ignores
@Test(timeout=500)
@Test(expected=IllegalArgumentException.class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is TDD?

A

Test-Driven Development: A process of relying on software requirements converted to test cases before being developed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What are Exceptions in Java?

A

Unwanted or unexpected events that occur during the execution of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

How are Errors different from Exceptions?

A

Error is used to indicate errors having to do with the runtime environment itself. They indicate a serious problem that a reasonable app should not try to catch.

Exceptions indicate conditions that an application might try to catch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is the difference between checked and unchecked Exceptions?

A

Checked exceptions are checked at compile time by the compiler. You should use the ‘throws’ keyword.

Unchecked exceptions are not checked at compile time and is up to the programmer to specify how to catch these exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What might cause a NullPointerException?

A

When an application attempts to use an object reference that has a null value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Is ArrayIndexOutOfBoundsException a runtime exception?

A

Yes, the compiler does not check for this error during compilation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Is FileNotFoundException a runtime exception?

A

No, it is checked during compilation so it is a checked exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

How do I find where an exception was thrown in a program?

A

In the exception stacktrace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What does ‘throws’ do?

A

Indicates what exception type may be thrown by a method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What does try/catch do?

A

Tries a risky block of code that might cause an exception and catches the exception to continue the program instead of terminating

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

Can I have multiple catch blocks? Multiple try blocks?

A

Yes but each try block must be followed by a catch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What are Collections in Java?

A

Group of individual objects which are represented as a single unit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What is the difference between a List and a Set?

A

Lists are indexed and allows duplicates
Sets are unordered and can’t have any duplicates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What is the difference between a Set and a Map?

A

Both don’t allow duplicates and are unordered, however Maps allow any number of null values while Sets can only contain one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is the difference between a Stack and a Queue?

A

Stacks are Last In First Out: the elements inserted at the last index is the first element to come out of the list

Queues are First In First Out: elements inserted at the first position are the first to come out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

What is the difference between ArrayList and LinkedList?

A

ArrayLists store only similar data types and LinkedLists can store any type of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Are Maps part of the Collection Interface?

A

No since map require key-value pairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

What is a wrapper class?

A

Class whos Object wraps or contains primitive data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

What do access modifiers do?

A

Sets access levels for classes, variables, methods, and constructors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What are the 4 access modifiers?

A

Default: When not explicitly declared, available to any other class in the same package

Private: Access only within the declared class itself

Protected: Can be accessed only by the subclasses in other package or any class within the same package of the protected member

Public: Can be accessed from any other class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

What are the non-access modifiers in Java?

A

Static
Final
Abstract
Synchronized/Volitile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

What does Static do?

A

Creates methods that will exist independently of any instances created for the class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

What does Final do?

A

Can only be explicitly initialized once and variables can’t be reassigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

What is Scope in programming languages?

A

Defines where methods or variables are accessed in a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

What are the different scopes in Java?

A

Class Level
Method Level
Block Level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

What is SQL and why is it used?

A

Structured Query Language for accessing and manipulating databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

What are the sublanguages of SQL?

A

DDL: Data Definition Language
DML: Data Manipulation Language
DRL/DQL: Data Retrieval Language/Query
TCL: Transaction Query Language
DCL: Data Control Language
SCL: Session Control Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

Commands for DDL (Data Definition Language)

A

Create
Alter
Drop
Truncate
Rename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

Commands for DML (Data Manipulation Language)

A

Insert
Update
Delete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

Commands for DRL/DQL (Data Retrieval/Query Language)

A

SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

What is a table in SQL?

A

A collection of related data held in a database that consists of columns and rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

What are primary keys for?

A

Uniquely identifies each record in a table
Must be unique and not null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

How do I query everything from a table?

A

SELECT * FROM table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
65
Q

How do I query only the rows that meet some criteria in a table?

A

SELECT * FROM table WHERE condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
66
Q

How do I insert into a table?

A

INSERT INTO table (columns) VALUES (values)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
67
Q

How do I update values in a table?

A

UPDATE table SET column = value WHERE condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
68
Q

How do I sort the results of a query in SQL?

A

SELECT * FROM table ORDER BY column ASC/DESC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q

What do aggregate functions do in SQL?

A

Performs a calculation on a set of values and returns a single value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

What are some aggregate functions?

A

COUNT()
MAX()
MIN()
AVG()
ABS()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
71
Q

What is the difference between drop, delete, and truncate?

A

DROP: Deletes an entire table
DELETE: Deletes specific records from a table
TRUNCATE: Removes all records from a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
72
Q

What is JDBC?

A

Java Database Connectivity allows programs to access database management systems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
73
Q

What are the different classes/interfaces used in JDBC?

A

DriveManager
Driver
Statement
PreparedStatement
CallableStatement
Connection
ResultSet
ResultSetMetaData

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
74
Q

What is DAO for?

A

Data Access Object is a structural pattern that allows us to isolate the application from the persistence layer(database)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
75
Q

What is Mockito for?

A

Used to mock interfaces so that dummy functionality can be added to a mock interface that can be used in unit testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
76
Q

How are Mock Objects in Mockito created?

A

Writing methods to test followed by @TEST with a method for the expected results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
77
Q

What is HTTP?

A

HyperText Transfer Protocol is a set of rules that describe how info is exchanged and allows the client and server to communicate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
78
Q

What are HTTP Verbs?

A

Get
Post
Put
Patch
Delete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
79
Q

What is GET usually used for?

A

Retrieves a list of entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
80
Q

What is POST usually used for?

A

Creating an entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
81
Q

What is PUT usually used for?

A

Updating an Entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
82
Q

What is PATCH usually used for?

A

Partially updating an entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
83
Q

What is DELETE usually used for?

A

Deleting an entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
84
Q

What are 100-level status codes for?

A

Informational response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
85
Q

What are 200-level status codes for?

A

Successful Requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
86
Q

What are 300-level status codes for?

A

Redirection, further action needed to be taken to complete the request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
87
Q

What are 400-level status codes for?

A

Client side error, request contains a bad syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
88
Q

What are 500-level status codes for?

A

Server side error, Server failed to fulfill a bad request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
89
Q

What is a path parameter?

A

Request parameters attached to a URL to point to a specific rest API resource. Appear before the question mark in the URL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
90
Q

What is a query parameter?

A

Optional key-value pairs that appear after the question mark in the URL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
91
Q

What is a request body?

A

Data transmitted to an HTTP transaction immediately following the headers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
92
Q

What is a response body?

A

Data transmitted to an HTTP transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
93
Q

What are headers?

A

They let the client and server pass additional info with an HTTP request. Consists of case-insensitive name followed by : then it’s value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
94
Q

What is JSON?

A

File format and data interchange format that uses human readable text to store and transmit data. Uses key-value pairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
95
Q

What is Javalin?

A

A lightweight REST API library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
96
Q

How can I design an endpoint in Javalin?

A

app.get(“/url”, this::methodnamehandler);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
97
Q

What is the Context object used for in Javalin?

A

Allows you to handle an http-request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
98
Q

Can you explain the 3-layer controller-service-DAO architecture?

A

Controller: handles the navigation between different views

Service: Stands on top of the persistence mechanissm to handle users requirements

DAO: Encapsulates the details from the persistence layer and provides a crud interface for a single entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
99
Q

What is Maven?

A

Build automation tool that adds new dependencies for building and managing projects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
100
Q

What file should be changed to add new Maven dependencies?

A

pom.xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
101
Q

What is the Maven lifecycle?

A

validate
compile
test
package
integration test
verify
install
deploy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
102
Q

How do I find and add a new dependency to Maven?

A

mvn install -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
103
Q

What are foreign keys in SQL?

A

A field in one table that refers to the primary key in another table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
104
Q

What is the referential integrity in SQL?

A

Refers to the relationship between tables. It’s the logical dependency of a foreign key on a primary key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
105
Q

What is a constraint in SQL?

A

Rules enforced on the data columns of a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
106
Q

What is the NOT NULL constraint?

A

The value must be filled into that field…Can’t be left blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
107
Q

What is the UNIQUE constraint?

A

Makes sure the column’s value is unique in the table…No duplicate values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
108
Q

What does GROUP BY do?

A

Groups rows that have the same values into summary rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
109
Q

What does HAVING do?

A

Used to filter the results of a GROUP BY query based on aggregate calculations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
110
Q

What is an alias in SQL?

A

Temporarily renaming a table or column for easier reading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
111
Q

What is multiplicity in SQL?

A

Specifies the number of instances of a type of data in a table?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
112
Q

What the different types of multiplicity?

A

one to many
zero or one to one
zero or one to many

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
113
Q

What do you need to add to have one to many multiplicity?

A

an entity instance can be related to multiple instances of the other entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
114
Q

What do you need to add to have many to many multiplicity?

A

Entity instances can be related to multiple instances of eachother

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
115
Q

How do you modify existing tables?

A

ALTER TABLE table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
116
Q

What is normalization and why do we use it?

A

Process of taking a database design and apply a set of formal criteria and rules called normal forms. It reduces redundant data

117
Q

What characterizes 1st normal form (1nf)?

A

Rows/columns not ordered
No duplicate data
Row/column intersection have unique and no hidden values

118
Q

What characterizes 2nd normal form(2nf)?

A

Fullfil 1nf requirements
All nonkey columns must depend on primary key
Partial dependencies are removed and placed in a separate table

119
Q

What characterizes 3rd normal form(3nf)?

A

Fullfils 2nf requirements
Non primary key columns shouldn’t depend on other non primary key columns
No transitive functional dependency

120
Q

What is a join in SQL?

A

Combines records from two or more tables in a database

121
Q

What is an inner join?

A

Returns matching rows from both tables

122
Q

What are left/right joins?

A

Returns all rows from specified side and matching rows from the other side

123
Q

What is a view in SQL?

A

Virtual tables from tables in a database

124
Q

What is REST?

A

REpresentational State Transfer making computer systems on the web communicate with each other easier

125
Q

Why do we use REST?

A

They are stateless and they separate the concerns of the client and server

126
Q

What is a resource in REST?

A

Entities that are accessed by the URL you supply

127
Q

What does it mean to be stateless?

A

Each request must contain all the information necessary to be understood by the server instead of being depending on the server remembering prior requets

128
Q

What do we need to do to make an endpoint RESTful?

A

The client request should contain all the information necessary to respond

129
Q

What is the JDK?

A

Java Development Kit that offers tools necessary to develop Java programs

130
Q

What is the JRE?

A

Java Runtime Environment provides the minimum requirements for executing Java applications. It consists of the JVM, core classes, and supporting files

131
Q

What is the JVM?

A

Java Virtual Machine that is responsible for executing code line by line

132
Q

What terminal command is used to compile a Java File?

A

JAVAC

133
Q

What is contained in Stack Memory?

A

Temporary memory allocation for variables

134
Q

What is contained in Heap Memory?

A

Long term dynamic memory. Chunk of memory available for the programmer

135
Q

What is the String Pool and does it belong to Stack or Heap Memory?

A

When creating a string it looks for a reference to that string in the pool and assigns it. It is contained in Heap Memory.

136
Q

What is garbage collection?

A

Process by which java programs perform automatic memory management

137
Q

What is UNIX?

A

Operating system developed in the 1960s which has been under constant development since

138
Q

How do i change directories in UNIX?

A

cd directoryname

139
Q

How do I view contents of my directory in UNIX?

A

ls

140
Q

What is Git?

A

Distributed version control system that tracks changes in any set of computer files

141
Q

Why do we use Git?

A

Coordinating work among programmers and seeing changes made throughout applications

142
Q

What is a commit?

A

After making changes in code you commit and set a message stating what changes were made. It saves a revision of the code to be pushed

143
Q

What is GitHub?

A

Website to push changes to code for storing and viewing

144
Q

What does pushing do?

A

Sends the commited code to some other source

145
Q

What does pulling do?

A

Retrieves previously pushed code to you local machine

146
Q

What does clone do?

A

Downloads a project form a source to your local machine

147
Q

What does branch do?

A

Creates a new branch of the main code base to work on different features of an application without affecting the main code

148
Q

What does checkout do?

A

Switches branches

149
Q

What does merge do?

A

Joins two or more development histories together

150
Q

What is a merge conflict?

A

When two or more developers change the same line or code or deletes a file one was working on and git can’t automatically determine which is correct

151
Q

What are the 4 pillars of OOP?

A

Abstraction
Encapsulation
Inheritance
Polymorphism

152
Q

What is Inheritance?

A

Subclasses extend the base class and takes on their properties and methods

153
Q

What is Polymorphism?

A

Methods with the same name taking on different forms and functions. Can be done by overriding or overloading

154
Q

What is Encapsulation?

A

Information hiding from the user and making the class attributes inaccessible from the outside classes. Use getters and setters to obtain info

155
Q

What is Abstraction?

A

Handles complexity by hiding unnecessary details from the user so they only focus on the applications main function

156
Q

What is the Object class in Java?

A

It is the Parent class of all classes in Java

157
Q

What methods does the Object class contain?

A

getClass()
hashCode()
wait()
toString()
clone()
equals()
finalize()
notify()
notifyAll()

158
Q

What are Generics in Java?

A

It means parametrized types allows all types to be a parameter to methods, classes, and interfaces

159
Q

What are interfaces in Java?

A

Abstract class that is used to group related methods with empty bodies. Uses implements instead of extends. It’s an Is-A Relationship

160
Q

What does extending a class do?

A

Allows the sub classes to inherit to methods and properties of the base class

161
Q

What does implementing an interface do?

A

Achieves total abstraction and allows us to achieve multiple inheritance of a class since you can’t extend multiple classes

162
Q

What is the difference between runtime and compile time polymorphism?

A

Runtime: Dynamic, Overrides methods: A method with the same name is extended/implemented overrides the base method

Compile time: Static, Overloads methods: Multiple methods with the same name but different amounts or types of parameters

163
Q

What is Method Overloading?

A

Multiple methods with the same name but different types or amount of parameter values

164
Q

What is Method Overriding?

A

A method with the same name in a child class overrides the parent class method of the same name

165
Q

Can you extend multiple classes?

A

NO

166
Q

Can you implement multiple interfaces?

A

YES

167
Q

How might access modifiers help us achieve Encapsulation?

A

Having private or protected modifiers keeps data contain to the class itself

168
Q

What does the Comparable interface do?

A

Used to compare an object of the same class with an instance of that class

169
Q

What is the SDLC?

A

Software Development Life Cycle is a framework that development teams use to create a cost effective and time efficient piece of software. Agile is an example.

170
Q

What is Agile Development?

A

An approach to the software development life cycle that supports collaboration, flexibility, and iterative development. Focuses on user experience and input given to developers.

171
Q

What is a Sprint?

A

Set periods of time that team members have to complete their tasks and review what they’ve been working on.

172
Q

What are Ceremonies in Agile/Scrum

A

Meetings where the development team comes together to keep each other updated on their assigned tasks for projects.

173
Q

What are User Stories?

A

Features that the end user would like to see implemented in the project.

174
Q

What is Story Pointing?

A

A value assigned to user stories to help determine how much effort is needed to complete a feature.

175
Q

What is Velocity in Agile Development?

A

A way to measure the time it takes for the development team to implement user stories within a sprint. It assists the project manager in getting a realistic idea of how much progress is being made at the end of each sprint.

176
Q

What is Time Complexity?

A

An estimate of how long an algorithm will take to execute on different input sizes

177
Q

What is O(1)?

A

O(1) is Constant time: The algorithm will take the same amount of time regardless of input size

178
Q

What is O(n)?

A

O(n) is Linear time: Execution time scales directly with input size. (For-Loops)

179
Q

What is O(log n)?

A

O(log n) is Logarithmic time: Each time the size of the input doubles, the execution time increases by the same amount. (Binary search)

180
Q

What is O(n^2)?

A

O(n^2) is Quadratic time: The algorithm scales by the input sizes’ square.(Nested For-Loops)

181
Q

Describe the Linear Search Algorithm and what is the Time Complexity?

A

Linear search algorithms start at the beginning of list of elements and iterates each one until it finds the target element. An example would be iterating through an array with a for loop.

Time complexity is O(n): Linear time

182
Q

Describe the Binary Search Algorithm and what is the Time Complexity?

A

Binary search algorithms start at the middle of a list of elements. If the target element is the middle element the algorithm completes.

If the target element is larger than the middle element, it searches to the right of the middle element and repeats the process again until the target is found.

If the target element is smaller than the middle element, it searches to the left of the middle element and repeats the process again until the target is found.

Time complexity is O(log n): Logarithmic time

183
Q

What is one way you could take to sort an Array?

A

There are several different algorithms to sort arrays. The simplest and most efficient is the Selection Sort:

First iteration compares each value to find the smallest value in the array and swap it with the element at index 0.

The next iteration would would find the smallest value again but would start at the next index value.

Repeats until Array is sorted.

Time complexity of O(n^2) Quadratic time because it utilizes nested for-loops.

184
Q

How does ArrayList work?

A

ArrayLists work similar to Arrays where you access elements by the index value, however they can change size has many methods to add elements (add()), modify elements (set()), and delete elements (clear()).

185
Q

How does a LinkedList work?

A

LinkedLists element’s are called Nodes. LinkedLists aren’t stored in a contiguous manner in memory. Each node as a pointer to the next node which is how each node finds the next in memory.

Singly LinkedLists only works forward. The first Node only stores the memory location of the next Node.

Doubly LinkedLists can traverse forwards and backwards as each node stores the memory location of the previous and the next Node.

186
Q

What is a Thread?

A

In Java, a thread is the smallest unit of processing that can be executed independently by the JVM. It is essentially a lightweight sub-process that runs concurrently with other threads within a program.

187
Q

Why would using threading be advantageous?

A

Can improve the performance of a program by allowing multiple threads to execute in parallel

Can make the program more responsive by allowing it to continue to process user input while performing other tasks in the background

Improves efficiency of time and utilization of resources because processes can run asynchronously and concurrently

188
Q

How do you create a new thread?

A

A thread is created by extending the java.lang.Thread class or implementing a runnable interface.

Get an ExecutorService instance with Executors.newFixedThreadPool(int)
Create a new WaitingThread with a new WaitingThread(String, int)

189
Q

What is a race condition?

A

A race condition occurs when more than one sub-processes attempt to access the same location in memory at which a particular object is stored.

190
Q

How would you prevent a race condition?

A

Race conditions can be prevented by synchronizing the sub-process/method
Synchronization may be implemented by:
1: Using the synchronize keyword
2. Using Mutexes
3. Using Semaphores
4. Using a Lock

Alternatively using thread safe data structures, proper encapsulation of data within a sub-process, messaging between threads, and atomic operations can prevent race conditions

191
Q

What is a Deadlock?

A

When multiple threads are attempting to access the same resource so neither actually can access it.

192
Q

What features were added to Java 5?

A

Generics
Enhanced For-Loops
Autoboxing/Unboxing
Typesafe enums
Varargs
Static import
Concurrent collections
Copy on write
compare and swap
Locks

193
Q

What features were added in Java 8?

A

Lambda Expressions
Streams
Nashorn
String.join()

194
Q

What is Reflection?

A

Java feature that allows a program to examine or “introspect” upon itself, and manipulate internal properties of the program. (getClass())

195
Q

What is a Lambda Expression?

A

Short block of code which takes in parameters and returns a value.
Similar to methods but don’t need a name and can be implemented in the body of a method

196
Q

What is a Functional Interface?

A

Interface with only one method (ex…Single Abstract Method)

197
Q

What are Streams?

A

Abstraction of non-mutable collection of functions applied in some order to the data. They do not store data.

198
Q

What are some operations that streams can do?

A

Intermediate Operations (Returns another stream) or Terminal Operations (triggers the execution of the stream pipeline)

ForEach(): Terminal operation, loops over the stream elements
Map(): Produces a new stream after applying a function to each element of the original stream
Collect(): Gets elements out of the stream into and puts the values into the variable
Filter(): produces a new stream with elements that pass the predicate
Findfirst(): returns an optional for the first entry in the stream
ToArray(): returns an array of elements from the stream
FlatMap(): Helps “flatten” data structure to simplify further operations
Peek(): Allows the developer to perform multiple operations on each element in a stream

199
Q

How does the Singleton Design Pattern work and why would you use it?

A

A creational design pattern that ensures that a class has only one instance, while providing a global access point to this instance. We use it because it is more memory space efficient and the single object can be used repeatedly over the client program.

200
Q

How does the Factory Design Pattern work and why would we use it?

A

A creational design pattern used to create an object without exposing the creation logic to the client. We use it to provide an approach for interface rather than implementation and provides abstraction.

201
Q

What is Logging?

A

A framework for Java to understand and debug program runtime behavior by capturing persisting important data, making it available for analysis at any point in time.

202
Q

Why would you use Logging?

A

It eases and standardizes the debugging process by providing flexibility and avoiding explicit instructions

203
Q

What is Procedure in PL/SQL?

A

Functions that will auto trigger when something happens. Procedures will hide the SQL queries to improve performance by having less information sent to the database

204
Q

What is a Trigger in PL/SQL?

A

When an event occurs and stored in the database and it’s consistently called upon.

205
Q

In SQL what is an Index?

A

A table to quickly look up information from other tables that need to be searched frequently

206
Q

What is an SQL Index Advantageious?

A

It performs repetitive queries faster by storing the information into a table.

207
Q

What is the general structure of an HTML document and what are the different parts of the documents used for?

A

HTML documents are divided into 2 parts:

head:
Contains <title> tag to give the webpage a title and to be visible on the web browser as well as <style> or

 tags to incorporate other files
</style></title>

body:
Where we design the structure of the webpage

208
Q

What are some HTML elements?

A

<title>
<head>
<div>
<p>
<h1>-<h6>
<ul><ol><li>
<img></img>
<a>
and more...
</a></li></ol></ul></h6></h1></p></div></head></title>

209
Q

What are inline and block elements?

A

Inline Elements: Do not start a new line and take up the width of the content

Block Elements: Start a new line and take a full width of the available space.

We can have inline elements inside block elements but can’t have block elements inside inline elements

210
Q

What is the purpose of assigning ID’s and Classes to elements?

A

Assigning Id’s to an element allows for styling or manipulation of a single element

Assigning Classes to elements allows for styling or manipulation of a group of elements sharing the same class

211
Q

How do you create an ordered list or an ordered list?

A

Ordered List: <ol></ol>

Unordered List: <ul></ul>

212
Q

What new features were introduced to HTML5?

A

Video and Audio Features
Header and Footer Tags
Input Tags
Figure and Figcaption
Regular Expressions
Increased Adaptability for accessibility
Cryptographic Nonces

213
Q

How can you attach Javascript to an HTML File?

A
<script>
content here
</script>

or


214
Q

What is CSS?

A

Cascading Style Sheets are a mechanism for adding style such as fonts, colors, backgrounds to HTML files

215
Q

What are three different ways to apply CSS to HTML elements. Which one takes priority?

A

Inline: Takes priority” use the style attribute inside the HTML elements

Internal: using <style> tag within the <head> section</style>

External: Using <link></link> in the HTML file and sourcing it to an external CSS file.

216
Q

What is the CSS box model?

A

A box that wraps around every HTML element that consists of margins, borders, padding, and the actual content

217
Q

What is responsive web design?

A

Web places that look good on all devices. A responsive web design will automatically adjust for different screen sizes and viewports

218
Q

What is JavaScript?

A

A light weight and interpreted programming language with Object Oriented capabilities. Allows for client side script to interact and make dynamic changes to web pages.

Runs on a single thread with an event loop handling events.

219
Q

What does it mean for JavaScript to be loosely typed?

A

Variables don’t necessarily need a variable typing when declared. JS automatically types a variable based on what kind of information you assign to it.

220
Q

What does it mean for JavaScript to be interpreted?

A

JS does not need to be compiled to be run. It is immediately run by the browser without any conversion into another language.

221
Q

What are the 8 types in JavaScript

A

undefined
null
boolean
number
bigint
string
symbol
object

222
Q

What is type coercion in JavaScript?

A

The automatic or implicit conversion of values from one data type to another (such as strings to numbers)

223
Q

What are truthy and falsy values in JavaScript?

A

Values that are considered true/false when encountered in Boolean context. All values are truthy unless they are defined as falsy

Examples of falsy values:
false
0
-0
“”
null
undefined
NaN

224
Q

What is the difference between == and === in javascript?

A

== does type conversion and compares the values (5 == “5”) is true

=== does strict type conversion and compares values and data type (5===”5”) is false

225
Q

What are the different ways to declare a variable in Javascript?

A

Let: block scoped

const: block scoped and can’t be reassigned

var: global scope - hoisted to the top of the file

226
Q

What are callback functions in Javascript?

A

A function passed to another function as an argument because functions can be used as variables in JS.

227
Q

What is the DOM?

A

Document Object Model is the representation of the HTML document in memory. It is generated and can be manipulated by web API’s to change the look of the page as its being viewed.

228
Q

How can I select and modify HTML elements in Javascript?

A

document.getElementById()

document.getElementByClassName()

document.querySelector()

document.querySelectorAll()

229
Q

How can I have Javascript execute some function when a button is clicked?

A

Adding event listeners such as button.onclick() or button.addEventListener(“click”, function())

230
Q

What is an EventListener and why is it used?

A

A built in function in Javascript that allows us to wait for user interaction and then run some code. Usually used on buttons, inputs, or when users type or clicks on the screen

231
Q

What is bubbling and capturing?

A

Bubbling happens when an element received an event and that event is propagated to its parent and ancestor elements in the DOM

Capturing is when the event is first captured by the outermost element then propagates to the inner elements.

232
Q

What is the event loop in Javascript?

A

Responsible for executing the code, collecting and processing events, and executing queued sub tasks

233
Q

What are Promises and what are they used for?

A

The object that represents the eventual completion or failure of an asynchronous process and its result. Stores a value and “promises” to use that data later.

234
Q

What do Async and Await do in Javascript?

A

Async are tags you can use on methods and processes inside methods to enable promise based behavior.

await makes javascript wait until the promise is settles and returns the result.

235
Q

What are features introduced in javascript version ES6?

A

Const
Let
Arrow functions
Template Literals
Default Parameters
Object and Array Destructing
Classes
Rest Parameter
Spread Operator

236
Q

What are arrow functions?

A

A more concise way for writing functions

hello = () => return “hello world”

237
Q

What are template literals?

A

A form of making strings that allow creating multiple line strings more easily and uses place holders to embed variables in a string. Encase your string in backticks and interpolate your variables with ${}

238
Q

What is a closure in Javascript?

A

Makes it possible for a function to have “private” variables. It allows a function to have access to the parent scope, even after the parent function has closed

239
Q

What is the fetch API?

A

A promise-based interface for fetching resources by making HTTP requests to servers from the web browsers. We can use the FETCH() method, it will allow us to fetch data from different places and work with the fetched data.

240
Q

What is Node.js and why do we use it? How is it different from out previous way of running Javascript?

A

Node.js is a server side way of running Javascript code, it allows us to use JS on both front and backends. Without Node, JS is run only on a client’s web browser

241
Q

What is NPM?

A

A dependency management tool that allows us to easily install the packages needed to run a program with Node.js. It stands for Node Package Manager.

242
Q

What is the package.json file?

A

It lists all of the dependencies and their versions that are needed to develop and run JS projects. It is used by NPM

243
Q

What is Typescript and why do we use it?

A

It is a superset of Javascript and adds types to Javascript. By allowing types, TS helps to identify errors in the code at compile time. It uses compile time checking

244
Q

What is transpilation? What command is used to transpile Typescript?

A

It is compiling Typescript to Javascript and its various versions.

The command is npx tsc

245
Q

What types does Typescipt introduce that Javascript does not have?

A

Typescript is a syntactic superset of Javascript which adds static typing. It adds syntax on top of Javascript which allows developers to add types

246
Q

What features does Typescript introduce other than strong typing?

A

Allows for stronger OOP through the introduction of interfaces and access modifiers

Support classes and other OOP concepts

Provides interface, which allow you to define contracts that describe the expected shape of the object

Decorators: TS equivalent of annotations in Java

247
Q

Why would we use interfaces in Typescript?

A

Allows users to define their own objects.

The compiler uses interfaces for Type checking to check if the object has a specific structure or not. (duck typing or structural subtyping)

248
Q

What is a decorator?

A

A function that we use to attach metadata to a class declaration, method, accessor, property, or parameter. Such as @Component, @Input, @Output

249
Q

What is a component in Angular?

A

A building block used to create out application, which allows to break down an application into smaller and reusable parts. Easier to maintain and update.

250
Q

What files does a component contain?

A

component.css
component.html
component.spec.ts
component.ts

251
Q

What is a service in Angular and what is special about them?

A

A class that is used for fetching data from the server, validating user input, or logging directly to the console. Containing logic that we would like to separate from component specific logic

Can be injected into a class to helps maintain their singleton model thus they are marked with the @Injectable annotation.

252
Q

What is a module in Angular?

A

A mechanism to group component, directives, pipes, and services that are related, in such a way that can be combined with other modules to create an application

Each Angular application has to have a root module @NgModule

253
Q

How do you set up a new Angular app using the Angular CLI?

A

npm install -g @angular/cli
cd folder_path
ng new project_name

254
Q

How do you generate a new angular component using the Angular CLI?

A

ng g c component_name

255
Q

What is a Single Page Application and what are the benefits/downsides of using an SPA?

A

A web design pattern where instead of navigation links going to separate pages, the routes will change the components that are displaced on a single page.

Components are loaded up front so navigation on a website is faster. However the first time the page loads it will take much longer.

256
Q

What is routing? How do you create a new route?

A

A way to change what is displayed on an SPA to simulate page navigation.
{ path: ‘home’, component: HomeComponent }

257
Q

What is a route guard?

A

Determines if a user can access a route, for example a user must log in to see their account details

258
Q

What does it mean for components to be eagerly loaded?

A

The component is loaded into cache when the page is first accessed instead of when the component is to be displayed on the page

259
Q

What are lifecycle hooks in Angular?

A

Methods in Angular to tap into different phases of a components life. They allow you to perform actions at specific points during the components lifecycle, such as initialization, change detection, and cleanup

260
Q

When does ngOnInit run?

A

After angular has initialized all data bound properties for additional initialization

261
Q

When does ngOnChange run?

A

When angular sets or resets data bound input properties

262
Q

When does ngOnDestroy run?

A

Just before angular destroys a component or directive for cleanup to avoid memory leaks

263
Q

What is property binding, and its syntax?

A

A one way data binding technique in Angular used to bind DOM element property to a component’s property. This allows the components property to be reflected in the DOM

[property]=”expression”

264
Q

What is event binding and its syntax?

A

One way data binding technique used to bind a DOM elements even to a method in the component. Allows the component to respond to user interactions or events

(event)=”methodName()”

265
Q

What is 2-way data binding and its syntax?

A

A combination of property binding and event binding, allowing the components to update the DOM property, and the DOM’s property to update the components property. This enables a seamless synchronization between the component and the view.

[(ngModel)]=”property”

266
Q

What are event emitters for?

A

Used to emit custom events from a child component to a parent component. They are usually implemented using the EventEmitter class. It enables a child component to communicate with its parent component by emitting events and sending data

267
Q

What is interpolation and its syntax?

A

A special syntax that Angular converts into property binding. It is used for one way data binding and displays a component property in the respective view template. It is an alternative to property binding and can be used to display strings, numbers, dates, arrays, lists or maps.

<h3>Current customer: {{ currentCustomer }}</h3>

268
Q

What do structural directives do in Angular?

A

Responsible for manipulating the DOM structure by adding, removing, or modifying elements. They usually change the layout of the structure of the view based on some condition

269
Q

What does ngIf do?

A

Used to conditionally render a part of the DOM based on a given expression. If the expression evaluates to true, the element and its content are added to the DOM and vice versa

270
Q

What does ngFor do?

A

Used for rendering a list of items. It iterates over a collection of elements like an array, and creates a DOM element for each item in the collection.

271
Q

What do attribute directives do in Angular?

A

Used to change the appearance or behavior of a DOM element, component, or another directive. They’re applied as attributes to elements in the template and can manipulate the properties of those elements

272
Q

What are pipes used for?

A

Used to transform data before displaying it in the view.

273
Q

Can you describe the pub/sub design?

A

The publish/subscribe design is a pattern used in applications to send requests for data by a subscriber who receives data from a publisher

274
Q

What are observables?

A

Objects used in the RxJ (Reactive Extensions for Javascript) library to handle asynchronous data streaming

275
Q

How do you use the HTTPClient?

A

Handles data input from users and sends them as requests to a backend server.

Implemented by:

importing the module

Importing the module in the “ngModule” imports array`

276
Q

How do you pass data from a parent component to a child component in Angular?

A

Prepare a property in the child component using the @Input() annotation

Bind a property that exists in the parent to the child component property

277
Q

How do you pass data from a child component to a parent component in Angular?

A

Prepare the parent component to recieve data using the @Output() decorator

Bind an event to the child component that emits data using an EventEmitter

278
Q

How would you maintain some variable globally across an Angular app?

A

Export a constant

279
Q

What is Spring?

A

A Java platform that provides infrastructure support to develop Java applications. Developers can focus on the application itself while Spring manages the infrastructure.

280
Q

What are some Spring modules?

A

The core container: Consists of the Bean
The ORM Module (JPA) for data access
The Web-Servlet modules which provides Spring’s MVC implementation for web applications

281
Q

What is a Bean?

A

Objects managed by Spring that live in Spring’s application context and can be injected into an existing class.

282
Q

What is Dependency Injection?

A

Injecting objects into other objects. Used to connect a class with its dependencies. Methods to inject dependencies are Constructor Injection and Setter Injection

283
Q

What is the Spring IOC Container?

A

Inversion of Control is the transfer of control of objects or portions of a program to a container or framework.

284
Q

What is the difference between the BeanFactory and ApplicationContext?

A

BeanFactory provides the configuration framework and the basic functionality. It is a parent interface of ApplicationContext

ApplicationContext adds additional functionality like easy integration with Spring AOP features, message resource handling event propogation, and contexts specific to the application layer like WebApplicationContext.

ApplicationContext extends BeanFactory and loads the beans eagerly on startup.

285
Q

What does the @Bean annotation do?

A

A method level annotation and a direct analogue of the XML element. It marks a factory method which instantiates a Spring bean.

286
Q

What does the @Component annotation do?

A

The main Stereotype Annotation. It is a class level annotation and used across the application to mark the beans as Spring’s managed components

287
Q

What does the @Autowired annotation do?

A

Used for dependency injection. We can use this annotation with a constructor, setter, or field injection. Places an instance of one bean into the desired field in an instance of another bean.

288
Q

What are different ways to perform dependcy injection using Autowiring? (Places to put the autowired annotation)

A

Field Injection
Constructor Injection
Setter Injection