Pages

Monday, January 15, 2018

Another code example

Yeah... Restart going a bit slow. But I have an excuse - New Year, Christmas and so on :)

Anyways, I am writing another short note - which is something. This time it will be another code example that I used for a technical code interview.

I think this kind of notes can be useful for people who are looking for a job. It is just a good checklist of what can be done and displayed. Unfortunately, for the last one we could not get a job or even a feedback. But this code example was accepted and it ticked all the checkboxes :)

So the task was to load a JSON object from the service and then filter, aggregate and display the data in some fancy way. There were no restrictions on tech stack or output, so I decided to go with the simplest one - console application. But to make it a bit spicier I constructed it in a way that developers will be able to extend or change those filters or aggregation functions very easy. By the way, the code is available here: github. There is a bit of explanation available in the readme file on github.

In terms of what is better to be shown:
  • There must be tests! You cannot ignore that nowadays if you are not writing tests you are doing something wrong. You can use whatever framework or tool you are familiar with - or you can play with something new.
  • When you are designing your app it is better to think about extensibility. Therefore IoC is a nice addition. And with modern frameworks it is not hard to set up at all. But you will show your familiarity with them and also your tests will be better!
  • Try and use the latest technologies. For example, if you are writing something for .Net - use HttpClient! 
  • Another good idea to show some exposure to functional programming. At least use LINQ :)
For me I also added my favorite idea - to mock the 3rd party services with a simple Node.Js service, as an icing on a cake.