Android developer Interview Questions | Glassdoor.co.uk

Find jobs for android developer

Android developer Interview Questions

147

android developer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Write algorithm to convert number for example 16 138 832 into "sixteen million one hundred thirty eight thousand eight hundred thirty two"

3 Answers

It was hard to write under pressure. Basically, I was using HashMap. Key for integer, value for spelling. Solution you can find somewhere at leetcode

haven't checked leetcode, but how about this? firstly use (int)(Math.log10(number) + 1) to get the number of digits in the given number. (Note: you have to handle 0 differently) e.g 16138832 should return 8. Use this number of digits to get an idea of digit place's spelling (billion, million, thousand, hundred) Then for each digit (0~9) I'm thinking of using the previous answer's suggestion of HashMap to get the spelling. So I imagine there would be two HashMaps, one for getting the digit spelling (one, two, ... nine, ten, ... , nineteen), the other for the digit place spelling (billion, million, thousand, hundred, ... thirty, twenty)

Here is the answer. Sorry for the extra spaces :) private static String spellNumber(String number) { HashMap level1Num = new HashMap(); level1Num.put(1, " one "); level1Num.put(2, " two "); level1Num.put(3, " three "); level1Num.put(4, " four "); level1Num.put(5, " five "); level1Num.put(6, " six "); level1Num.put(7, " seven "); level1Num.put(8, " eight "); level1Num.put(9, " nine "); level1Num.put(10, " ten "); level1Num.put(11, " eleven "); level1Num.put(12, " twelve "); level1Num.put(13, " thirteen "); level1Num.put(14, " fourteen "); level1Num.put(15, " fifteen "); level1Num.put(16, " sixteen "); level1Num.put(17, " seventeen "); level1Num.put(18, " eighteen "); level1Num.put(19, " ninteen "); HashMap level2Num = new HashMap(); level2Num.put(2, " twenty "); level2Num.put(3, " thirty "); level2Num.put(4, " fourty "); level2Num.put(5, " fifty "); level2Num.put(6, " sixty "); level2Num.put(7, " seventy "); level2Num.put(8, " eighty "); level2Num.put(9, " ninty "); String output = ""; while (number.length() > 0) { String block; if (number.length() % 3 == 0) { block = number.substring(0, 3); } else { block = number.substring(0, (number.length() % 3)); } if (block.length() > 2) { output += level1Num.get(Integer.parseInt(block.substring(0, 1))) + " hundred "; number = number.replace(block.subSequence(0, 1), ""); block = block.replace(block.subSequence(0, 1), ""); } int block2 = Integer.parseInt(block); if (block2 = 7 && number.length() = 4 && number.length() <= 6) { output += " thousand"; } number = number.replace(block, ""); } return output; }

what is android

2 Answers

Write methods to store and search strings. On searching * denote any symbol.

4 Answers

can join immediately

1 Answer

The coding test was to build an Android-based RESTful API Client that displays a list of information based on an open API endpoint.

1 Answer

2 arrays with duplicate numbers on each ones... try to find the numbers not present in the other. How to make an efficient algorithm? (Although it was very difficult to even understand the task due to a bad explanation)

1 Answer

1. Dive into the coding challenge 2. Architecture 3. Room 4. RxJava 5. Modules

1 Answer

SortedIterator - consists of List of Lists with sorted int values in each list. You have to give next sorted value when call next(). have to implement methods * constructor * next() * hasNext() [ [1, 4, 5, 8, 9], [3, 4, 4, 6], [0, 2, 8] ] next() -> 0, 1, 2, 3, 4, 4, 4...

2 Answers

One or more comments have been removed.
Please see our Community Guidelines or Terms of Service for more information.

what is relation between vechicle ,car and engine

1 Answer

What is your favorite programming language?

1 Answer
110 of 147 Interview Questions