java
-
I recently had to solve the problem below during an interview. I thought I’d write down my thought process to resolve the problem, in hopes it might be useful or provide insights to other people. The problem specification: My first thought is that the lawn is of a rectangular shape. That screams matrix (2 dimension…
-
The Typestate pattern is a very interesting design approach that encodes an object’s state within its type, allowing certain operations to be restricted based on that state. This helps catch errors at compile-time rather than runtime, improving code safety and efficiency. In Java it’s not possible to implement it fully, as Java does not provide…
