When we first start building API’s we make many assumptions about our users. We assume that they would never input bad data. This is very unrealistic. Have you ever experienced the frustration of filling out a long form at the dentist office? This is the exact same feeling users have…
FirstOrDefault in EF Core (Explained Simply)
Many times in life we just want one thing. This is no exception for C# and when we are working with database entities. When you want a single entity from a database, you will be given the choice of a few methods: FirstOrDefault() FirstOrDefault() returns the first element that satisfies…
Algorithm Patterns 101: Array Swaps
Array swapping is an algorithm pattern that is used constantly in a variety of interview questions and sorting algorithms. To put in simply, array swapping is just switching two array elements. In our example, we have an array of numbers. We want to swap the element at index 1 (which…
Move Zeroes LeetCode Interview Question (Explained Simply)
The title of this LeetCode questions is very ambiguous and does not do a great job explaining what it actually does. All this interview question is asking you to do is move the zeros to the end of an array. That’s it. Before: After: 2-Pointer Step-By-Step (In-Place)
Valid Mountain Array in Java (Explained Simply)
Essentially, this Leetcode question is asking “do the numbers in an array go up then go down“. It’s called a mountain array because if you draw a line tracing the path of the numbers it will look something like this: The following conditions must apply: Another way to describe this…
Repository Pattern Explained Simply
Repository Pattern is likely the only design pattern you will implement as software developer. %99 of software design patterns are very rarely implemented, but the repository pattern is something you will see everyday. First, let’s just see a Repository Pattern and what it is: All this code does is get…
Async/Await in C# Explained Simply
Asynchronous programming is simply a way to make a computer do two things at once. In .NET Core, it is almost required to write high performance servers that can communicate with multiple clients. An asynchronous model allows multiple things to happen at the same time and doesn’t block the flow…
CreatedAtAction in ASP.NET Core Explained Simply
CreatedAtAction is a helper function that is typically used in POST and creation API requests. This method is not new by any means but it seems that the days of plain Ok() and Created() are over as more and more people shift. But why do we need a fancy helper…
How To Capitalize Words In A Sentence (JavaScript)
Believe it or not, there is no magical method to capitalize words in a string. Not only is this a very common algorithm, but it is a common task. Just like the words in the title of this blog, sometimes capitalizing each word makes things look good! Using charAt() Happy…
Algorithm Patterns 101: Reversing Linked List
Linked List is a data structure which stores the data in a linear way. Unlike an array, data in a linked-list is non-contiguous (aka the data does not exist next to each other). Each element of a linked list contains a data field to store the list data and a…