Tech

SOLID principles in C#

Have you encountered a codebase where a single class/module doing so many things and any small change in a module breaks another and you think to yourself how this happened, if only you knew how to prevent this in the first place? Or a case when a senior developer reviews your PR and says move…

Leetcode

Pascal’s Triangle

Problem Statement The logic is in the above gif itself. We have to do the following things.1. Hardcode 1 at 0th and last position of every row.2. If we are at the ith row and jth column. We can get the value of pascal[i][j]. pascal[i][j] = pascal[i-1][j-1] + pascal[i-1][j];

Tech

Async, await, and Task in C#

Asynchronous programming is one of the powerful features in C#. It allows parallelism in programming which results in faster execution of a program. There are many languages that support asynchronous programming. Examples can be thread class in java, promises in Javascript, and GoRoutines in Go language. In C# to achieve this, we use 3 keywords…

Singleton vs Static
Tech

Singleton vs Static class

The difference between singleton class vs static classes is one of the standard questions which you may encounter in your interviews. . There are many articles around this topic, I found many differences between these two. So the obvious question that arose what is common between these two. The answer is, there is only one…