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.
- 📖 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.
- 📅 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. - 💻 Run the code in
src/— from Day 15 onward, every question is also a standalone, compilable.cfile 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).
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 |
For each question you get:
- What is it asking? — the problem in plain words + a tiny example.
- Real-life analogy 💡 — relate it to something you already know.
- New ideas you'll meet here — every concept named & explained in one line.
- The plan (in human words) — the logic before any code.
- Diagram — a Mermaid flowchart (+ ASCII box pictures for arrays/strings/matrices).
- Build it step by step — the program grows in small pieces, with output after each step.
- Full program — the complete, compilable C code.
- Dry run — a trace table following one example line by line.
- Sample input / output — a real run.
- Watch out!
⚠️ — common beginner mistakes. - Speed (complexity) — Big-O in kid words.
- Interview tip 🎯.
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.exeCompile every program at once (Linux/macOS/Git-Bash):
bash scripts/compile_all.sh✅ Every
.cfile in this repo is automatically compiled by GitHub Actions (see the badge at the top) withgcc -std=c11 -Wall -Wextra— so if the badge is green, all programs build cleanly.
- Windows: install MinGW-w64 or run
scoop install gcc. - Online (zero install): paste any program into onlinegdb.com or programiz.com.
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
| 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.)
- 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. 💪
Released under the MIT License — free to use, learn from, and share.