On this page
This chapter teaches you to turn a task into steps a computer can follow. Below: the 2026-27 syllabus, then one original problem taken to tested Python.
What does the 2026-27 CBSE syllabus include?
The CBSE Class XI Computer Science curriculum for 2026-27 puts this chapter in Unit 2, "Computational Thinking and Programming -1". The unit carries 45 of the 70 theory marks, shared with all its Python chapters, so there is no separate figure for this chapter.
The curriculum lists the topics as the steps for problem-solving ("Analyzing the problem, developing an algorithm, coding, testing, and debugging"), representing algorithms with flowcharts and pseudocode, and decomposition. The NCERT chapter (Chapter 4, Reprint 2026-27) also covers verifying algorithms by dry run and comparing them by time and space. The curriculum line does not name those two, so ask your teacher how your school treats them.
What are the steps of problem solving?
The NCERT chapter describes four steps (NCERT, Chapter 4):
Analyse the problem: inputs, outputs and what the solution must do.
Develop an algorithm: a finite set of exact steps that solves the problem.
Code it in a high-level language, and document it. A compiler or interpreter then translates it (compiler vs interpreter, traced in C and Python).
Test and debug: try many inputs, fix errors, repeat.
A good algorithm, in the chapter's terms, has precision, uniqueness, finiteness, input and output. You can write it as a flowchart (rounded terminators for start and end, rectangles for processes, diamonds for decisions, parallelograms for input and output, arrows for flow) or as pseudocode with keywords such as INPUT, COMPUTE, PRINT, IF/ELSE and WHILE. Steps run in sequence, selection (a decision) or repetition (a loop).
Worked example: how long is your longest study streak?
Problem: you log your study minutes for N days. A day counts if you studied at least 45 minutes. Find the longest run of counting days in a row.
Analyse. Input: N, then minutes for each day. Output: the longest streak, in days. Process: compare each day with 45 and keep count.
Decompose. Four smaller problems: read the data; decide if a day counts; track the current streak; remember the best.
Algorithm (pseudocode).
INPUT N
SET streak = 0, best = 0, day = 1
WHILE day <= N, repeat steps 4 to 7
INPUT minutes
IF minutes >= 45 THEN streak = streak + 1 and COMPUTE best = MAX(best, streak)
ELSE streak = 0
day = day + 1, then go back to step 3
PRINT best
The flowchart at the top draws the same steps; the loop back is in red.
Code (Python 3). Lines 6 to 12 are indented inside the while loop; lines 8, 9 and 11 are indented once more.
n = int(input("Days: "))
streak = 0
best = 0
day = 1
while day <= n:
minutes = int(input("Minutes: "))
if minutes >= 45:
streak = streak + 1
best = max(best, streak)
else:
streak = 0
day = day + 1
print("Longest streak:", best, "days")
How do you test an algorithm with a dry run?
A dry run means following each step by hand for one input. Take seven days: 50, 20, 45, 60, 75, 30, 90.
Day 1, 50: streak 1, best 1
Day 2, 20: streak 0, best 1
Day 3, 45: streak 1, best 1 (45 counts: the test is >=)
Day 4, 60: streak 2, best 2
Day 5, 75: streak 3, best 3
Day 6, 30: streak 0, best 3
Day 7, 90: streak 1, best 3
The program also prints 3.
Now the debugging. Our first draft updated best only in the ELSE branch, when a streak broke, and printed 3 for the week above. Then we tried 10, 50, 55, 60: the streak of 3 runs to the last day and never breaks, so the draft printed 0. Moving the update into the IF branch fixed it, and the fixed program passed six hand-checked cases and 500 random ones.
Practice questions
The mark values are our suggestion, not CBSE's.
(1 mark) Which flowchart symbol would you use for "INPUT minutes"?
(2 marks) An algorithm's loop never increases its counter. Which characteristic of a good algorithm does it break? Explain.
(3 marks) Write pseudocode that reads N daily maximum temperatures and prints how many were above 35 degrees Celsius.
(4 marks) Dry run the streak algorithm for 60, 45, 50, 10, 50, then again with the test changed to minutes > 45. Give best both times.
(5 marks) Decompose a school library's book-return system into four sub-problems, with the input and output of each.
Answers: (1) a parallelogram; (4) best is 3 with >= 45, and 1 with > 45.
Next, see flow of control in Python: if, for and while, then practise on practical-file programs such as Armstrong and happy numbers.
Not sure which step you are stuck on? Fermi's AI tutor works out what you already know and builds a plan for the session.



