Resure Technology interview question

Design an algorithm to check whether two words are synonyms.