The testing process: Implementing code or fixing bugs in Java.
Motivation: Basic familiarity with the programming language used on the job is a prerequisite for quickly getting up to speed.
The testing process: Designing or analyzing an algorithm or data structure.
Motivation: Algorithmic thinking is one of the key traits of a good programmer, especially one working on complex or performance-critical code.
The testing process: Using data structures to optimize code performance.
Motivation: Choosing the right data structure to solve the problem at hand is a very important skill for a good programmer.
A TrainComposition is built by attaching and detaching wagons from the left and the right sides.
For example, if we start by attaching wagon 7 from the left followed by attaching wagon 13, again from the left, we get a composition of two wagons (13 and 7 from left to right). Now the first wagon that can be detached from the right is 7 and the first that can be detached from the left is 13.
Implement a TrainComposition that models this problem.
- Example case: java.lang.UnsupportedOperationException at TrainComposition.attachWagonFromLeft(TrainComposition.java:3)
- Several wagons: java.lang.UnsupportedOperationException at TrainComposition.attachWagonFromRight(TrainComposition.java:7)
- Performance test with a large number of wagons: java.lang.UnsupportedOperationException at TrainComposition.attachWagonFromRight(TrainComposition.java:7)