Archive for category Interview
Tech Interview – Improve the Algorithm
Posted by Viktor Peller in .NET, Algorithms, Interview on November 11, 2017
Adding new files to our database increases the processing time significantly. This is because the algorithm we use is not efficient. Let’s recap how it works. After we read the database in, we have a list of Person instances, and every Person instance maintains a list that tells which other people this person likes: If […]
Tech Interview – Non-recursive Tree Traversal
Posted by Viktor Peller in .NET, Algorithms, Design Patterns, Interview, Refactor on November 4, 2017
In the previous part we extended the database structure and now it supports sub-directories. The algorithm that walks through the directory structure is based on recursive calls. Many times recursion results a nice program structure, but it also has its drawbacks. What if we want to process the data – like files from a directory […]
Tech Interview – Recursive Tree Traversal
Posted by Viktor Peller in .NET, Algorithms, Interview on October 3, 2017
One of the improvements we need to make on the Like Statistic application is to change the structure of the database where the datafiles are stored. The database is a directory with datafiles, and the program reads all datafiles from that given directory from a single level, but doesn’t read those from the subdirectories. In […]
Tech Interview – Refactoring V – Convention Based Factory
Posted by Viktor Peller in .NET, Design Patterns, Interview, Refactor, SOLID Principles on September 10, 2017
In the previous part we fixed the code which reads the Person instances from the datafiles. A part of this code was a Factory class based on a switch statement. This solution is ok, but when we add a new parser, we need to remember to add a new case block to the switch statement. […]
Tech Interview – Refactoring IV – SOLID Refactor
Posted by Viktor Peller in .NET, Design Patterns, Interview, Refactor, SOLID Principles on August 27, 2017
In this part we are going to refactor the parsers and the factory method more, utilizing design patterns and the SOLID principles.
Tech Interview – Refactoring III – Simple Refactor
Posted by Viktor Peller in .NET, Code Smell, Interview, Refactor on July 24, 2017
In the previous part we looked over the MainWindow class and found some improvement points. Those were common mistakes with simple fix. We skipped a big switch block, because it needed more work, and today we are going to refactor that part. We will not refactor it to its final form, though, first, we just make it better. In a second blog post, we will improve the code more.
Tech Interview – Refactoring II – Code Smells
Posted by Viktor Peller in .NET, Code Smell, Interview, Refactor on July 22, 2017
In this part we are going to take a look at the source code and try to answer the question that usually sounds like “what problems can you see at first look” or “what do you dislike when you look at this code” or “how would you change the code to make it better”.
Tech Interview – Refactoring I
Posted by Viktor Peller in .NET, Interview on July 20, 2017
In this series we are going to solve a programming test which was designed for interviews to see how a candidate can solve practical problems. During the test, we need to refactor and improve a small application.
Recent Comments