Arrays Interview Questions
- 2of 2 votes
Answerssort an array of 0's and 1's in a most efficient way.
- mahi December 23, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 1of 1 vote
AnswersWrite a program to remove the duplicates from a list of integers . Write the test cases
- emma December 22, 2009| Report Duplicate | Flag | PURGE
Sonoa Systems Testing / Quality Assurance Arrays Testing - 1of 1 vote
AnswersWrite code for binary search
- emma December 22, 2009| Report Duplicate | Flag | PURGE
RelQ Software Company Limited Testing / Quality Assurance Arrays - 1of 1 vote
AnswersFind the intersection of 2 sorted arrays.
- duskandawn December 21, 2009
Give all test cases to test| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Arrays - 0of 0 votes
AnswersYou have a string of words (with spaces in it).
- Aatish December 19, 2009
You also are given a character (say c).
Remove all the words in the string if those words start with 'c'.
e.g. "HELLO WORLD HAT" and say c='H'
then result should be "WORLD"| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 1of 1 vote
AnswersGiven an array of any length holding integers (a buffer of bytes), write an algorithm to return the first unique element (ie not repeated in rest of the array).
- Murtuza Husain December 15, 2009| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm Arrays - 0of 0 votes
AnswersGiven an n X n array with rows sorted and cols sorted, find the number of negative elements in most efficient way
- Anonymous December 13, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 1of 1 vote
AnswersSort a huge list of numbers ,each of which is of a fixed size,in O(n)time
- random December 05, 2009| Report Duplicate | Flag | PURGE
Software Engineer / Developer Arrays - 1of 1 vote
AnswersWrite a function to add an array of numbers.
- June December 03, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Application / UI Design Arrays C C++ Coding - 0of 0 votes
Answersarray1 :4,1,6,2,8,9,5,3,2,9,8,4,6
- t2 November 23, 2009
array2 :6,1,2,9,8
second array contains elements which are in first array in consequetive locations but may be in any order.Find their starting and ending indexes in array1 most efficiently.
(Be careful of duplicate numbers).| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 1of 1 vote
AnswersHow do you implement a 2D array dynamically in C? Get the row and coumn numbers as input from the user
- Anonymous November 22, 2009| Report Duplicate | Flag | PURGE
Cisco Systems Arrays - 1of 1 vote
AnswersGiven a monochrome display in a one dimensional array, turn the lit on at the co-ordinates (x,y)
- Ani November 20, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Arrays - 0of 0 votes
AnswersWrite a function that takes an array of five integers, each of which is between 1 and 10, and returns the number of combinations of those integers that sum to 15. For example, calling the function with the array [1, 2, 3, 4, 5] should return 1, while calling it with [5, 5, 10, 2, 3] should return 4 (5 + 10, 5 + 10, 5 + 5 + 2 + 3, 10 + 2 + 3). You may assume that the input has already been validated. Show how you would test this function
- Sudhakar November 13, 2009
Asking help to provide both recursive and non-recursive solution.| Report Duplicate | Flag | PURGE
Software Engineer in Test Arrays - 4of 4 votes
AnswersFind the median of 2 sorted arrays
- Partha November 10, 2009| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Arrays - 1of 1 vote
AnswersGiven a array of 0's,1's and 2's arrange in a way that all 0's come first, then 1's then 2's.
- Vaishnavi November 10, 2009
ANS: Arrays.sort(array) (Java)
Basically, sort the elements in any prog lang.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Arrays - 2of 2 votes
Answersfind the longest palindrome in a string?
- handiaya November 09, 2009| Report Duplicate | Flag | PURGE
Microsoft Amazon Software Engineer / Developer Algorithm Arrays C++ Coding String Manipulation C - 1of 1 vote
AnswersGiven an array of 999 distinct integers ranging from 1 to 1000 including. Find which number is missing. Restrictions: loop over the array only once, can't allocate an additional array.
- Garry November 06, 2009| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Arrays - 1of 1 vote
AnswersWhich of the following will not add john to the users array?
- Annonymous.... October 29, 2009
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer Arrays - 0of 0 votes
AnswersGiven program to write the Max product of the three numbers for a given array of size N.
- pavan October 13, 2009| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Arrays - 0of 0 votes
AnswersWrite a method fill up an array of size n - and returns the array to the caller - with the following conditions
- bin October 12, 2009
1. the numbers shud be between 0 to n-1
2. no repeated numbers
3. the method should have a deterministic time to fill the arrays
4. arrays returned from the method should have low-correlation factor| Report Duplicate | Flag | PURGE
Symantec Software Engineer / Developer Arrays - 2of 2 votes
AnswersGiven 2 sorted array print their intersection.
- morpheus September 26, 2009| Report Duplicate | Flag | PURGE
Google Software Engineer in Test Arrays - 1of 1 vote
AnswersHaving an int array, which size is infinite (no way to find out), how do you do a binary search?
- green September 08, 2009| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Arrays - 1of 1 vote
Answersyou have an array of n integers, how would you find the integer pairs which sum to m? complexity?
- gs2005 September 08, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Arrays - 0of 0 votes
AnswersIs there any algorithm using comparisons that check array duplication in O(n) time limit? i.e., Suppose we have a array of type double. Then I need a function like this
bool has_duplicate(double *arr, int len)
that works in O(n) time in the worst case and checks whether it has to equal elements or not.
- LLOLer September 08, 2009| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Arrays - 0of 0 votes
AnswersA,B and C are one-dimensional arrays of size 100,50, and 200 respectively. Construct a program flowchart and corresponding pseudocode for an algorithm to store the first 100 numbers (1,2,3,4,5,..100) into array A, the first 50 positive odd numbers (1,3,5,7,..) into array B, and reciprocal of each position [C(5)=1/5] into array C. After all the arrays have been defined, output each array. Notice that no input is required. Be sure to plan a well-structured, modular program.
- victoria August 11, 2009 in United States| Report Duplicate | Flag | PURGE
Software Engineer / Developer Arrays - 0of 0 votes
AnswersTo find the sixth largest number in the array without changing the array and without taking extra o(n) space and in o(n) time complexity.
- ankit gupta August 07, 2009| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer Arrays