👨‍💻 🚀 Intro to C++ - Roadmap
Photo by delfi de la Rua / Unsplash
Intro
If I had to learn C++ from scratch, I’d do this -
- Write “Hello World” in C++ - Link - Read about what every line in a “Hello World” program does and why its important.
- Time and Space Complexity - Link.
- Variables and data types - Link, Link - Learn about how the variables are stored in the memory. Stack vs Heap memory. Learn about how to take inputs in variables and how to print outputs - Link. Learn about the limits of variables - Link. Also read about how one data type is converted into another - Link.
- Opeators and how they interact with different data types - Link.
- Conditional statements - If / Else - Link. And learn about relational operators - Link. Try to stack multiple If / Else statements together.
Questions
- Take 4 marks as input and print average marks - Eg - 18, 19, 19, 18 => 18.5. Make sure you print a floating number.
- Given the first 3 numbers and n, find the nth number of the arithmetic progression.
- Given a number, Write Fizz if the number is divisible by 3, Buzz if the number is divisible by 5 and FizzBuzz if it is divisble by both 3 and 5.
Loops
- Loops - For loop, While loop, Do while loop. Try to write nested loops.
- Control flow statements - Break, Continue and Goto.
- Switch statements and when to use them over If Else.
Questions
- For a given n, Return the sum of 1 + 2 + 3 + … + n
- Create a Fahrenheit to Celsius converter
- Create a calculator from scratch. User can input 1,2,3,4 for Addition, Subtraction, Multiplication and Division respectively. User can then input two numbers and the program should return the necessary output.
- Given a number, Check if it is a palindrome.
- Generate the first n numbers of Fibonacci.
- For a given n, Print star pattern (E.g. n = 4)
*
**
***
****
- For a given n, Print number pattern (E.g. n = 4)
1
12
123
1234
- For a given n, Print alphabet pattern (E.g. n = 4)
A
AB
ABC
ABCD
- For a give number n, Print reverse number pattern (E.g. n = 4)
1234
123
12
1
- For a given n, Print number pattern (E.g. n = 4, Spaces in beginning)
1
12
123
1234
- For a given n, Print star pattern (E.g. n = 3, Spaces in beginning)
*
***
*****
- For a given n, Print star pattern (E.g. n = 3, Spaces in beginning)
*
***
*****
***
*
- For a given n, Print number pattern (E.g. n = 3)
33333
32223
32123
32223
33333
Functions
- Functions,
- Arguments and Return Types,
- What are default arguments and how to overload a function
- What is scope of a variable ?
- How to call a function by value or reference ?
Questions
- Make a Celsius to Fahrenheit function that takes a float value of Fahrenheit and returns a Celsius value. It should return the room temperature if no value is passed.
The questions for the topics below are avaialbe in DSA List
👨‍💻Ashhad DSA List
- Arrays - The basics of Arrays, How they are stored in the memory and how to use arrays with functions.
- Multidimensional Arrays
- Strings - Character arrays and cstring library and its popular functions.
- Searching and Sorting - Linear Search, Binary Search, Selection sort, Bubble sort, Insertion sort, Merge Sort and Quick Sort. Implement each of them from scratch.
- Hashmaps - How is it implemented internally, Its hash function.
- Pointers in C++, and how is a constant pointer and pointer to a constant different net ?
- Allocate / Deallocate memory dynamically
- Recursion and Backtracking
Questions
- Raise x to the power n using recursion.
- Generate nth fibonacci number.
- Check if a string is palindrome using recursion.
- Implement merge sort and quick sort.
- https://leetcode.com/problems/climbing-stairs/
Once you’re done with the these topics, you can move on to Advance Data Structures and Algorithms like Linked Lists, Stacks, Queues, Binary Trees, BST, Generic Trees, Maps, Priority Queue, DP, Graph. I have covered most of these algorithms in my last video.
And you can check the DSA List for questions that will help you with interviews.
👨‍💻Ashhad DSA List
Thanks, Hope you liked it.
