Android Engineer Interview Questions
- 1of 1 vote
AnswersAdd two numbers represented as LinkedList (not LeetCode 445 which uses ListNode)
- KelvinLong8897 November 17, 2018 in United States
e.g
inputs: '5'->'6'->'3'
'8'->'4'->'2'
output: '1'->'4'->'0'->'5'
method signature:
LinkedList<Integer> sumList(LinkedList<Integer> l1, LinkedList<Integer> l2)| Report Duplicate | Flag | PURGE
Facebook Android Engineer Algorithm - 1of 1 vote
AnswersGiven a binary tree, where each node represents an integer, find the max value of path sum.
- LeetCoder May 07, 2018 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Trees and Graphs - 1of 1 vote
AnswersMove[inplace] the non zero elements at the one end(end of array) and return the numbers of non zero elements in output array
- rituraj.raj March 28, 2018 in India for London office
Solution : https://www.geeksforgeeks.org/move-zeroes-end-array/| Report Duplicate | Flag | PURGE
Facebook Android Engineer - 0of 2 votes
Answerwhat is UI/Main Thread in android.
- rituraj.raj March 28, 2018 in India for London office
when you can use Thread over Service| Report Duplicate | Flag | PURGE
Facebook Android Engineer - 0of 0 votes
AnswerWhy facebook?
- androidenthusiast March 12, 2018 in United States
What was the biggest technical problem that you solved?
Do you have any apps on google play?
Give me a scenario where the requirements were ambiguous, what did you do?| Report Duplicate | Flag | PURGE
Facebook Android Engineer Behavioral - 0of 0 votes
AnswersDesign Instagram like app end to end
- androidenthusiast March 12, 2018 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer design - 0of 0 votes
AnswersGiven a string "L*&EVe)))l", write a method which will determine if the input is a palindrome. Ignore all special characters. Uppercase/lowercase should be considered as same.
- androidenthusiast March 12, 2018 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Java - 0of 0 votes
AnswersImagine a room full of people, with only 1 celebrity in the room. Celebrity is defined as a person who does not know anyone, but everyone knows him/her. Write a method who will take array of people and a person as input and return boolean if the person is a celebrity or not.
- androidenthusiast March 12, 2018 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Java - 1of 1 vote
AnswerSuppose there is a map with N bikes on it and now we have N individuals,
- ajay.raj February 01, 2018 in United States
Design an algorithm so that everyone can get the bike in the shortest distance| Report Duplicate | Flag | PURGE
Google Android Engineer - 0of 0 votes
AnswersYou have a non empty binary array with value 0 and 1. You can flip either 0 or 1 bit of array to make the consecutive element same.You have to return the count of consecutive number with same digit.
Input : [ 1,0,1,0,0,0]
Output : 4
if you flip the value of 1st index to 1, you have 2 consecutive 1 and 2 consecutive 0 so total 4.
input : [0,0,0,0]
output : 3
input : [0]
output 1
there is bug in below code which i couldn't find it.
- sandeepmnit35 January 09, 2018 in Indiaclass Solution { int solution(int[] A) { int n = A.length; int result = 0; for (int i = 0; i < n - 1; i++) { if (A[i] == A[i + 1]) result = result + 1; } int r = 0; for (int i = 0; i < n; i++) { int count = 0; if (i > 0) { if (A[i - 1] != A[i]) count = count + 1; else count = count - 1; } if (i < n - 1) { if (A[i + 1] != A[i]) count = count + 1; else count = count - 1; } r = Math.max(r, count); } return result + r; } }
| Report Duplicate | Flag | PURGE
Amdocs Android Engineer Arrays - 1of 1 vote
AnswersGiven a Map (representing an old phone key number and possible letters present there) and a sequence of keys return all possible combinations of strings that are possible to produce.
Map<String, String[]> map = new HashMap<String, String[]>(); map.put("1", new String[] { "a", "b", "c" }); map.put("2", new String[] { "c", "d", "e" }); map.put("3", new String[] { "f", "g", "h" }); String in = "12"; List<String> mix(String in, Map<String, String[]> map)
The result for "1,2" should be [ac, bc, cc, ad, bd, cd, ae, be, ce]
- Bruno November 09, 2017 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Java - 0of 0 votes
AnswersGiven a linked list with next and random pointer, deepcopy the linked list and return new head.
- me.samyakjain November 03, 2017 in United States
Node {
char val,
Node next,
Node random }
A {
val: ’a’
next: D
random: G}
D {
val: ’d’
next: G
random: A}
G {
val: ’g’
next: null
random: D}
-----------
| |
| V
A -> D -> G -> null
-------------
| |
| V
A' -> D' -> G' -> null| Report Duplicate | Flag | PURGE
Facebook Android Engineer Algorithm - 0of 0 votes
AnswersExplain in detail about your favourite android api.
- me.samyakjain November 03, 2017 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Android - 2of 2 votes
AnswersI get a chance to talk to Facebook software engineer during my android engineer interview. He asked me couple of question about native android like diff between views and fragment, mutable and immutable string, diff between string builder and string and a programming question convert int into words.
- Helper Guide September 08, 2017 in UK| Report Duplicate | Flag | PURGE
Facebook Android Engineer Android - 1of 1 vote
AnswersI got my interview yesterday and the problem they asked me was: Giving a method intToEnglish that receives an int as a parameter, how do you return its representation in english words. The number can be of any size but no more than around 2 billion since the parameter is an int 2ˆ32
- jorgevalbuena56 February 08, 2017 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Algorithm - 0of 0 votes
AnswersGiven an Array of N elements and Integer K, write a function that returns true if the sum of any 2 elements of Array is K, false otherwise.
- anonymus January 19, 2017 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Algorithm - 0of 0 votes
AnswersGiven the linked list is sorted, implement a method for insert and element in such a way that the list remain sorted.
- JP Ventura November 07, 2016 in Brazil| Report Duplicate | Flag | PURGE
Motorola Android Engineer - 0of 0 votes
AnswersImplement a linked list and all its basic operations (add, delete, remove and insert)
- JP Ventura November 07, 2016 in Brazil| Report Duplicate | Flag | PURGE
Motorola Android Engineer Linked Lists - 0of 0 votes
AnswersYou are given an integer N. Write a code to calculate 1! - 2! + 3! ... up to N terms.
- eduandabhi August 15, 2016 in India| Report Duplicate | Flag | PURGE
Cognzant Technology Solutions Android Engineer - 1of 1 vote
AnswersYou are given a function F6() which return 1,2,3,4,5,6 randomly with equal probability. Implement a new function F12() which returns 1 to 12 randomly with equal probability using F6().
- eduandabhi August 15, 2016 in India| Report Duplicate | Flag | PURGE
Cognzant Technology Solutions Android Engineer - 0of 0 votes
AnswersGiven an arithmetic expression, write a program to find the value of the expression. Only binary operations that are allowed are +,-,*,/. Also assume that all parentheses are well matched.
- khushbuparakh July 03, 2016 in India
Note that the use of eval() is forbidden
Input format :There is a single positive integer T on the first line of input . It stands for the number of expressions to follow.
Next T lines followed by expression
Output format : For each expression print the value of expression
3
19 + 12 / 4 - ((4 - 7) * 3 / 1)
1 + (2 - 3) * 4 + 5 - 6 * 8 - (18 * 12 * 13) - (11 / (5 + 2 + 4))
((2 + 4) / 3 - 2 + 1)
Output:
31
-2855
1| Report Duplicate | Flag | PURGE
Amazon Android Engineer Math & Computation - 0of 0 votes
AnswersWrite a method given a string with unbalanced parenthesis, the output should return a string with balanced parenthesis.
- AndroidFan June 26, 2016 in United States
Ex: (a(b(c)de should change to (a(b(c)d)e)| Report Duplicate | Flag | PURGE
Android Engineer Algorithm - 0of 0 votes
AnswersTell me about one Android API that you had difficulty using in a project and how did you resolve that Issue.
- AndroidFan June 26, 2016 in United States| Report Duplicate | Flag | PURGE
Android Engineer Android - 0of 0 votes
AnswersFind the uncommon elements from 2 lists.
- shivamdev31 May 29, 2016 in India
I/P :
List 1 : 1, 2, 3, 4, 5
List 2 : 3, 4, 5, 6, 7
O/P : 1, 2, 6, 7
I/P :
List 1 : 1, 2, 3, 1, 5
List 2 : 3, 4, 5, 6, 7
O/P : 1, 1, 2, 6, 7
Most probably using space O(n)| Report Duplicate | Flag | PURGE
Android Engineer Algorithm - 2of 2 votes
AnswersA museum was represented by a square matrix that was filled with O, G, and W where O represented open space G represented guards, and W represented walls. Write a function that accepts the square matrix and returns another square matrix where all of the O's in the matrix are replaced with the number of how many spaces they are away from a guard, without being able to go through any walls.
- fire May 17, 2016 in United States| Report Duplicate | Flag | PURGE
Facebook Android Engineer Algorithm - 1of 1 vote
AnswersInteger Array Ques:
- cdude September 01, 2015 in United States
Given an integer array of variable length like so [9, 8, 8, 3] where each item in array could be 0 to 9, write a function that would take would interpret the array [9, 8, 8, 3] as a number 9883 and increment it by 1. The return of the function would be an integer array containing the addition like so [9,8,8,4]. No zeros in the first position like [0,1,2,3]. I initially suggested a possible solution of process to convert the integer array to String then convert to Integer or Long and then do the addition of 1 and then convert it back to integer array. That is not allowed when the interviewer change the ques. to not allow that.| Report Duplicate | Flag | PURGE
Google Android Engineer Arrays - 0of 0 votes
Answertower Of Hanoi using priority queue
- amit April 02, 2015 in India| Report Duplicate | Flag | PURGE
Motorola Android Engineer C++ - 6of 6 votes
AnswerPhone Interview with Collabedit.
- Sagar Shah February 11, 2015 in United States
/** Compute the value of an expression in Reverse Polish Notation. Supported operators are "+", "-", "*" and "/".
* Reverse Polish is a postfix mathematical notation in which each operator immediately follows its operands.
* Each operand may be a number or another expression.
* For example, 3 + 4 in Reverse Polish is 3 4 + and 2 * (4 + 1) would be written as 4 1 + 2 * or 2 4 1 + *
*
* @param ops a sequence of numbers and operators, in Reverse Polish Notation
* @return the result of the computation
* @throws IllegalArgumentException ops don't represent a well-formed RPN expression
* @throws ArithmeticException the computation generates an arithmetic error, such as dividing by zero
*
* <p>Some sample ops and their results:
* ["4", "1", "+", "2.5", "*"] -> ((4 + 1) * 2.5) -> 12.5
* ["5", "80", "40", "/", "+"] -> (5 + (80 / 40)) -> 7
*/| Report Duplicate | Flag | PURGE
Linkedin Android Engineer Data Structures
Open Chat in New Window