Skip to content
Related Articles

Related Articles

Amazon Interview Question
  • Difficulty Level : Basic
  • Last Updated : 29 Apr, 2019

Round 1:

There is an unsorted array of size n.

Given a key k find m nearest elements to k.

Example

Array :   -10, -50, 20, 17, 80.



key k :20

m : 2

Answer 17, -10.

Solution : Find k closest numbers in an unsorted array

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.

My Personal Notes arrow_drop_up
Recommended Articles
Page :