Pergunta de entrevista da empresa Google

You are given two image files. How would you go about determining if they are the same image?

Resposta da entrevista

Sigiloso

6 de jul. de 2017

Two approaches: If you're wondering if it's the exact same file, you can do a hash (maybe using SHA1) on the files, and see if the hashes match. 2nd is to divide the image up into a grid, and evaluate the colors (or average color) in each of the grids. The more finer-grained grid you use, the longer the computation, but the closer you will get to knowing how similar the images are. Use a threshold to decide on match. This enables you to compare different sized images.