Given an array, without using extra space, move all zeros to the end and no-zeros to the beginning. The function should return the number of non-zeros.
Ios Lead Interview Questions
3,241 ios lead interview questions shared by candidates
Given nested arrays, write an enumerator class such that next() returns the elements in sequential order, e.g.: [1,[4,3],6,[5,[1,0]]] -> 1, 4, 3, 6, 5, 1, 0 also implement allObjects for this class
Take in an Int array and move all the zeroes to the end in place. It doesn’t matter how the non-zero numbers are ordered. Preferably as efficient and as space efficient as possible. Example: Input : [ 3, 0, 2, 0, 0, 4, 1, 0 ] Accepted Output: [ 4, 2, 3, 1, 0, 0, 0, 0 ]
If you have a program that runs slow, how will you improve it to run faster?
1. Given a 3 array like below NSArray *a = [1,3,4,5]; NSArray *b = [-1,3,0,9]; NSArray *c = [0,31,32,22,6]; Find the elements from the three array which existing in atleast 2 arrays. Eg: [3, 0] Because 3 is presented in array a, b and 0 is presented in array b, c respectively. -(NSArray)find2ElementsAtleastPresentIn2Arrays:(NSArray*)aList b::(NSArray*)bList c::(NSArray*)cList{ // -- your code here. }
One question 3 of the interviewers asked me was "What was the most difficult thing you had to deal with.".
They asked a lot of iOS questions, and some general programming questions. The first question they asked was so obscure that I didn't even really understand it. I was probably dead from that point on. Another question was to figure out a way to combine three lists of items where an item would be placed in a destination array if it existed in any two of the source arrays.
The same list, back to inorder binary tree
The same usual customer service questions. Same sort of questions that are on the application
Giving array of words and user can input any letters. Write a function that returns all possible words that start with the input string. They are looking for optimum solution.
Viewing 1 - 10 interview questions