« first day (1785 days earlier)      last day (1904 days later) » 

4:52 AM
Morning
 
o/ Namaste
 
 
2 hours later…
7:19 AM
@Dro beere ?
@sha Hi o/
 
@sha Hi \o
 
7:36 AM
@sha hi o/
 
 
1 hour later…
8:37 AM
~ India: A Magician of Benares
 
@TheLittleNaruto yo bro
 
@DroidDev Have one Algo related doubt
Let's say you have list of numbers and its location
For Example Shadow'number is 12345 and location is Antartica
There is a view
In that you enter a number and fetch the location of it from the file where those list of numbers are there
It's upto you that how you want to store the records
But The records can be millions
How would you do that ?
So basically User'll enter any number and you will display the location associated to the entered number.
 
@TheLittleNaruto are these sequential numbers or random numbers?
 
@DroidDev It can be sequential. It's upto you how you want them stored
But searching should be very optimized
 
@TheLittleNaruto I think you can just take an array(list?), and store the location at the same index as that number.
For example, Antartica will be stored at index 12345
direct O(1) access!
 
8:49 AM
4 mins ago, by TheLittleNaruto
But The records can be millions
@DroidDev In that case 0-99999999 spaces will be wasted, no ?
 
@TheLittleNaruto so the numbers don't start from 0?
 
@DroidDev ArrayList has some threshold AFAIR
@DroidDev It's a phone number
 
oh
 
7 mins ago, by TheLittleNaruto
For Example Shadow'number is 12345 and location is Antartica
 
> still thinking
 
8:52 AM
Okay
 
if records are in millions, then we have to store in database, but I don't know what optimization we'll perform on queries.
dunno much about database optimisation
@TheLittleNaruto we can store numbers in binary tree nodes as well. That's log n search time. But millions of records won't be store in RAM, where tree's memory will reside
 
@DroidDev using database is not allowed
database queries are best and faster than the Flash
@DroidDev Right That's what I also told but interviewer was not happy
 
then files are last resort. We'll store numbers in files. Lets say all the numbers starting with 99 will be stored in one file. That'll provide sharding to our number dataset, which'll be in files. Now these files can be stored on disk as well.
 
@DroidDev I can't tell if that's an optimal solution
 
next is searching, so searching for file is fairly easy. We can just have another dataset, which store all the addresses to files. So, we'll see what the number starts with, then get the address of that file in O(1). We'll open the file, here, all the numbers will be stored in sorted manner, where we can do binary search and find the name.
how about this @TheLittleNaruto
Total search complexity, log n
Time complexity for insertion, log n. Same with deletion as well
and we can keep making files until system runs out of storage space, so its really upto how much money the interviewer has :P
 
9:00 AM
@DroidDev LOL
 
millions will look peanuts in front of this. We can have billions of records
 
also, we can optimise this further, but you get the idea, right?
 
But that sounds reasonable, however I can't verify what he was looking for.
I forgot to ask him too
 
I just designed an optimised and sharded database for you man. You can scale it vertically, as well as horizontally. You can even have multiple databases saving files, and then you can have even more storage space.
sometimes, if you listen carefully, you can hear my genius at work :P
 
9:03 AM
@DroidDev haha I did listened to you carefully. But I am still not sure what he was looking for.
 
hmm....but I think this should do man.
 
@DroidDev Yeah looks promising.
Also one question was to implement own Integer.parseInt(String input) method
And one more was to find set of integers in a string
For example if String input = "aabb55wew123dasdfs3ssdfsa567"
Then output should be "55", "123", "3", "567" @Dro
both of above problems were easy for me.
 
@TheLittleNaruto this should be fairly easy. You go around converting your string into char array, then start from last index, and keep making integer
 
@DroidDev How ?
 
@TheLittleNaruto how did you do this one?
 
9:11 AM
@DroidDev I had created this variable String digits ="0123456789"
 
@TheLittleNaruto multiply the existing number by 10, add the new number to last place. That sort of logic. If I put the pen down, I can do it on paper
 
And rest was easy job
@DroidDev Yes I did same
 
@TheLittleNaruto so every time you checked with contains?
for every character in string?
 
@DroidDev Yes there was no other way I could think of at that moment
Oh boy I could have applied regex instead
 
@TheLittleNaruto yeah, what you did was worst way to do it actually. It has O(n^2) complexity. Contain function works with linear search man
 
9:13 AM
@DroidDev Yeah right
I am still feeling happy because I could make up to 2nd round of the interview
And that too without any preparation lol
 
which company?
hmmm
 
Life Style is one of the brand of this company
 
 
1 hour later…
10:18 AM
~ Echo ... E c h o ...... E c h o .....
 
 
2 hours later…
12:18 PM
~ Shadow of a Woman
 
12:28 PM
~ You rang?
 
 
4 hours later…
4:29 PM
~ What is this? Weekend?
 
 
2 hours later…
6:06 PM
LOL
Too many dangling parts while working on machinery could be hazardous. — kikirex Feb 26 at 16:40
 
 
2 hours later…
8:07 PM
~ Who needs sleep here?
 
 
2 hours later…
10:07 PM
~ The Magnificent Six and ½: The Magician
 

« first day (1785 days earlier)      last day (1904 days later) »