They are identical in certain situations.
Generally, that situation is a clarifying question.
"They had everything I wanted at the restuarant!"
If you respond with "such as?" or "like?", you are asking the same thing: asking the person to elaborate and give you specific examples.
One main difference is "like" has multiple usages, or at least can be used in multiple contexts, contexts where "such as" wouldn't make sense.
"I like sports," for example, couldn't be "I such as sports" lol