Pages

Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

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.


Saturday, December 9, 2017

Restart!

Hi all,

After almost 1,5 years I decided to restart this blog. And not only to restart it, but rather start it in a new way with a new target!

First of all - the idea to restart it belongs to my wife and we will be writing articles together. Before I was writing articles that were more like a "gotchas" that I had, but now we want to focus this blog on a content that can be helpful for beginner developers. My wife did a bit of research and found that there are not so much of a content for them. Most of the articles are either too simple (write a hello world app) or just too strict (think of any todo app for any js framework). What we want to achieve is to provide people with a nice set of examples and small tasks that are closer to a real world (hopefully) and are more open for a change.

To do this we want to follow a certain pattern with blog articles. Each post will be either a task or an example app (and maybe, sometime other gotchas from me...). With tasks we will have a requirement and will outline a possible solution with a plenty of links to other resources with a lot of theory. That way developers that follow us will be able to build a project for each task and then compare it with what we build for the same task. Our solutions will be stored on git (e.g. https://github.com/ESKoptelova/codeexample-calculator).

We want to have our tasks to be aligned with a real world programming problems, so beginners might be able to solve the problem and put the code to their own git repository and use it as an example of their code for job applications.

I hope this works :)

Monday, May 2, 2016

SVN pristine copies

Hi! Probably all of us use some sort of the version control system nowadays. At my workplace we are using SVN (and Tortoise SVN as a nice user interface).

Interesting thing about the SVN is that is it using an internal folder (.svn) for its client-side operations. And one of those operations is to store pristine (unedited) copies of the working copy files. Overtime, this gets really big and can really take some space from your SSD drive – especially if you have multiple checkout folders pointing to different branches. It could fill your SSD really quick.

Sometimes there might be really old or big files stored. But you should not edit that folder directly. But you can do it using TSVN! Here is an example result:

And in order to achieve this you should use "vacuum pristine copies" during the cleanup along the deletion of unversioned and ignored files:

Tuesday, March 1, 2016

Developers and UX bugs

I work in a team of 6 developers, most of us are senior-level developers but we have 2 juniors too. And usually we could just happily develop our code and throw up some interface as we seen fit. But recently things changed and I wasn't that happy about it in a beginning.

My software manager approached us and told us that there were introduced heaps of bugs with the latest deployment. And those "bugs" were not the bugs in the codebase - instead they were UI and UX bugs - things were not loading extremely fast or were too hard to reach (for example if the button you have to click is too small). So after that we had to hold up our next deployment for 2 weeks and even start doing hallway testing! He is the boss, but initially that request was greeted with a lot of salt. After all we are simple developers - we want to write code and not to move buttons around the form. And we all know how the design will look like if developers do their best :) Another disturbing thing is that request came out from from blue. (Maybe because our manager was busy checking other projects he has not payed enough attention or just read some UX book...)

Anyway, we were not pleased and even now we can joke about that a lot - like "have you seen that show-stopper bug with wrong font size in that label?". But after some extra thoughts that request seems like something reasonable. After all we develop our application for users, to solve their problems and if they cant use it because the functionality is buried under those layers of crappy interface it is not working. It is almost the same - if the app is not working because of code bugs or if noone can understand how to use it. More than that - after the initial introduction to the systems users might just ignore the feature you have created because it is unusable; it can be really hard to turn them back to the feature later.

So what I am trying to say is that if your team doesn't have a separate designer/UX expert - every software developer should read at least few articles on most common UX/UI mistakes and try to improve the look and feel of your application. Those bugs can be even more dangerous then the regular ones. You can catch the bug in your code with unit test/integration test, but as you developed the feature - you cant really test the UI! You just know it from inside and wont notice the obvious defects. Hallway testing is the solution :)

Good luck and happy coding!

Sunday, March 15, 2015

How to fail an interview (or learn from others mistakes)

I think of myself as "open for opportunities" professional. I have a great job that I like but I dont mind to try something new. Recently I found a really interesting puzzle - part of the employment process. That was a task to recreate a web service by its interface so the checking bot could access it and try its tests.

Sounds fun so I decided to try. The hardest part of that process was to understand what is the expected behavior of that service just by methods names. And take into account all tricks from the employer side (like overflow exceptions, impossible combinations of parameters etc.) I`ve solved that puzzle to 90% and that was enough to pass to the real interview. At that  point I`ve decided to try the interview as well - just in case :). Unfortunately, I failed and here is my thoughts about the interview.

