C++ Interview Questions

Designing Callbacks in C++ – Part 1: Function Pointers

In this article we will discuss what is a callback and what types of callbacks we can have in C++ and how to Design Callbacks as function pointers.

What is a Memory Leak in C++ ?

In this article we will discuss what is Memory Leak C++ and why its harmful for applications.

Differences between a pointer and reference

Differences Between Pointer and Reference in C++ are as follows,

Allocating and deallocating 2D arrays dynamically in C and C++

In this article we will see how to allocate and deallocateÂ 2D arrays dynamically using new / delete and malloc / free combinations.

Designing Code for Fibonacci Sequence without Recursion

What’s a Fibonacci sequence: Fibonacci sequence is a kind of sequence in which every subsequent number is sum of the previous two numbers i.e. 0,1,1,2,3,5,8,13,21,34,55,89,144

Designing Code to Convert the base of a Number to any other base in Number System

In this article we will discuss how to design a Class that represents the Number in a Number System and also provides the facility to convert the BaseÂ associated with that Number i.e. conversion from any Base to any other base like,Â octal to hexa or hexa to decimal etc. [showads ad=inside_post] Create a class Number that

Using STL to verify brackets or parentheses combination in an expression

In this we will see how to check if a given string take validÂ combination of open and close brackets i.e. (4+{8-[22+8]*}]Â contains valid order of open and close brackets. ({5+8]) contains invalid combination of open and close brackets. [showads ad=inside_post] BracketÂ combinationsÂ to be used, { , } [,] (,) AlgoÂ Used:   CreateÂ a empty stack of characters Traverse

How virtual functions works internally using vTable and vPointer?

In this article we will discuss that how virtual functions in C++ works internally usingÂ vTable andÂ vPointer.

When to use virtual functions in C++?

When we want a Derived Class to override a member function of Base class, then we should make that member function in Base class virtual.Â So that if someone uses the Derived class object using Base class’s pointer or reference to call the overridden member function, then function ofÂ derived class should be called.

Object Oriented Approach to Display a sequence of numbers without any For-Loop or Recursion

Suppose we have to display a sequence of numbers like from 10 to 20 i.e.

Scroll to Top