Construct a Problem Specification

What Is a Problem Specification?

Problem specification is the process of clearly defining a problem to ensure the development of an effective solution.

A well-structured problem specification outlines the problem’s scope, constraints, and expected outcomes.

Key Components of a Problem Specification

Component Description Avoid Better Practice
Problem Statement A concise description of the issue to solve and who it’s for. “Make it better.” “Given a list of words, return those that read the same forwards and backwards.”
Constraints & Limitations Operational limits (time, memory, data rules, platforms). “Do it fast.” “≤ 1 second for 1000 words; letters A–Z only; word length ≤ 50; case-insensitive.”
Objectives & Goals Measurable outcomes that define success. “Be accurate.” “Return palindromes in original order; 100% correct on provided tests.”
Input Specifications Exact types, formats, and examples of inputs. “Takes a list.” List[str]; e.g. ["racecar", "hello", "Level"].”
Output Specifications Exact type/format of outputs and edge-case behaviour. “Shows results.” List[str] of palindromes; if none, print ‘No palindromes’.”
Evaluation Criteria How you will verify correctness, performance, and UX. Use numbering, not bullets, for these. “Works as expected.” “Prompts user; validates non-empty input; ignores case; passes tests for empty list / no matches; early-exit on first match for search.”

Examples: Lists & Strings

Problem Statement

Given a list of words, identify which ones read the same forwards and backwards.

Constraints & Limitations

  • Words contain only alphabetic characters.
  • Comparison is case-insensitive.
  • Maximum list length: 1000 words; maximum word length: 50 characters.

Objectives & Goals

  • Return a list of palindromic words in their original order.

Input Specifications

  • A list or array of strings, e.g. ["racecar", "hello", "Level"].

Output Specifications

  • A new list containing only palindromic words, e.g. ["racecar", "Level"].

Evaluation Criteria

  1. System prompts the user to enter a list of words.
  2. Validates that the list is not empty; displays an error if it is.
  3. Ignores casing when checking for palindromes.
  4. Preserves original order of palindromes in output.
  5. Displays “No palindromes” when none are found.

 Key Takeaways

  • A problem specification defines the scope, constraints, and goals of a solution.
  • Core components include problem statement, constraints, objectives, input/output specs, and evaluation criteria.
  • Clear specifications ensure that development teams and stakeholders share the same understanding.