Skip to content

Instantly share code, notes, and snippets.

@timhtheos
Last active May 18, 2025 08:38
Show Gist options
  • Select an option

  • Save timhtheos/ee7ff799ae884835b4e53f74487dd704 to your computer and use it in GitHub Desktop.

Select an option

Save timhtheos/ee7ff799ae884835b4e53f74487dd704 to your computer and use it in GitHub Desktop.
<?php
$ch = curl_init('https://coderbyte.com/api/challenges/json/age-counting');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
print_r(json_decode($data, true));
?>
@timhtheos
Copy link
Author

timhtheos commented May 18, 2025

Problem Criteria
In the PHP file PHPAgeCounting.php, write a program to perform a GET request on the route https://coderbyte.com/api/challenges/json/age-counting which contains a data key and the values is a string which contains items in the format: key=STRING, age=INTEGER. Your goal is to count how many items exist that have an age equal to or greater than 50, and print this final value.

Example Input

{"data":"key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47"}

Example Output

2

Important Guidelines

  • Do not use ChatGPT, Gemini, or any other AI-based tools.
  • You may use plain Google Search.
  • Access to documentation sites like php.net, w3schools, and similar resources is allowed.
  • The test must be conducted via Microsoft Teams with your video camera on and screen sharing enabled.
  • The primary objective of this practical test is to assess the developer’s approach to problem-solving; successfully solving the problem is a bonus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment