Ericsson interview question

Explain how traceroute and ping work.