# Technical Test Questions
This is a collection of technical questions categorised by technology and subject that we're most concerned with.
The questions are organised into the following hierarchy starting at level-3 headings:
```
└─ Technology
└─ Category
└─ Question
├─ Answer
├─ Difficulty
└─ Sources
```
Each node in the hierarchy may contain explanatory text.
The difficulty scoring is form 1-4 where 4 is "expert" level.
## Suggested Usage
Randomly select N questions from each category to produce a unique test per candidate.
This process can be automated using a markdown parser.
## Java
### Language
#### Q: What must you also override if you override `equals`?
##### A: `hashCode`
This fails the general contract for `hashCode`. The class will fail to function correctly in hash-based collections.
##### D: 1
##### Sources
1. Effective Java, Item 11
#### Q: Review & suggest improvements to the following code
```java
static String firstLineOfFile(String path) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(path));
try {
return br.readLine();
} finally {
br.close();
}
}
```
##### A: Use `try-with-resources` syntactic sugar
Note: `readLine` and `close` both throw `IOException`
May also comment on:
* use of `String` for the path, or parameter types in general
##### D: 1
##### Sources
### Design/Architecture
#### TODO: Composition vs Inheritence
#### Q:
##### A:
##### D:
##### Sources
#### A simple domain object Java class has grown considerably requiring a large and complex set of constructor parameters. What pattern could help simplify creating instances of this object?
##### The builder pattern
##### Difficulty: 2
##### Sources
1. Effective Java, Item 2
### Collections Runtime Complexity
#### Q: What is the runtime complexity of `ArrayList.add`? a) O(1) b) O(n) or c) O(log n)
##### A: O(1)
##### D: 2
##### Sources
https://gist.github.com/psayre23/c30a821239f4818b0709
#### Q: What is the runtime complexity of `TreeSet<K,V>.contains`?
##### A: `O(log n)`
##### D: 2
##### Sources
https://gist.github.com/psayre23/c30a821239f4818b0709
### Concurrency
## Functional Programming
### Concepts
#### Q: Referential Transparency
##### A:
##### D:
##### Sources
## Reactive Programming
#### Q:
##### A:
##### D:
##### Sources
## Database
## CI/CD
## Linux
## Team Dynamics
#### Q:
##### A:
##### D:
##### Sources