Course Overview
There are already innumerable courses/tutorials on the internet/Udemy which teach almost every aspect of C programming language. All those courses sound the same, talk the same and deliver more or less the same knowledge. How is this course different from others?
The intention of this course is to make you ready for System programming Technical interviews, interview level - from Beginner to Intermediate. This course is for (future) Developers, not for testers or System Administrators.
I choose to create this course to fill the gap between novice/beginner and intermediate/Advanced Programmers. This course assumes that you are at least above average in programming (in any programming language, but preferable in C/C++) - know memory allocations, all kinds of loops, function calls, pointers etc. In this course, I won't teach C/C++ (there are already many courses on it online) but would teach programming techniques and low-level details regarding how C program works behind the scenes - All topics are very important from an interview point of view. My Target is to grow this course into Linux/C Bible.
Yet, I always feel, you need to outsmart your fellow colleagues in this era of stiff competition, and therefore, I tried this attempt to present you the wisdom and knowledge which is of utmost importance for a programmer. I have seen though students could write good C/C++ programs, yet they lack the clarity on how one should write better organized, Manageable, extensible, and programmable codes in the form of libraries. For example, Students are too good at competitive programming, yet do not know how to write a simple Makefile, the reason being, Academics do not teach and students do not care to learn.
In this course, I will cover the topics related to creating Linux System Libraries (release 1) with Advanced language-agnostic Programming Concepts (release 2) which can be well applied if you happen to become a programmer in other languages tomorrow.
The Concepts like MultiThreading, Thread-Synchronization, Socket Programming, IPCs, etc demand a separate course on each topic altogether. Currently, I have a course on IPC, pls check it out. These topics are out of scope for this course.
The Course shall be delivered into two Releases :
Release 1 Building and Managing a Library: This covers the basics regarding how one should create and organize his code as a Library.
Release 2 Memory Management Concepts: This covers Advance concepts on Linux Memory Management specifically. Please check the Table of Contents for more info.
Why you should *NOT* do this course?
1. Please Excuse this course if you are the ultimate beginner in C programming !!
2. There is no point of doing this course if you don't like hitting the keyboard, and are lazy enough to watch lecture VDOs only
3. If you want everything cooked and served on your plate.
Course Pre-requisite :
Above Beginners Level in C/C++ programming
Good to have basic OS knowledge
Zeal to excel and Code
No Third-Party libraries
Whatever logic you implement, you need to implement it from scratch. Like all my other courses, this course does not suggest taking the help of any third-party library to get the jobs done. The use of external libraries completely defeats the purpose of the course.
Warning: This course has auto system-generated subtitles which may not be perfect. Please disable subtitles at your convenience.
Curriculum :
**********************************************
Release 1 Building and Managing a Library
**********************************************
Section 1 : Introduction to Libraries
What is Library
Relationship between Library and Application
Ex : Doubly linked list as a Library
Quick Compilation Steps
Summary
Section 2 : Header Files
Relationship between Source and header files
Text Substitution Method
Text Substitution Method - Example and Demo
Section 3 : Preprocessing Directives
Problem of Duplicate inclusion of Hdr files
Pre-processing Directives
Solution to Duplicate inclusion of Hdr files
Section 4 : Correct way of Using Structures and Functions
Structures - Define and Use thumb Rule
Functions - Declare and Use thumb rule
The problem of Recursive Dependency
A solution to Recursive Dependency
Section 5 : Creation of Static and Dynamic Libraries
Resuming with Doubly Linked List Library
Quick Creation of Static and Dynamic Libraries
Linking with Static Library
Linking with Dynamic Library
Section 7: Understanding four stages of Compilation
Four stages of C/C++ Compilation
How Dynamic Library works ?
Dynamic Linking : Linking with Dynamic Library
Comparison - Static Vs Dynamic Linking
Section 8 : Building using a Makefile
What are Makefiles and why do we need it
Functions of Makefile
Makefile Dependency tree
Steps of Writing a Makefile
Assignment on Makefile
Section 9 : Run-time Programmable libraries
What are Programmable Libraries?
Steps to Program the libraries
Registering of the callbacks with Libraries
key_match callback
comparison_fn callback
Delegation of Application-specific operations to Libraries
Section 10 : Writing Iterators using Macros
What are Iterative Macros ?
Why we need Iterative Macros ?
How to Write Iterative Macros - For Trees and Linked Lists
Exercises
Section 11 : Glue Based Libraries and Data structures
What are the Glue Based Libraries?
Introducing Glthreads - A Glued LinkedList
Glthreads Vs Traditional Linked List
Structure field offset
GLThread Operations
Code Walk
GLThread Benefits
Section 12 : Bit Level Programming
Logical Operators
Implementing BIT manipulating C macros
Using Enums as Bits
Bit Pattern Matching
BitMaps
************************************************
Release 2 Memory Management Concepts
************************************************
Section 13 : Memory Layout of Linux Process
Virtual Memory Basics
Memory Layout of Linux Process
Example: Memory Layout of Linux Process
Exercise on size command
Section 14 : Stack Memory Management
Stack Memory Basics and Contents
Stack-Overflow and Prevention
Stack Memory Corruption
Common Cpu Registers
Procedure Call Mechanism - Step by Step
Purpose of Base Pointer register (ebp)
Procedure Return Mechanism - Step by Step
Lab session
Section 15 : Heap Memory Management
Introduction and Goals
How Malloc Works
Top of Heap Memory region - break pointer
Heap Memory Mgmt Sys Calls - brk and sbrk
Meta and Data Blocks
How free() works
Block Splitting
Block Merging
Memory Illness - Problem of Fragmentation
Section 16 : Concept of Paging
Introduction to Paging
Byte Addressable Memory
32 bit and 64 bit Machine Architecture
Address Bus and Data bus
Physical Vs Virtual Address
Physical Memory Frames
Virtual Address Composition
Page Table
Paging In Action
Shared Physical Memory
Section 17 : Multilevel Paging
Section 18 : Demand Paging
Section 19 : Memory Management for Multi-threaded Process
The intention of this course is to make you ready for System programming Technical interviews from beginners to upto 8-9 yrs of experience.
Q. What are the frequently asked questions by interviewers in a technical round when someone writes C/C++/System Programming language on their resume?
Answer : If i am interviewer, what questions i would ask depends on his no of years of experience in C.
1–3 yrs of experience — I would have asked:
Double pointers
design a Macro to return the size of the structure
Two Dimensional Arrays, passing and returning arrays from a fn
Different stages of C program compilation
how fork() works
What are various ways to debug memory corruptions.
various IPCs
Heap and Stack memory-based Question
4–6 yrs of experience - I would have asked:
How memory is allocated by the OS
Internal and external fragmentation, what can be done to avoid it
System calls, strace()
Trade-of of one IPC over other
various ways to communicate with kernel and comparison
Data (De)Serialization in C
RPC in C
callbacks advanced application
typedef Vs #define
Generic programming in C using macros
Thread Synchronization
Heap and Stack memory-based Question
7+ yrs of experience - I would have asked
Have you designed any system module to solve any problem
Design thread library 0 what functionalities would you incorporate in and how?
What are Dos and Dont’s for writing a robust and flexible library
How to write generic code in C
Various ways to implement timers in C, and comparison of approaches
How do Interrupts work ?
IPCs and comparison
How would you convert a C code to C++ and vice versa
How to write a tool to detect memory leaks Or garbage collection
Design your own memory allocation tool. Why would you write your own memory allocation scheme?
When to go for Multi-process design over Multi-threaded design and vice versa
How ValGrind tool works
In production code, would you favor recursive but simple logic, Or Nonrecursive but complex logic, and why?
If you analyze the pattern,
Candidate with 1–3 yrs of experience, I would choose to ask more of a direct and straightforward Questions.
Candidate with 4–6 yrs of experience, I would choose to ask more advanced technical C Question plus some comparison of approaches based Questions
Candidate with 7+ yrs of experience, I would choose to ask more of a design and Analysis based Question.
Note that, since the Question pertains to C and System Programming, so I have not mentioned Data structures and Algorithms.
FAQ
FAQ area empty
Course curriculum
Chương 1 Introduction 6 bài · 23 phút
- Introduction Học thử 9:58
- Join Telegram Group Học thử 0:13
- Setting up Linux Development Environment Học thử
- Begin - Doubly Linked List as a Library Học thử 3:27
-
Quick Compilation Steps 6:09
-
Summary 2:50
Chương 2 Understanding Header Files 5 bài · 25 phút
-
What are Header Files and their Purpose ? 4:22
- Relationship between Source and Header Files Học thử 7:48
- Text Substitution Học thử 3:36
-
Text Substitution Example 6:23
-
Text Substitution Demonstration 3:12
Chương 3 Preprocessing Directives 3 bài · 21 phút
-
Problem Of Duplicate Inclusion of Header Files 6:02
-
What are Pre-processing Directives ? 6:18
-
Solution to Duplicate Inclusion of Hdr files using Preprocessing Directives 8:33
Chương 4 Correct Way of Using Structures and Functions 5 bài · 28 phút
-
Structure Definitions and Use 4:19
- Function Declaration and Use Học thử 8:53
-
Recursive Dependency 8:49
-
Solution to Recursive Dependency 4:32
-
Summary 1:36
Chương 5 Quick Creation of Static and Dynamic Libraries 5 bài · 27 phút
-
Resuming with Doubly Linked List Library 5:55
-
Static and Dynamic Libraries - Quick Creation 8:50
-
Linking with Static Library 8:07
-
Linking with Dynamic Library 3:32
-
Summary 0:55
Chương 6 Four Stages of Compilation Process 5 bài · 25 phút
-
4 Stages of Compilation Process 6:15
-
Stage 1 of 4 - Preprocessing stage 4:52
-
Stage 2 of 4 - Compilation Stage 3:06
-
Stage 3 of 4 - Assembler Stage 4:32
-
Stage 4 of 4 - Linking Stage 6:16
Chương 7 Build Project using Makefiles 5 bài · 36 phút
-
Introducing Makefile 5:08
-
Makefile Analogy - Dependency Tree 5:35
-
Makefile Assignment - part1 5:41
-
Makefile Assignment - part2 11:15
-
Final Makefile 8:02
Chương 8 Programmable Libraries - Generics 10 bài · 48 phút
-
Introduction 4:54
-
Revisiting DLL 7:06
-
Problem Statement 2:49
-
Solution - Responsibility Delegation 10:59
-
Using Programmable DLL Library - Code Walk 3:28
-
Search Callback Summary 2:43
-
Comparison Callback 10:47
-
Comparison Callback Demo 3:02
-
Summary 1:42
-
Coding Assignment
Chương 9 Iterative Macros 8 bài · 32 phút
-
Getting Started 4:20
-
For loop Semantics 2:59
-
Iterative Macros For LinkedList 9:50
-
Iterative Macros for Binary Trees 4:58
-
Tree Iterators Prerequisites 3:42
-
Tree Iterators Implementation 5:09
-
Summary 1:30
-
Coding Assignment
Chương 10 Glue Based Data structures 12 bài · 49 phút
-
Introduction 3:35
-
Glthreads Definition 4:19
-
Difference - Traditional Vs Glue Based DLL 4:53
-
Structure Field Offset 7:37
-
Assignment
-
GLNode Insertion 3:41
-
API to insert a glthread node in a glthread list 3:27
-
GLThread Iteration 3:15
-
GLNode Removal 1:18
-
Code Walk - Demo 6:24
-
Traditional List Problems 5:39
-
GLThread Benefits 4:54
Chương 11 Opaque Pointers 5 bài · 18 phút
-
Introduction 2:33
-
Typical Library Design 3:06
-
Problem Statement 4:07
-
Solution Strategy 5:52
-
Conclusion 2:38
Chương 12 Bit Programming 10 bài · 54 phút
-
Introduction to Bit Programming 11:48
-
XOR Operator 7:57
-
Using Bits as Flags 11:22
-
Using Enums as Bits 2:39
-
Assignment on Bit Programming
-
Bit Pattern Matching 4:00
-
Bit Pattern Matching Steps 3:07
-
BitMaps 5:36
-
BitMap APIs and Implementation 7:44
-
Assignment on BitMaps
Chương 13 Machine Endianness 2 bài · 8 phút
-
Machine Endianness 6:19
-
Program to find Machine Endianness 1:55
Chương 14 TLV Based Communication 10 bài · 1 giờ 19 phút
-
TLVs Introduction 7:28
-
Why we need TLVs ? 12:26
-
Why we need TLVs - Another scenario 6:17
-
Understanding TLVs 10:38
-
TLV Addressing the problem of Heterogeneity 18:45
-
TLV Addressing the problem of Software Upgrade 5:24
-
Data Structure - STREAMS 8:45
-
TLV De-Serialization using STREAMS 9:03
-
Coding Assignment - on Streams
-
Coding Assignment - on TLVs
Chương 15 Working with Linux Posix Timers 7 bài · 41 phút
-
Agenda and Prerequisites 2:39
-
Timer Relevance 2:08
-
Timer Types 2:57
-
Posix APIs for Timers 2:10
-
Timer Design 7:00
-
Timer Creation Steps 9:44
-
Timer Implementation and Demo 14:15
Chương 16 Memory Layout of Linux Process 5 bài · 33 phút
-
Agenda 3:17
-
Virtual Memory Memory Basics 6:59
-
Memory Layout of Linux Process 10:15
-
Example : Memory Layout of Linux Process 8:53
-
Exercise on size command 3:29
Chương 17 Stack Memory Management 13 bài · 1 giờ 2 phút
-
Stack Memory Basics 5:39
-
Stack Memory Contents 8:01
-
Stack-Overflow and Prevention 3:16
-
Stack Memory Corruption 4:53
-
Procedure Call and Return - Getting Started 4:41
-
Common Cpu Registers 3:05
-
Procedure Call Mechanism 10:05
-
Purpose of Base Pointer register (ebp) 4:14
-
Formalizing Procedure Call Algorithm 3:56
-
Procedure Return - Goals 3:53
-
Procedure Return Explained - Step by Step 6:03
-
Formalizing Procedure Return Algorithm 4:23
-
Lab Session - Stack Memory Analysis
Chương 18 Heap Memory Management 12 bài · 1 giờ 1 phút
-
Heap Memory Management - Goals and Introduction 3:59
-
Malloc() - Quick Revision 8:49
-
Break pointer 2:31
-
Brk and sbrk system calls 5:47
-
Malloc Version 1.0 7:11
-
Problem Statement 3:39
-
Heap Memory Management Requirement 2:56
-
MetaBlock and DataBlock 6:18
-
Allocations and Deallocations 5:33
-
Block Splitting 6:06
-
Block Merging 3:45
-
Problem of Fragmentation 4:17
Chương 19 Concepts of Paging 26 bài · 2 giờ 5 phút
-
Introduction 3:35
-
Byte Addressable Memory 4:40
-
What is 32 bit Or 64 bit system ? 4:08
-
Bus System 4:57
-
CPU Generates Virtual Addresses 7:29
-
Data bus and Address Bus 10:33
-
Check your Understanding
-
Mapping of Virtual Address to Physical Address 6:13
-
Physical Pages and Frames 4:23
-
Page Swapping 2:52
-
Virtual Memory Pages 4:21
-
1:1 Mapping between Physical and Virtual Page 7:07
-
Virtual Address Composition 3:57
-
Page Table 6:36
-
Test your Understanding
-
Paging in Action 11:09
-
Test your Understanding
-
Multiple Process Scenario 2:30
-
Resolve External Fragmentation 2:19
-
Page Allocation to a Process - Part1 6:11
-
Page Allocation to a Process - Part2 5:53
-
Shared Physical Pages 10:09
-
Page tables Problems 2:05
-
Page Table Problem 1 - Large Page Table Size Matters 4:35
-
Page Table Problem 2 - Need for Contiguous Main Memory 3:05
-
Page Table Problem 3 - Page Table Hollowness 6:22
Chương 20 Multi Level Paging 4 bài · 22 phút
-
Introduction 5:28
-
Multi Level Paging In Action - Part1 7:50
-
Multi Level Paging In Action - Part2 8:31
-
Test your Understanding
Chương 21 Paging on Demand 3 bài · 14 phút
-
Problem Statement 4:28
-
Demand Paging Steps 6:19
-
Effective Access Time 2:47
Chương 22 Memory Management for Multi-threaded Processes 4 bài · 20 phút
-
Introduction 4:39
-
Virtual Memory Management 5:12
-
Page Table Management 8:03
-
Thread Termination 2:27
Chương 23 Bonus 1 bài · 1 phút
-
Bonus Lecture - Time to get some Candies !! 1:16
Requirment
-
Basic knowledge of Programming in C/C++ is required
-
Zeal and enthusiasm to learn and sharpen the skills
-
Good to have basic OS knowledge but not mandatory
Outcomes
-
Learn Advance Programming Concepts in C/C++
-
Develop and Integrate C/C++ Libraries
-
Automate Build Process using Makefile
-
Use of Function Pointers as Callbacks
-
Static and Dynamic Libraries and Linking
-
Compilation Process of a GCC Compiler
-
Organize the code into Header and Source files
-
Understanding Memory allocations, Heap Memory Management, Memory Leaks
-
Stack Memory, Stack overflow, Stack Corruption, Stack Registers
-
Paging Concepts and Page Tables
-
Concept of TLVs
0 Student
3 Courses
0 review