Pregunta de entrevista de Google

Write a function for -- Given a URL which has url-encoded name-values and a variable, return the value for it. Now modify the function to handle when the name appears multiple times.