Skip to content
BaharehMz edited this page Nov 9, 2017 · 3 revisions

Welcome to the C++ Coding Practice wiki!

The following is a list of topics to study and a brief summary and important notes on each topic and list of good/useful questions. (I wrote the list from Cracking the coding interview, also using the following references: Cheat Sheet, Gainlo, Google TechDev) We'll keep updating this wiki as we go through each topic.

Data Structures

Arrays

Definition

Stores data elements based on a sequential, most commonly 0 based, index.

Key points

Optimal for constant access to specific indices. Bad for finding specific elements. Arrays can have constant size or they can dynamically resize. If a dynamic array is full, it copies it's contents to a larger array. A good way to do this is to double the size when array is full, this way (it can be proved) that the amortized cost of insertion is still O(1).

Big O efficiency

Index access: O(1) Find an element: O(n)(If array is sorted, O(log n) with binary search) Insertion: O(1) if at the end of the array, O(n) otherwise

C++ Implementation notes

Arrays can be implemented either as fixed or dynamic sized arrays (e.g int a[10];) or we can use stl vectors.

Coding problems

List of coding problems for this topic (mostly from leetcode probably) + maybe some points on each question

Warm up:

Degree of an array

Shortest unsorted continuous subarray (Our Code)

Medium:

Hard:

Hash tables

C++ Implementation notes

Using C++ STL, we can use ordered or unordered map: unordered_map<int, int> my_map; Useful functions: insert, find, count

Strings

Linked Lists

Stacks

Queues

Trees (Includes binary trees)

Heaps

Graphs

Concepts & Algorithms

Bit Manipulation

Recursive programming

Dynamic programming

Sort and search

Tree & Graph algorithms

Testing

Object Oriented Design

System Design & Scalability

C & C++ Must Knows

Additional Topics

Red-Black Trees

MapReduce