Programming Practice: C, C++ and Data Structures
Practise programming with C and C++ questions, output puzzles, data-structure exercises and worked solutions. Choose a topic below, make your own attempt, and then compare the explanation. You can read the material without an account.
Start with C or C++ fundamentals
- C practice questions and answers: arrays, operators, scope and common C mistakes. Pay attention to undefined behavior; not every program has one valid output.
- C++ practice questions and answers: strings, conversions, loops, value parameters and dynamic storage.
- C interview questions with explanations: use these to revise concepts after trying the beginner questions.
Build your data-structures foundation
If an explanation assumes a concept you have not learned, pause and work through the relevant tutorial:
- Introduction to data structures and algorithms: trace an algorithm and compare approaches.
- Arrays and indexing: follow how elements are accessed.
- Stacks and queues: practise their operations and ordering rules.
- Linked-list basics, insertion and deletion, and linked-list types: draw the pointer changes before writing code.
Try an output-prediction exercise
Open a set, hide the answer, and trace each statement on paper. Write down variable values and the exact output, including spaces. Then compare the explanation:
- Guess the output: series 2
- Guess the output: series 3
- Guess the output: tricky questions
- Guess the output: series 7
Move on to programming problems
- TCS CodeVita Season 9 Round 2, part 1 and part 2: past contest questions to work through at your own pace.
- CS Code programming contest 3 solutions: practise explaining an approach before looking at the implementation.
- Data-structure questions and explanations: check how well you understand the underlying operations.
A practical routine for each question
- Restate the problem and identify the inputs, outputs and constraints.
- Make an attempt before reading the solution. For a short program, trace it line by line.
- Run your own code locally with compiler warnings enabled. Read the C or C++ compilation notes if needed.
- Test an empty or smallest allowed input, repeated values and boundary cases where they apply.
- Compare the explanation, correct your attempt, and note the rule or algorithm you missed.
For a longer walkthrough, read a four-step process for solving coding problems. This page collects reading and practice material; it does not run or score submissions. New material appears as it is published, without a fixed daily question schedule.
