Find two integers from an unordered list to sum to the input This is a Google interview question, see here for a youtube link.
The task:
Find 2 integers from an unordered list that sum to a given integer.

Given an unordered list of integers, find 2 integers that sum
to a given value, print these 2 integers, and indicate success (exit 0). They don't need to be any particular numbers (i.e. the first 2 integers summing to the right number), any pair that sums to the value will work.
an integer is positive and greater than zero.
a list of integers can be in any data structure including a file of
integers - one integer per line.
if no integers can be found, indicate a failure (exit 1).
two integers at different positions in list must be returned. (i.e. you can't return the same number from the same position twice)

(Note: in the video, these are not exactly the requirements. The 'interviewer' changed his multiple times.)
eg.
sum2 8 &lt;&lt;EOF
1
7
4
6
5
3
8
2
EOF

Prints 3 and 5 and exit status is 0.
Note that in this 1,7 and 2,6 would also be allowed results.
sum2 8 &lt;&lt;EOF
1
2
3
4

Returns exit status 1 since no possible combo. 4,4 isn't allowed, per rule 5.
Bash, 84 bytes
My implementation of (roughly) Google's engineer's solution but using bash and an input stream - not my solution, so this does not count.
while read V;do((V&lt;$1))&amp;&amp;{ ((T=R[V]))&amp;&amp;echo $T $V&amp;&amp;exit;((R[$1-V]=V));};done;exit 1

Method
while we can read integer V from input stream
if less than target $1 then
if already seen $1-V then print $1-V and V and exit 0
(else) save candidate for input $1-V
exit 1