msgsmg
BAN USER
- 0of 0 votes
AnswersDesign your own String Pooling system. It should return a String with request of more length. String pool should have strings of different sizes available. When requested, it should just be returned to client and when client is done using string, it should be added back to string pool for other client to use.
- msgsmg in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 - 0of 0 votes
AnswersAdd a number to array and if there is carry increase array size.
- msgsmg in United States
---------------------------
For example input = {7,3,5,3,9} convert this to number 73539, add 1 so it becomes 73540 and convert to array {7,3,5,4,0}.
Array can be of any length, so you can't always represent array in form of in-built number format. So you have to do this summation in-place. Also, how would you increase array size in-case input = {9,9,9} so output = (1,0,0,0}
Assume, all elements of arrays are between 0 and 9.| Report Duplicate | Flag | PURGE
Algorithm - 0of 0 votes
AnswersAdd a number to array and if there is carry increase array size.
- msgsmg in United States
----------------------------------------------------------------------
For example input = {7,3,5,3,9} convert this to number 73539, add 1 so it becomes 73540 and convert to array {7,3,5,4,0}.
Array can be of any length, so you can't always represent array in form of in-built number format. So you have to do this summation in-place. Also, how would you increase array size in-case input = {9,9,9} so output = (1,0,0,0}
Assume, all elements of arrays are between 0 and 9.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer