Coding Practice Problems
Computer ScienceBeginner

Beginner Coding Practice Problems in Plain Language

Solve short programming problems that practice loops, arrays and string handling, with hints, sample inputs and expected outputs for each task.

Core Concepts

Read Input & Output Specs

Before coding, trace two sample inputs by hand—including an empty string or single-element array.

Accumulator Pattern

Initialize a variable (total = 0 or result = []) before a loop, update it each iteration, and return it afterward.

Two-Pointer Checks

Checking palindromes or reversing arrays takes O(n) time with one index at the start and one at the end.

Break Into Helpers

Write a small helper function for each sub-task so bugs are easy to isolate.

Self-Check Practice

1. Problem: Count vowels in 'education'. What is the expected output?

Show worked answer

5 (e, u, a, i, o).

2. Problem: Given [4, 9, 2, 7], find the maximum without built-in max(). What should 'best' initialize to?

Show worked answer

The first element of the array (4), NOT 0—initializing to 0 fails on all-negative arrays.

Study Notes

  • Write plain-English pseudocode steps before typing syntax.
  • Always test boundary values: 0, 1, negative numbers, and duplicate entries.