Darwinbox Interview Question

about dpp and graph and also floowed by tree and string