Code Samples


Various tasks which I've received as part of the recruitment process in different companies.


Web Service Cluster

Spring Boot / Multi-Project

Jan 2020


Description

  • Java 8
  • Spring Boot 2
  • Maven
  • Spring WebFlux
  • JPA
  • Mongo DB
  • Swagger
  • REST API / Rest Client
  • Docker / Docker Compose

Overview

I've received this task with a requirement to be implemented over the weekend. The provided solution is "as is" at the moment of submission. The project(s) can be started via docker-compose

TASK OBJECTIVE: Implement a Key-Value service (implemented as a REST API) with ability to operate over a huge data. It is required to use NoSql Database (used Mongo DB). The solution should provide a starting point to build and run the app in a form of a single command (used batch script, docker-compose and maven). The solution should provide a way to scale in a form of registering new service instances and balance the network load over them.

VALIDATIONS: There is no need to validate the REST calls - assume they are correct.

PERFORMANCE EXPECTATIONS: Provide solution for heavy data with millions of rows in the database.


Omaha Hand Resolver

Custom Project

Mid 2019


Description

  • Java 8
  • No External dependencies

Repository

Omaha Resolver
Overview

I've received this task with a requirement to be implemented in one business day (6-8 hours). The provided solution is "as is" at the moment of submission to the recruiting assessors - no post-refactoring and beautyfying. The proposed solution is a valid MVP with no external dependencies as a pure Java SE project. The architecture scheme allows easy transition into a Spring project.

TASK OBJECTIVE: To design the algorithm and write a Java program that will determine which one of the two OMAHA Hi/Lo poker hands is the winning hand for High and which one is the winning hand for Low (if any). It applicant is expected to design the algorithm and necessary data / class structures to provide implementation that is robust, logical and easy to understand. It is not necessary to validate the input or provide any other error handling in the implementation.

VALIDATIONS: There is no need to verify the integrity of the input (i.e. duplicate cards, wrong syntax, etc).

PERFORMANCE EXPECTATIONS: There is no need to have the absolute best performance - just a reasonable balance between complexity and performance.


Spring Refactoring / REST API

Spring Boot 2

Early 2019


Description

  • Java 8
  • Spring Boot 2
  • Swagger
  • JPA
  • Maven

Overview

I've received this task with a requirement to be implemented for 3-5 hours. The provided starting point was a pile of non-working code with no architecture and proper setup as a Spring Application. The expected result was a fixed code and applied architecture and best practices.

The provided solution is "as is" at the moment of submission - no post-refactoring and beautyfying. It is just a starting point with best practices setup for the expected time frame, but in no means this is a ready solution.

Applied common Spring principles, decoupled the entity from the transfer object, set generic converters with no depencencies to MapStruct or ModelMapper, separated the logic from entities/POJOs.