The testing process: Implementing code or fixing bugs in PHP.
Motivation: Basic familiarity with the programming language used on the job is a prerequisite for quickly getting up to speed.
The testing process: Serializing data structures and parsing serialized data.
Motivation: Familiarity with data serialization to and from formats such as XML and JSON is important as it is commonly used for interprocess communication.
A thesaurus contains words and synonyms for each word. Below is an example of a data structure that defines a thesaurus:
array("buy" => array("purchase"), "big" => array("great", "large"))
Implement the function getSynonyms, which accepts a word as a string and returns all synonyms for that word in JSON format, as in the example below.
For example, the call $thesaurus->getSynonyms("big") should return:
while a call with a word that doesn't have synonyms, like $thesaurus->getSynonyms("agelast") should return:
- Sample case: Wrong answer
- Word doesn't have synonyms: Wrong answer
- Word has synonyms: Wrong answer
- Word has unusual synonyms: Wrong answer