Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hantsy/code-challenges
Code challenges in learning new languages, frameworks, engineering tools, architectures, software design patterns, etc.
https://github.com/hantsy/code-challenges
csharp go java jest junit kotest kotlin node php phpunit scala scalatest typescript xunit
Last synced: about 2 months ago
JSON representation
Code challenges in learning new languages, frameworks, engineering tools, architectures, software design patterns, etc.
- Host: GitHub
- URL: https://github.com/hantsy/code-challenges
- Owner: hantsy
- License: apache-2.0
- Created: 2020-12-18T05:42:06.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T13:58:03.000Z (10 months ago)
- Last Synced: 2024-10-10T18:44:16.367Z (2 months ago)
- Topics: csharp, go, java, jest, junit, kotest, kotlin, node, php, phpunit, scala, scalatest, typescript, xunit
- Language: Java
- Homepage:
- Size: 1.65 MB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Code Challenges in ...
In the past years, I am always trying to update myself to the cutting-edge technologies. I defined a lot of learning paths or coding journeys to archive the purpose. I also tried to participate into some programs in Twitter hashtags, such as [#100DaysofCode](https://twitter.com/search?q=%23100DaysOfCode) to track my work. Finally I found most of them didn't work as expected due to the progress disturbed by some uncertain things in my life.
Personally I hope this repository will record some of my learning results in the future.
This repository is not for showing you how to learn something or teaching you some new things. It is just my toys, it is truely coding for fun. I will not follow the rules of any campaigns. In another words, I will add the work at my pace. There is no deadlines or limitations like delivering a real world project.
## Transaction Analyzer
The *Transaction Analyzer* application is use for loading transaction records from an existing CSV files and generating statistics report after analyzing the loaded data.
### Requirements
Given a CSV file contains some transaction records from a financial system, design an application to analyze the data in the CSV file and generate a statistics report.
When analyzing the records, the `REVERSAL` transaction and it related transaction should be excluded.
Assume there is a CSV example file contains the following transactions.
```csv
ID, Date, Amount, Merchant, Type, Related Transaction
WLMFRDGD, 20/08/2020 12:45:33, 59.99, Kwik-E-Mart, PAYMENT,
YGXKOEIA, 20/08/2020 12:46:17, 10.95, Kwik-E-Mart, PAYMENT,
LFVCTEYM, 20/08/2020 12:50:02, 5.00, MacLaren, PAYMENT,
SUOVOISP, 20/08/2020 13:12:22, 5.00, Kwik-E-Mart, PAYMENT,
AKNBVHMN, 20/08/2020 13:14:11, 10.95, Kwik-E-Mart, REVERSAL, YGXKOEIA
JYAPKZFZ, 20/08/2020 14:07:10, 99.50, MacLaren, PAYMENT,
```When user input the following arguments as query criteria.
```bash
fromDate: 20/08/2020 12:00:00
toDate: 20/08/2020 13:00:00
merchant: Kwik-E-Mart
```It should output the result similar to this.
```bash
Number of transactions = 1
Average Transaction Value = 59.99
```If no transaction record found, print the following message instead.
```bash
No transactions found.
```### My implemenation Examples
To make things simpler, I tried to avoid to use any third party library to parse the CSV file, and also didn't adopt a database to store the parsed data from CSV, all the analyzing work is done in memory.
As as a toy for myself, I've created a collection of implementations written in different languages and techniques.
| Example | Description|
|---|---|
|[java](./transaction-analyzer/java)| Java examples|
|[java-ddd](./transaction-analyzer/java-ddd) (*Working in progress*)|Java with DDD/Onion/Hexagon Architecture|
|[java-fn](./transaction-analyzer/java-fn)|Java Functional Programming(Function, Supplier, Consumer, CompletableFuture)|
|[kotlin](./transaction-analyzer/kotlin) | Kotlin |
|[scala](./transaction-analyzer/scala) | Scala |
|[php](./transaction-analyzer/php) | PHP |
|[csharp](./transaction-analyzer/csharp) | C# |
|[node-typescript](./transaction-analyzer/node-typescript/)|Node(Typescript)|
|[go](./transaction-analyzer/go) | Go |## More ...
Desire to dive deeper in more Kotlin examples, check the following projects which used Kotlin with the cool Spring support, including Kotlin Coroutines and Kotlin DSL.
* https://github.com/hantsy/spring-kotlin-coroutines-sample
* https://github.com/hantsy/spring-kotlin-dsl-sampleWant to explore an example close to real world applications with testing codes and CI/CD integrations. Check the following example which is configured with most the popluar CI service, including Github Actions, Travis, Circle, Codefresh, Drone, SemaphoreCI, Appveyor, Shippable, etc.
* https://github.com/hantsy/spring-reactive-jwt-sample
Feel tired with frameworks and return back to Java EE/Jakarta EE, it is also great. Check the following template projects to start your Jakarta EE application development freely. These projects include sample test codes and configurations with Arquillian against the popluar application servers, such as WildFly, Payara/Glassfish, Open Liberty, Apache TomEE, etc.
* https://github.com/hantsy/jakartaee8-starter
* https://github.com/hantsy/jakartaee9-starter-boilerplateEnjoy!