Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👶➡️👩‍💻 C Programming — 30 Days, 120 Questions (Explained Like You're 5)

Compile all C programs Language Questions Level

Made for someone who has never written a line of code. 🧸 Every idea is explained like you're 5 — no jargon left unexplained, a picture (diagram) for each concept, a real-life analogy, a step-by-step build, a dry-run table, and common mistakes to avoid.

These are the classic placement / campus-interview questions asked by TCS, Infosys, Wipro, Amazon, Microsoft, Adobe, Accenture, Cognizant, Capgemini, Deloitte & Paytm — organized as a 30-day self-learning plan (120 questions). All code is in the C language.


🗺️ How to use this repo (reading order)

  1. 📖 Start with the Concepts Primer — what is a program, a variable, a loop, an array, a function, recursion, ASCII, a struct… Read this first if you've never coded.
  2. 📅 Open a day's lesson in docs/ — each day teaches 4 questions the explain-like-I'm-5 way: analogy → concepts → plan → diagram → step-by-step build → full program → dry run → pitfalls → interview tip.
  3. 💻 Run the code in src/ — from Day 15 onward, every question is also a standalone, compilable .c file you can build and run yourself.

💡 New to all this? Read 00_concepts_primer.md, then go day by day. Already know the basics? Jump straight to Day 13 (arrays) or Day 15 (where the runnable code starts).


📚 The 30-Day Map

Lessons (markdown explainers) exist for all 30 days / 120 questions. Standalone runnable C files start at Day 15 (the “💻 Code” column).

Day Topic you'll learn Qs Lesson 💻 Code
1 First loops: counting, %, / on a number Q1–Q4 day01 —
2 Pulling a number apart digit by digit Q5–Q8 day02 —
3 Divisibility, primes, GCD & LCM Q9–Q12 day03 —
4 Fibonacci & Armstrong numbers Q13–Q16 day04 —
5 Special numbers & factors Q17–Q20 day05 —
6 Number systems & bits (binary) Q21–Q24 day06 —
7 Recursion (a function that calls itself) Q25–Q28 day07 —
8 Nested loops & patterns (1) Q29–Q32 day08 —
9 Patterns (2): reverse & hollow Q33–Q36 day09 —
10 Pyramids (centered patterns) Q37–Q40 day10 —
11 Functions (1): your own reusable blocks Q41–Q44 day11 —
12 Functions (2): wrapping earlier logic Q45–Q48 day12 —
13 Arrays (1): a row of boxes Q49–Q52 day13 —
14 Arrays (2): searching & frequencies Q53–Q56 day14 —
15 Arrays (3): rearranging elements Q57–Q60 day15 src/day15
16 Arrays (4): missing numbers, pairs Q61–Q64 day16 src/day16
17 Two arrays: merge, union, intersection Q65–Q68 day17 src/day17
18 Sorting & searching Q69–Q72 day18 src/day18
19 Matrices (1): a grid of numbers Q73–Q76 day19 src/day19
20 Matrices (2): multiply, symmetric, sums Q77–Q80 day20 src/day20
21 Strings (1): text is an array of chars Q81–Q84 day21 src/day21
22 Strings (2): palindromes, words, frequency Q85–Q88 day22 src/day22
23 Strings (3): repeating chars & anagrams Q89–Q92 day23 src/day23
24 Strings (4): rotation, compression, cleaning Q93–Q96 day24 src/day24
25 Mixing arrays & strings Q97–Q100 day25 src/day25
26 Mini apps (1): menus, conditions & loops Q101–Q104 day26 src/day26
27 Mini apps (2): records with structs Q105–Q108 day27 src/day27
28 Mini apps (3): bigger menu-driven systems Q109–Q112 day28 src/day28
29 Mini apps (4): menu-driven toolkits Q113–Q116 day29 src/day29
30 Capstone mini projects Q117–Q120 day30 src/day30

🧠 Every lesson follows the same kid-friendly recipe

For each question you get:

  1. What is it asking? — the problem in plain words + a tiny example.
  2. Real-life analogy 💡 — relate it to something you already know.
  3. New ideas you'll meet here — every concept named & explained in one line.
  4. The plan (in human words) — the logic before any code.
  5. Diagram — a Mermaid flowchart (+ ASCII box pictures for arrays/strings/matrices).
  6. Build it step by step — the program grows in small pieces, with output after each step.
  7. Full program — the complete, compilable C code.
  8. Dry run — a trace table following one example line by line.
  9. Sample input / output — a real run.
  10. Watch out! ⚠️ — common beginner mistakes.
  11. Speed (complexity) — Big-O in kid words.
  12. Interview tip 🎯.

💻 How to compile & run the C programs

You need a C compiler (gcc). Then, for any file under src/:

# Compile one program
gcc -std=c11 -Wall -Wextra -o prog src/day15/q57_reverse_array.c -lm

# Run it
./prog          # on Windows:  prog.exe

Compile every program at once (Linux/macOS/Git-Bash):

bash scripts/compile_all.sh

✅ Every .c file in this repo is automatically compiled by GitHub Actions (see the badge at the top) with gcc -std=c11 -Wall -Wextra — so if the badge is green, all programs build cleanly.

Don't have a compiler installed?


🗂️ Repository layout

c-programming-placement-prep/
├── README.md                 ← you are here
├── 00_concepts_primer.md     ← read this FIRST (all fundamentals)
├── docs/                     ← 30 day-by-day lessons (all 120 questions)
│   ├── day01.md ... day30.md
├── src/                      ← runnable C programs (Day 15 → Day 30)
│   ├── day15/ ... day30/
│   └── (one qNN_name.c per question)
├── scripts/compile_all.sh    ← compile every program at once
└── .github/workflows/        ← CI that compiles all C files on every push

🏢 Which companies ask these?

Pattern of company Typical questions here
TCS, Infosys, Wipro numbers, loops, patterns, functions, matrices
Amazon, Deloitte, Capgemini arrays, searching, sorting, merging
Microsoft, Adobe, Paytm strings, characters, anagrams
TCS, Accenture, Cognizant mini projects & menu-driven systems

(Each lesson lists the exact companies for that question.)


🙌 Tips for absolute beginners

  • Don't rush. Do 4 questions a day — that's the whole point of the 30-day plan.
  • Type the code yourself (don't copy-paste). Your fingers learn too.
  • If a line confuses you, open the Concepts Primer and re-read that idea.
  • Run the program, then change one thing and predict what happens. That's how you really learn.

“The expert in anything was once a beginner.” You've got this. 💪


📄 License

Released under the MIT License — free to use, learn from, and share.

About

Learn C from zero: 120 placement-interview questions (TCS/Infosys/Wipro/Amazon/Microsoft) as a 30-day, explain-like-I'm-5 course with diagrams, dry runs and 64 runnable programs.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages