Learn C, C++, Data Structures, Algorithms, Design Patterns, Coding Patterns, System Design
FreeCpp.com is your ultimate destination for mastering C++ interview preparation, data structures, design patterns, coding patterns, and STL!!
Hello, what would you like to learn about?
Programming Language’s
DSA
System Design
Latest Posts:
- Machine endian C++Endianness determines the byte order in which multi-byte data types… Read more: Machine endian C++
- Pimpl idiom C++ (Pointer to Implementation)The Pimpl idiom (short for Pointer to Implementation) is a… Read more: Pimpl idiom C++ (Pointer to Implementation)
- RAII (Resource Acquisition Is Initialization)RAII (Resource Acquisition Is Initialization) is a C++ idiom used… Read more: RAII (Resource Acquisition Is Initialization)
- Curiously Recurring Template Pattern (CRTP)The Curiously Recurring Template Pattern (CRTP) is a C++ idiom… Read more: Curiously Recurring Template Pattern (CRTP)
- MVC (Model-View-Controller)MVC (Model-View-Controller) is a design pattern used in software development… Read more: MVC (Model-View-Controller)
- C++ Static vs Dynamic LibrariesIn C++, libraries can be categorized into static and dynamic… Read more: C++ Static vs Dynamic Libraries
- CMakeCMake is a cross-platform build system generator that is widely… Read more: CMake
- C++ Unit TestingUnit testing is an essential part of ensuring the reliability… Read more: C++ Unit Testing
- Boost Flat Mapboost::container::flat_map is an alternative to std::map that is optimized for… Read more: Boost Flat Map
- Boost C++ LibrariesBoost is a set of high-performance, peer-reviewed C++ libraries that… Read more: Boost C++ Libraries
- Best online C++ compilersHere are some of the best online C++ compilers, depending… Read more: Best online C++ compilers
- Debugging C++ crashDebugging a C++ crash can be challenging, but there are… Read more: Debugging C++ crash
- Is C++ safe?C++ is a powerful and highly performant programming language, but… Read more: Is C++ safe?
- GCC Version and Supported C++ StandardsOver the years, GCC has evolved to support a range of C++ standards, from older versions (like C++98) to the latest (C++20). The GCC version you use determines which versions of C++ are supported, along with the specific features and optimizations available
- Best C++ IDEVisual Studio, CLion, and Eclipse CDT are the top choices, with support for modern C++ standards, debugging tools, and project management.
- C++ Companies IndiaIn India, C++ is widely used in various industries such… Read more: C++ Companies India
- C++ vs C#C++ vs C# is another common comparison in the programming… Read more: C++ vs C#
- C++ vs PythonC++ is ideal for performance-critical applications, systems programming, and high-performance software where low-level memory management and fine control over hardware are essential. Python, on the other hand, is an excellent choice for rapid development, scripting, data science, machine learning, and web development. It is easy to learn, has a vast ecosystem of libraries, and is highly productive for developers working on applications where development speed and flexibility are more important than raw performance.
- C++ vs RustC++ vs Rust is a frequently discussed comparison, especially in… Read more: C++ vs Rust
- C++ vs JavaChoosing between C++ and Java largely depends on your project requirements, industry, and personal preferences.
- Life as C++ developerC++ developers work on a wide variety of applications, ranging from low-level system software to high-performance applications. Here’s a glimpse of what life as a C++ developer might look like, broken down into different aspects
- C++ Developer Salary IndiaC++ developer’s salary in India typically increases with experience, specialized skills, and the type of company they work for. In the early stages, developers can expect moderate salaries, while experienced professionals in senior or lead roles have the potential to earn high salaries, particularly in high-demand areas like fintech, embedded systems, or AI/ML.
- FAANG interview preparation planHere’s a clear plan for clearing FAANG interviews, breaking it down into phases:
- HFT top questionsHere are some top HFT interview questions that can help you prepare for a job in the domain:
- FAANG top questionsFAANG top questions
- 1.5) Self-Balancing Binary Search Trees (BSTs)BSTs offer fast search, insert, and delete operations when they are “balanced” – meaning the tree’s height is relatively small and comparable to the logarithm of the number of nodes.
- 1.4) Find the Floor of given value in BSTThe “floor” of a given value is the largest value in the tree that is less than or equal to the given value. In other words, it’s the “closest” value in the tree that is not greater than the given value.
- 1.3) Binary Search Tree DeletionWhen deleting a node in a Binary Search Tree (BST), there are three possible cases to consider: a)Node has no children (leaf node) b) Node has one child c) Node has two children
- 1.2) Binary Search Tree ImplementationBST C++ code that creates a simple Binary Search Tree and inserts elements into it while maintaining the BST property: elements in the left subtree are smaller, and elements in the right subtree are larger.
- 1.1) Introduction to Binary Search TreeFor every node ‘N’, all elements in the left subtree of ‘N’ are less than the value of ‘N’, and all elements in the right subtree of ‘N’ are greater than the value of ‘N’.
- 3.8) Iterative Postorder Traversal of Binary TreeWrite a program to perform an iterative post order traversal and print the values of the nodes as they are visited.
- 3.7) Iterative Preorder Traversal of Binary TreeGiven a binary tree, write a program to perform an iterative preorder traversal and print the values of the nodes as they are visited.
- 3.6) Iterative Inorder Traversal of Binary TreeGiven a binary tree, write a program to perform an iterative in-order traversal and print the values of the nodes as they are visited.
- 3.5) Serialize/Deserialize Binary TreeTo convert a binary tree into a string representation (serialization) and then converting it back from the string to the original binary tree (deserialization).
- 3.4) Count Nodes in Complete Binary TreeGiven a complete Binary Tree, write a function to count and return the total number of nodes present in the tree.
- 2.5) Find whether Binary Tree satisfies the Children Sum Property or not?The Children Sum Property states that, for each node in a Binary Tree, the value of the node must be equal to the sum of the values of its left and right children. If the node has no children, then the property is still satisfied.
- 2.4) To Print Nodes at K DistanceGiven a Binary Tree and an integer value K, write a function to print all the nodes that are at a distance K from the root node.
- 2.3) Find Height of Binary TreeGiven a Binary Tree, write a function to find and return the height of the tree. The height of a Binary Tree is the maximum number of edges on the longest path from the root node to any leaf node.
- 2.2) Find Maximum value among all nodes in the treeWrite a function to find and return the maximum value among all nodes in the tree.
- 2.1) Size of Binary TreeThe size of a Binary Tree is the total number of nodes present in the tree. It represents the count of nodes, which includes both internal nodes (with children) and leaf nodes (without children). Calculating the size of a Binary Tree involves traversing the tree and counting the nodes.
- 1.7) Binary Tree Zig-Zag traversal (Spiral Form Traversal)Spiral form traversal of a Binary Tree involves traversing the nodes level by level, alternating the direction between left to right and right to left. This creates a “zigzag” pattern as you move down the levels.
- 1.6) Level Order traversal of a Binary TreeLevel Order traversal explores nodes level by level, visiting all nodes at a given level before moving to the next level. This traversal order is useful for tasks like breadth-first search, finding the shortest path, or printing the tree in a structured way.
- 1.5) Post-Order traversal of a Binary TreePost-Order traversal visits nodes of a Binary Tree in the order: Left-Right-Root. This means you start by visiting the left child, then the right child, and finally the current node (root).
- 1.4) Pre-Order Traversal of Binary TreePre-Order traversal visits nodes of a Binary Tree in the order: Root-Left-Right.This means you start by visiting the root, then move to the left child, and finally to the right child.
- 1.3) In-Order traversal of Binary TreeIn-Order traversal is a way of visiting all nodes of a Binary Tree following a specific order: Left-Root-Right. This means you start from the left child, then visit the root, and finally move to the right child.
- 1.2) Binary TreeA Binary Tree is a type of data structure where each node can have at most two children. It’s like a branching structure where each node has the potential to lead to two other nodes. This structure is used in various computer science applications to organize and manage data.
- 1.4) Is Subsequence or not?Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.
- 1.3) Counting BitsGiven a non-negative integer n, for every i (0 ≤ i ≤ n), calculate the number of 1’s in their binary representation and return an array.
- 1.2) Fibonacci NumberThe Fibonacci numbers are a sequence of numbers where each number is the sum of the two preceding ones, starting from 0 and 1. Given an integer n, find the n-th Fibonacci number.
- Minimum Cost to Hire K WorkersThere are N workers. The i-th worker has a quality quality[i] and a minimum wage expectation wage[i]. Now you want to hire exactly K workers to form a paid group. When hiring a group of K workers, you must pay them according to the following rules: