Topic — Add New » Posts Last Poster Freshness
Microsoft Interview Question for Software Engineer/Developer about Algorithms, Arrays 7 Aashish Barnwal 1 month

a is an array containing both odd and even integers.Now without any preprocessing,rearrange this array such that the odd elements are in the first half and even nos in second half.odd numbers must be descendingly sorted and even numbers ascending sorted.No preprocessing means that u cannot separate the odd and even nos first.plz post some ideas to solve this problem wit maximum efficiency.

Microsoft
Divide an array 5 Aashish Barnwal 1 month

Given an array of random real numbers sorted in descending order. Divide the array in 2 halves such that the sum of upper half is equal to or as close as possible to sum of lower half

arrays 2 kartik 1 month

an array having fixed size say 100 cotains only 0's and 1's in it.how to count number of 0's and 1's in a fastest and efficient manner ? help me out guzs

Oracle Interview Question for Software Engineer/Developer (Fresher) about Arrays 1 geek4u 1 month

write a code for matrix multiplication with all error checkings.

Oracle
Given an array shuffle all its contents randomly. 3 2 months

You may know its algorithm.. :) But code required (A Bit stupid point :D :D ) !!!
But still it is good one :) :)

Microsoft Interview Question for Software Engineer/Developer about Arrays 6 kartik 2 months

Program for intersection of two arrays

Microsoft
Array 2 kartik 2 months

Im having an unsorted array with negative positive and zero elements repeating any number of times.Could anybody suggest some solution to rearrange the elements in positive , 0 , negative order.

Ex: i/p: 2 2 -1 0 8 0 -9 6 2

o/p: 2 2 8 6 2 0 0 -1 -9

Directi Interview Question for Software Engineer/Developer (Fresher) about Arrays 2 laddoo 2 months

Write a function which takes 2 arrays- One array is the source array and the other array is the array of indices and delete all those elements present at the indices of the source array taking the indices from the second array.

directi
Question on Arrays 3 sharath_502 2 months

Im having an unsorted array of size n having repeated elements randomly.

Ex: 2 2 1 1 3 3 3 9 9 6 6 6 6...

The output array should : 6 6 6 6 3 3 3 2 2 1 1 3 3....

i.e based on the count of repetition the array elements should be ordered,highest count coming first and so on.If count of two elements are same then element appearing first in the input array should come first., i.e if input array contains 3 2 2 3 count of 2 and 3 is 2,then output should be 3 3 2 2.(since 3 appe...

Sort a stack 2 dheerajsharma1990 2 months

A stack with n elements and an empty stack is provided.
Return a stack with sorted values in minimum time complexity

Repetition of occurences 2 laddoo 2 months

Print each character and no. of consecutive repetitions of that character in a string
for eg. input: aabbcbaeeez
ouput : a2b2cbae3z

Worst case of insertion sort and bubble sort 3 k53 2 months

Best case of bubble sort and insertion sort occurs when input array in already sorted. For what kind of input array we get the worst case?

Microsoft Interview Question for Software Engineer/Developer about Arrays 7 Abhimanyu Vohra 2 months

Modified 2 color sort problem i.e. you are given an array of integers containing only 0s and 1s.You have to place all the 0s in even position and 1s in odd position. And if suppose, no. of 0s exceed no. of 1s or vice versa then keep them untouched. Do that in ONE PASS and without taking extra memory (modify the array in-place).

For Example :

Input Array: {0,1,1,0,1,0,1,0,1,1,1,0,0,1,0,1,1}
Output Array: {0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1}

Microsoft
Quick Sort in worst case O(nLogn) 3 gautam5669 2 months

We know that Quicksort runs in O(n^2) in the worst case. Suggest a partition approach that reduces worst case complexity to O(n log n).

Amazon Interview Question for Software Engineer/Developer (Fresher) about Arrays 7 nagesforyou 3 months

Given an array (length n), we need to find the subarray (length k) such that the sum of the first j elements of the subarray equals the sum of the remaining (k-j) elements of the subarray.
For e.g.
Array: 2,2,13,4,7,3,8,12,9,1,5
Output: 4,7,3,8,12,9,1 [4+7+3+8=12+9+1]
Could this be done with a complexity better than O(n^3)

Amazon
Amazon Interview Question for Software Engineer/Developer about Algorithms, Arrays 6 PsychoCoder 3 months

You are given n no. of lines in form of Ax + By = C, basically you are given A[i], b[i] and C[i] for line "i".
Lines are given in a way such that 0 <= x[i] <= 1 and y[i] < y[i+1] for same X.
Also, one point (x,y) is given too. Find out the two closest lines to the point such that the point is between them.
Given: n - no. of lines
a[i] b[i] c[i] - i th line.
X Y - Point
Output
A[i] B[i] C[i]
A[j] B[j] C[j]
such that the point X,Y i...

Amazon
Amazon Interview Question for Software Engineer/Developer about Arrays 3 PsychoCoder 3 months

Search a string in an N*N matrix.

Amazon