Simplest java solution using HashMap.
Assuming that the interviewer won\'t let us use any built-in string methods close to the problem statement, I came up with a solution using a hashmap. \n\nIdea 
Assuming that the interviewer won\'t let us use any built-in string methods close to the problem statement, I came up with a solution using a hashmap. \n\nIdea is, define a hash map with static key values given in the statement. And then, do as it says. Keep appending the characters, and as soon as you detect the htmlEntity, try to get the entity from text and see if it contains in the map, if yes, then add the corresponding character to the res, otherwise, append the entire htmlEntity found. \n\n```\npublic String entityParser(String text) {\n\tMap<String, Character> map = new HashMap<>();\n\tmap.put("&quot;", \'"\');\n\tmap.put("&apos;", \'\\\'\');\n\tmap.put("&amp;", \'&\');\n\tmap.put("&gt;", \'>\');\n\tmap.put("&lt;", \'<\');\n\tmap.put("&frasl;", \'/\');\n\n\tint readIdx = 0,\n\t\tn = text.length();\n\tStringBuilder sb = new StringBuilder();\n\twhile (readIdx < text.length()) {\n\t\tif (text.charAt(readIdx) == \'&\') {\n\t\t\tStringBuilder htmlEntity = new StringBuilder();\n\t\t\twhile (readIdx < n && text.charAt(readIdx) != \';\') {\n\t\t\t\thtmlEntity.append(text.charAt(readIdx));\n\t\t\t\t++readIdx;\n\t\t\t}\n\t\t\tif (readIdx < n) {\n\t\t\t\thtmlEntity.append(text.charAt(readIdx++));\n\t\t\t}\n\t\t\t// System.out.println(htmlEntity);\n\t\t\tif (map.containsKey(htmlEntity.toString())) {\n\t\t\t\tsb.append(map.get(htmlEntity.toString()));\n\n\t\t\t} else {\n\t\t\t\tsb.append(htmlEntity.toString());\n\n\t\t\t}\n\t\t} else {\n\t\t\tsb.append(text.charAt(readIdx++));\n\n\t\t}\n\t}\n\n\treturn sb.toString();\n\n}\n```
[]