DOM challenges

Practice problem statements with input format, output format, constraints and solutions.

beginner

DOM overview challenge

Build a small solution that uses DOM overview in DOM and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

const concept = "DOM overview";
const task = { input: "sample", goal: "ship a useful feature" };
console.log(concept, task.goal);

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core dom overview pattern before polishing the final output.

Solution

const concept = "DOM overview solution";
const task = { input: "sample", goal: "ship a useful feature" };
console.log(concept, task.goal);
beginner

DOM setup challenge

Build a small solution that uses DOM setup in DOM and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

const concept = "DOM setup";
const task = { input: "sample", goal: "ship a useful feature" };
console.log(concept, task.goal);

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core dom setup pattern before polishing the final output.

Solution

const concept = "DOM setup solution";
const task = { input: "sample", goal: "ship a useful feature" };
console.log(concept, task.goal);