HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Computer Science
  2. /Algorithms, Programming and Logic
  3. /Algorithms and Problem-Solving

Algorithms and Problem-Solving

Computer Science · High School (9–10) · 3 courses, 30 worked problems, 30 practice questions

Before writing code, a good programmer plans. Decomposition breaks a problem into smaller parts, and abstraction keeps only the details that matter. The plan becomes an algorithm, written as a flowchart or in pseudocode. Standard methods solve common tasks: linear search, bubble sort, totalling, counting and finding the largest or smallest value. Validation checks that input is sensible, and verification checks that it was entered correctly. A trace table follows an algorithm step by step to find its output or its errors. Testing with normal, abnormal, extreme and boundary data shows whether it works.

With practice you will be able to

  • Decompose a problem into inputs, processes and outputs
  • Complete a trace table for an algorithm
  • Choose normal, extreme and abnormal test data for a program

On the syllabus of

  • IGCSE

Lessons

  • Planning a Program: Life Cycle, Decomposition and FlowchartsWhy does a programmer often go back a stage? How do you split a big system into parts?High School (9–10)
  • Pseudocode, Trace Tables and TestingCan you run a program without a computer? Why test a program with wrong data on purpose?High School (9–10)
  • Standard Algorithms: Totals, Searching, Sorting and ValidationHow does a bubble sort put a list in order? Why should a program never trust what you type?High School (9–10)

Practice questions

Choose an answer, then check it. Each one shows a full explanation.

In which stage of the program development life cycle does a programmer test each module straight after writing it, correct it and test it again?

Which flowchart symbol is used for a step such as Speed > 70? that has a Yes exit and a No exit?

A bus app stores the route number and the time the bus reaches each stop. It does not store the colour of the bus or the name of the driver. What is this an example of?

Think of a smart heating controller as four groups: what comes in, what is worked out, what goes out and what is kept for later. Which item is kept for later (storage)?

A structure diagram for a quiz game has the top box Quiz game and three sub-systems below it. Set up splits into Load questions and Choose a level. Play splits into Ask a question, Check the answer and Update score. Finish splits into Show the score and Save best score. The diagram shows exactly this. How many boxes are on the lowest level?

The flowchart sets Value to 111 and Count to 000. It then multiplies Value by 333 and adds 111 to Count, and repeats these two steps until the decision Value > 50? is Yes. It then outputs Count and Value. The diagram shows these steps. What is output?

A teacher finds this algorithm in an old program. Which sentence best states what it does? Below ← 0 FOR Index ← 1 TO 10 INPUT Number IF Number < 0 THEN Below ← Below + 1 ENDIF NEXT Index OUTPUT Below

The flowchart inputs Mark. The first decision is Mark >= 50?, and its No exit outputs "Fail". Its Yes exit leads to a second decision Mark >= 80?, whose Yes exit outputs "Merit" and whose No exit outputs "Pass". The diagram shows this. Which input gives the output "Pass"?

The flowchart that adds numbers until a 000 is input (Total starts at 000; each number that is not 000 is added; then Total is output) must also count how many numbers were added. Which change does this correctly?

A program for a sports club is in the testing stage. The testers find that the club wanted junior members to pay half price, but nobody wrote this down. Which stage should the team go back to first?

All 30 practice questions on Algorithms and Problem-Solving →

Worked problems

Each one has a hint, the key idea and a full worked solution.

  • A team is making a program that lets pupils order lunch from the school canteen before the morning…Easy
  • In the analysis stage of the cinema ticket program, the manager adds a new requirement: a group of…Medium
  • A programmer builds a program that works out a pupil's average mark from five tests…Medium
  • A school gives every pupil a card for the canteen…Medium
  • A structure diagram for a home weather station has the top box "Weather station"…Easy
  • A program plans train journeys between the towns of a country…Medium
  • A flowchart works like this. Start. Set Big to 0 and Loops to 0…Medium
  • A door lock asks for a password until the right one, Open, is typed…Hard
  • A flowchart inputs two numbers, A and B…Easy
  • This is the kind of long scenario question that ends Paper 2…Hard
  • A garden centre sells turf by the square metre…Easy
  • A sports watch records the length of a run in minutes…Medium

All 30 worked problems on Algorithms and Problem-Solving →

Python labs

  • Write a test plan that finds an error
  • The standard methods by hand
  • Search, sort and check
  • Split a ticket program into sub-tasks
  • From flowchart to Python
  • Pseudocode into Python

Related topics

  • Algorithms, Programming and Logic
  • Databases and SQL
  • Boolean Logic
  • Programming