This section contains simple C++ programs that are typically asked in technical interviews. The questions have been gleaned from various sources on the web. Solutions were coded and tested on a development environment consisting of a laptop running 64-bit Windows 7 home premium edition, MinGW g++ compiler and Eclipse IDE. Each code snippet can be compiled and executed independently without dependency on other files. This has been deliberately done to be instructive.Â
Even though these programs are quite simple, they cover some of the very basic data structures and algorithms in computer science.
The programs have been organized as follows:
Simple C++ Programs
Arrays and strings
Reverse Polish Notation calculator
Graphs and Trees
Check for Path in a Directed Graph
Lists, queues and stacks
Check if linked list is a palindrome
Delete duplicates in linked list
Delete specified node from linked list
Find start of loop in linked list
Nth node from last in linked list
Recursion
Combinations of string - k at a time