SuccessFactors

  www.successfactors.com
Work in HR? Unlock Free Profile

SuccessFactors Senior Software Engineer Interview Question

I interviewed in Bangalore (India) and was asked:
"There is Array A of size N, It has unsorted random int values. There is a Array B of size 2N, it has Sorted int values in first N locations, and the last N positions are empty. Write a program to copy all elements from first Array A into second Array B, such that the resulting Array B is Sorted. What is the complexity of solution you offered (Big O Notation)"
Add Tags [?]
Answer

Part of a Senior Software Engineer Interview Review - one of 49 SuccessFactors Interview Reviews

Answers & Comments

0
of 0
votes

Keep copying elements from Array A to Array B, and then moving elements around in Array B.(OR Try using a third Array C of size 2N to hold values).

It is easy to solve, but what is the best solution?

- Interview Candidate on Oct 1, 2010

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.