Oracle Interview Question
308 Interview Reviews |
Back to all Oracle Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Development Engineer at Oracle:
Given array of n integers and given a number X, find all the unique pairs of elemens (a,b), whoose some is equal to X.
| Tags: | data structures See more , See less 8 |
See more for this Oracle Software Development Engineer Interview
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
1 of 2 people found this helpful
http://youtu.be/3VBjhiKUtmE
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up



1 of 1 people found this helpful
by Interview Candidate:
And K be the give sum
for i=0 to arr.length - 1 do
hash(arr[i]) = i // key is the element and value is its index.
end-for
for i=0 to arr.length - 1 do
if hash(K - arr[i]) != i // if K - ele exists and is different we found a pair
print "pair i , hash(K - arr[i]) has sum K"
end-if
end-for