How a sub-shell differs from a sub-process/child-process can often be a cause for confusion. Hopefully, this article may help alleviate it.
Continue reading “Shell Scripting – Subshell vs Subprocess”
Templates allow us to write generic classes (called template classes) and generic functions(called template functions) that can work with generic data-types.
Continue reading “C++ – Templates”
Lambdas or Lambda Expressions were introduced into the standard in C++11.
Continue reading “C++ – Lambdas”
I was once asked in an interview about the importance of memory alignment. I had absolutely no clue as to what it meant or why it was important in high performance/low latency programming.
Continue reading “C++ – Memory Alignment”
What is gRPC?
gRPC is an RPC framework whose default Interface Definition Language (IDL) is Protocol Buffers. But IDL in gRPC is pluggable which means that other serialization formats like Thrift, Avro etc can also be used with gRPC instead of Protocol Buffers.
Continue reading “Develop and deploy a gRPC application on AWS”
Writing good multi-threaded code is a skill in itself. There are several concepts one needs to be familiar with before starting out to write a multi-threaded program. I will briefly explain some of these concepts with a focus on C++.
Continue reading “Multi-threaded Programming 1”
If you have ever wondered how a program written in C++ or any other language finally gets executed on the hardware and gives us the intended results,this is the article for you. This article will give you a high level overview of what happens behind the scenes.
Continue reading “LifeCycle of a program – A C++ Perspective”
Typecasting in C++ allows us to perform conversion between types.
Continue reading “C++ – Type Casting”
In C++, memory allocated from heap has to be freed manually. But there could be situations where the programmer forgets to deallocate the memory and causes what is known as memory leakage.
Continue reading “C++ – Smart Pointers”
Polymorphism is the ability of an object to exhibit multiple behaviors. C++ allows two types of polymorphism, Static and Dynamic. Static polymorphism happens at compile time via function overloading whereas Dynamic polymorphism is exhibited at run time via function overriding.
Continue reading “C++ – Polymorphism”
Visitor pattern is a behavioral pattern that allows addition of new features to a class without actually modifying the class. Visitor pattern is one way of implementing the Open/ Close principle (which is one of the SOLID principles).
Continue reading “Object Oriented Software – Visitor Pattern”
Softwares are susceptible to change. A new requirement can come-up any time and the software should be able to handle this change effectively with minimum intrusion. A software that is well designed can easily adapt to these ever-changing requirements and hence a good design is of utmost importance especially when it comes to design and development of a commercial software.
Continue reading “Object Oriented Software – GOF Design Patterns”
strcat() and strcpy() are two functions that work with the c-style strings. While the former concatenates two strings, the latter copies one string into the other. Both these functions have been the reason for multitude of bugs in many applications. Although, they are simple functions to use, most programmers are oblivious to their implementation details which has resulted in quirky and hard-to-debug behaviors in several applications .
Continue reading “C++ – Be wary of strcat() and strcpy()”
Let me make it clear beforehand. Don’t misinterpret the heading. I am not going to talk about the Fibonacci optimization technique using memoization and DP where you store the result of sub-problems to make the algorithm faster. That’s the old school optimization technique which has a time complexity of O(n) and an equivalent space complexity. There is an even better optimization technique which I came across in one of my graduate classes (where I am a student:D). I will be talking about a new way of representing the Fibonacci series which will help us compute the results way faster than the other techniques.
Continue reading “Algorithms – Optimizing nth Fibonacci Number”
A class or a function can be made a friend of another class in C++. A friend gets access to all the private members and protected members of the class to which it becomes a friend.
Continue reading “C++ – ‘Friend’”
A constructor is a special member function that is automatically called when you create an instance of a class. Continue reading “C++ – Constructor”
The idea of inheritance implements an IS-A relationship between classes.
Continue reading “C++ – Inheritance”
When a class inherits from another class, it is possible to override the public methods of the base-class in the derived-class.
Continue reading “C++ – Virtual Functions”
Static keyword in C++ can often be a cause of confusion for many people because of its varied use cases. If you are one of them, hope this article helps you alleviate it.
Continue reading “C++ – Mastering ‘Static’”
Let’s see how the compilation process works in C++.
Continue reading “C++ – Scope and Linkage”
I have been coding for some time now and yet, I feel confused when I get into a discussion about the core algorithmic concepts. I still can’t figure out if a problem needs a Dynamic Programming solution, or if its needs a divide and conquer treatment or if it should fall under a different category. This article is just an attempt to convey my level of understanding of the intuition behind Dynamic Programming. Feel free to weigh in!.
Continue reading “Algorithms – Dynamic Programming”
One Definition Rule or ODR is an important rule in C++ which loosely states the following.
Continue reading “C++ – One Definition Rule”
TicTacToe game can be framed into a typical search problem involving game trees with each node representing a game state (or game position) and each edge representing a move made by a player.
Continue reading “Algorithms – AI behind a Tic-Tac-Toe Game”
With a large amount of data being generated in the world every second, it becomes necessary to track data as much as possible so that current situations can be thoroughly analyzed and important conclusions can be drawn from the same.
Continue reading “PUMP IT UP – Data Mining the Water Table”
People discuss shallow copy and deep copy in the context of classes.
Continue reading “C++ – Deep Copy vs Shallow Copy”