Google Interview Question for Software Engineer / Developers
- 1of 1 vote
Imagine you have a sequence of the form 0123456789101112131415... where each digit is in a position, for example the digit in the position 5 is 5, in the position 13 is 1, in the position 19 is 4, etc.- 352905 February 04, 2013 in United States
Write a function that given a position returns the digit in that position.
(You could think that this sequence is an array where each cell only holds one digit so given an index return what digit is in that index, however you cannot really create an array since the sequence is infinite, you need a way to based on the index calculate the digit that goes there).
The function has to return a single digit.
index = 100, result = 5
index = 30, result = 2
index = 31, result = 0
index = 1000, result = 3
| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm
Open Chat in New Window