Savio Fernandes' Exchange Rate Updater 😄 #776
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The Mews take home challenge was a unique challenge based on querying an https endpoint via an console application. A note to mention here is the API responses return data in txt format as opposed to JSON which is generally used across HTTP APIs. Hence the file was meant to be read and parsed on that basis.
The solution implements the following:
HttpClientAdapter.cs: queries the URLs forDailyRateandfx_ratesand reading the result as a Stream.ExchangeRateProvider.cs: Calls thehttpClientsafely using Disposable methods to avoid memory leaks. Reads the file line by line and formats the result using string manipulation and finally stores the valid results from the table into aListobject.Created using .NET 8 (latest LTS sdk)
Set up instructions
git clone https://github.com/sraxler/developers.git cd jobs/Backend/Task dotnet restore dotnet build dotnet runPrinciples used
Architecture overview
ExchangeRateProvider system design
Result
Future work
HttpClientforHttpClientFactoryif console app requires making multiple API calls for a recurring application that stays live until it is stopped.