That was completely my mistake. I have not really prepared myself to the interview and have not refreshed in my memory the most common questions. I thought that I dont need anything to pass.
Here is the list of some of those questions from the interview with my comments - maybe it would help someone (and all of them about c#).


  • Difference between value type and reference type 
    • hopefully everyone can explain it from the top of their heads).
  • Boxing vs Unboxing ()
    • I`ve made my first mistake here as I could not remember what is what...
  • Is string a value type or reference type?
    • Just be careful here as well as string is a special case. I`ve remembered it but not sure what I`ve answered :)
  • What is sealed keyword? Can we derive from sealed class?
  • some questions about garbage collector
    • Cant remember those questions, they were like when collector does its work by default, how to suspend it etc. I dont know a lot about it as that's not a day-to-day stuff. Possibly mine knowledge of GC.Collect and that that is not a best line of code to include just not enough :)
  • SOLID principles
    • simply name them
  • Describe Strategy pattern; Singleton pattern
    • once again, describe them in your own words
  • What are 4 types of design patterns
    • I could not remember them, but the common sense is your friend - some of them are aimed at creation of objects, other about interactions and so on.
  • Session variables in Asp.Net
    • that was a question about ViewBag, ViewData and TempData. I could not remember them (and the difference between them) as I just so get used to models. Unfortunately, I have not described my thoughts on Models either - so that is my big mistake...
  • Authorization in Asp.Net
    • I started talking about security tokens and roles, but the question was only about [Authorize(Roles = "...")] attribute. And I forgot to mention it :(
  • Can 2 different routes lead to the same action in Asp.Net?
    • Yes - but it would be better to answer with example and I just said yes.
  • Difference between Shared views and Partial Views
    • Own words explanation
  • Difference between WebForms and MVC
    • I`ve told about postbacks and stateless MVC controllers, probably that was not what interviewer was expecting...
  • Is doctype needed for HTML5?
    • I`ve said that no (from the personal experience) but accordingly to the documentation - the answer is yes...
  • What is the difference between Data Contract and Operational Contract in WCF
    • I`ve answered honestly that I dont really know WCF :( And by the way, in the job ad there was no mention of WCF
  • Can WebAPI method return ActionResult?
    • I`ve answered that yes (especially as I can wrap it as I want) but the proper answer was no
  • Can WebAPI replace WCF
    • Em... Yes?
  • Are dependencies in IoC framework singletons?
  • Lifetime management of dependencies in IoC framework
  • What will I do and how would I approach bug fixing at some client as a software development consultant?
  • How can I monitor problems in production?
  • What is TDD, BDD, DDD, Kanban?
After about hour of talking on those questions I was given a small tax calculator application with bugs and txt file with tests. My task was to fix as many bugs as possible and the interviewer was looking at my screen with Skype shared desktop. I`ve fixed some of those tests (not all of them) and after another 30 minutes interviewer asked me to show only the first test - and that was all.

And finally, on the next day or so I`ve received the email with "sorry you failed.". Not a big deal :)
Now I can learn from mine mistakes :)

Thursday, December 4, 2014

YOW 2014

Thanks to my company, stratton, I was able to attend the YOW! conference in Melbourne. It was a 2-day software conference and it was amazing :). I really liked everything, especially as it was my first big conference.
For now I want to leave some notes about sessions I visited.

Day 1:

1) User story mapping: Discover the whole story by Jeff Patton. It was good especially as Jeff is a great presenter. But the content was a little bit childish - too easy and nothing special.
2) Make impacts, not software by Gojko Adzic. Second session was not very deep as well and I suppose nobody would expect to get some out-of-the box solutions; so from that session I was able to get few ideas at least like how to piss of scrum masters :) Or why we don't actually need all that test coverage.
3) Cool things about D - why and how we use it at Facebook by Andrei Alexandrescu. Finally that was a great speech. Andrei not only covered the simple usage of D (in a great way! so I started to plan when I will download its compiler) but as well talked about purity and some general programming concepts. It was useful and interesting. I would say that it was one of the best sessions from today.
4) Groovy: the awesome parts by Paul King. I wanted to get into groovy a little and the session started with an idea that groovy is the same thing for java as D for C++ but, unfortunately, this topic was not of the same quality as previous one. Frankly, it was just boring... Basic examples and no real value. At least for me.
5) Programming in the large: Architecture and experimentation by Mark Hibberd. Mark did a great job of general description of the general programming myths with a real examples of what his team doing. He even admitted that they could do it better! It was fun to listen to him and it was really motivational. Once again - it made me think of what and how I would do in the future. Thank you Mark.
6) Functionally obvious and succinct by Edward Kmett. This session was hard. Really hard. First of all - I had never seen haskel code before and secondly - it was all about optimization so a lot of "o(log(n))". And during the session I almost constantly had a question "wat" in my head. But later on the way home I rethought what I heard and it comes that this topic is interesting for me and I would like to try to implement the same data structure with C# (and will post about it soon).

Day 2:

1) Reactive, message driven and scalable by Todd L. Montgomery. Todd was talking about the past, present and future of the http protocol. Interesting topic but it was pretty much summarized by his own words that it is likely that most deevlopers wont notice any difference - it is too low level.
2) The scaling dilemma by Mary Poppendieck. Another session about the "agile way". This time on how to scale the agile approach for the enterprise level. Frankly, just another agile talk - nothing new. Maybe those agile coaches just aiming for a real general things?
3) How we went from 1 million to 1 billion events without throwing everything away by Julian Giuca. That was just boring - Julian was speaking about their approach to frameworks, made a lot of examples and he is a good speaker. But the topic was just bad, nothing specific and nothing useful - just a bunch of general ideas that everyone can produce.
4) How to undo almost anything with Git by Peter Bell. Finally, that was the only session on that conference (for me) where the speaker was not only showing slides but actually type something. During that speech I was enjoying the real console and actual usage of the Git. That was really fun!
5) Agility at the essence of software architecture by Simon Brown. Luckily, that session was not a common agile talk. From that one I was able to catch some new ideas and approaches, I am very pleased that I have seen it. Sketching is great :)
6) Pippi's book of the dead trading cards by Elizabethe Kramer. Well, the last session of the conference was the worst one. It was more about psychology then development and it was really bad. Elizabeth told us how she was able to settle one unpleasant situation  for one company. But why I would like to know it - I don't know :)

So that was all. Unfortunately, I was not able to network at all, my social skills need a lot of improvements!