1.Given a string, write a function that return if it is Palindrome. This wasn't asked directly but from interviewer example i was need to understand that this function must ignore all spaces and special symbols. 2. Given an array, write a function that return true if any 3 elements of this array can sum to 0. My first solution was the simplest and far from best which result in O(n^3). Then interviewer asked me to improve to improve it to O(n^2). This give me a hint that i can use Hash to reduce complexity.
Software Engineer Apple Interview Questions
664,753 software engineer apple interview questions shared by candidates
Suppose we can translate numbers into characters: 1->a, 2->b, ...26->z given an integer, for example, 11223, output every translation of the number.
Add two binary numbers (Input as a string)
I got a few C++ questions, then a question on sorting algorithms then a brainteaser. The brainteaser went as follows: Three people are given hats. Each hat is either red or blue, chosen at random. Each person can see the other 2 hats, but not their own. They each must simultaneously either guess their own hat's color, or pass. No communication is allowed, although they can agree on a strategy ahead of time. What strategy will give them the best chances of at least one person guessing right, and nobody guessing wrong?
Develop an algorithm for finding the shortest distance between two words in a document. After the phone interview is over, take a few hours to develop a working example in C++ and send it to the manager.
Find the first index of the substring. Condition: Do not use java library function or regular expressions. And measure the performance of your implementation with the standard java library function. Examples: String 1: “abcdefg” String 2: “bcd” Should return 1 String 1: “abcdefg” String 2: “x” Should return -1
How would you use Yelp to find the number of businesses in the US?
Come out with an algorithm for getting the column number provided the column name in a excel sheet and vice versa. Excel has a naming convention of A,B..Z,AA,AB,AC..ZZ,AAA... This had to be converted to the column numbers. A will be 1 and AA will 27.. Also the algorithm to find the name provided column number.
Given a string with only ')' and '(' find if the string is complete or not. If the string is complete means that each open paranthesis should have a corresponding closed one. Eg: String s= "((()))()"- Complete String String s1=")()()()())))(()()()((" - Incomplete String
Given a string of an arithmetic expression, composed of numbers, '+' and '*', calculate the result - e.g. "2+4*5*7"
Viewing 71 - 80 interview questions