Pergunta de entrevista da empresa Ingenico

Write an optimized O(n) algorithm to find out if 2 values in an array adds up to a given target sum.