With more than 25 photos and 90 likes every second, we store a lot of data here at Instagram. To make sure all of our important data fits…
One of the best articles mentioning ways to generate IDs in a distributed sharded data storage.
YOU ARE THE REASON
Monterey Bay Aquarium
dirt enthusiast
sheepfilms
Mike Driver
RMH
Sweet Seals For You, Always
d e v o n

if i look back, i am lost

blake kathryn
tumblr dot com
KIROKAZE

ellievsbear

@theartofmadeline
Not today Justin
Sade Olutola

★
cherry valley forever
$LAYYYTER
Lint Roller? I Barely Know Her

seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States
seen from United States

seen from Argentina
seen from United States
seen from United States

seen from Sweden

seen from United States

seen from United States

seen from United States

seen from United States
@nipunarora
With more than 25 photos and 90 likes every second, we store a lot of data here at Instagram. To make sure all of our important data fits…
One of the best articles mentioning ways to generate IDs in a distributed sharded data storage.
Y2K38 bug (aka Unix Millenium Bug)
The standard way to represent time in coding is epoch time. This time basically assumes that the beginning of time is January 1, 1970, at 12:00:00 a.m and corresponding epoch time is 0. Any time/date value is expressed as the number of seconds following that zero value. So the value 919642700 is 919,642,700 seconds past 12:00:00 a.m. on January 1, 1970, which is Sunday, February 21, 1999, at 16:18:20 Pacific time (U.S.).
Now, internally in computer system, to represent this date timestamp 32 bits are used. To represent time of 03:14:07 UTC of Jan.19, 2038 or beyond it, this format need to have more than 32 bits. In simple language, Unix machines are eventually going to run out of the bits to tick off seconds. This bug could cause problems in the data storage situations in which time values are stored or calculated as a signed 32-bit integer. The problem affects also all software systems that store system time as a signed 32-bit integer
At the moment, there’s no universal solution for the Year 2038 bug.
The possible solutions which can resolve this issue are:
Use long data types (64 bits is sufficient)
For MySQL (or MariaDB), if you don't need the time information consider using the DATE column type. If you need higher accuracy, use DATETIME rather than TIMESTAMP.
Wait for MySQL devs to fix this bug.
Well, the work is ongoing and, according to the experts, the Year 2038 problem shouldn’t be much hard to fix.
Magic of hashcode & equals
I would like to discuss cases, which basically prove why should we follow equals-hashcode contract, while implementing these methods:
What if hashcode always return constant integer, which means same integer for all calls. And equals return false for all calls.
What if equals returns true for all calls, but hashcode is different for all calls.
The first one, if followed, will put equal objects in the collection. And that too, in same bucket/linked list, in case of map or set.
Second one, if followed, will not be able to compare same objects, inspite of equals being true. That is, because all objects are stored in separate bucket/linked list, in case of map or set.
Find missing numbers
You are given an array with n elements, with numbers ranging from 1 to n. Some numbers are repeating, which means some numbers are also missing between 1 to n. Find missing numbers in O(n) time and O(1) space.
Hint: Remember any sort with O(n) time... :)
Snapdeal Interview
Telephonic
Algorithms used for garbage collection
Maximum memory that can be allocated to JVM in 32-bit system
Maximum number of requests per second received by your application
Maximum data received in requests (in Gbps) per second by your application
Time complexity of get method in HashMap and LinkedHashMap
Any sites or blogs which you follow for Java
Any specific Java class you have recently viewed. Name two
Types of joins used in database queries
MarkIt Interview Experience
Written
This involved written test of duration 45 minutes, having 5 sections with 5 questions each and 9 minutes duration each, and all multiple choice questions:
Basic Java and binary search
Threads
Collections and generics
SQL
Logical reasoning
Face to face technical
This involved single face to face technical round where interviewer asked java related deep technical questions:
Working of hashset in java, with insertion flow of objects, along with flow of equals and hashcode methoid
What if, for a given class object, equals return always false and hashcode always constant, how many times these methods will be called for insertion of two objects in empty hashset
Java code for removing duplicates in a list, assuming equals can't be overridden
Java code for returning occurrences count of words, with given single string with words separated by comma(,)
Java code for printing numbers in ascending order, with given ten threads and each thread is assigned a unique number in range of 1 to 10. The threads need to print their number, but order needs to be maintained and has to be in ascending order. We need to assume a single processor, which means single thread can execute at a moment.
Find fastest 3 horses
You are given 25 horses and you need to find fastest 3 horses. You can conduct a race with a constraint, that only 5 horses can participate in a single race. How many races you need to conduct to find 3 fastest horses.
Solution
You conduct 5 races among 25 horses. You would take down rankings of all horses in each race. Lets say these groups are A, B, C, D and E and horses as per ranking are A1, A2, A3, A4 and A5 for A group and similarly for other groups.
You conduct a single race among topper of each race. This will give you top 3 horses. Lets say this order is A1, B1, C1, D1 and E1. So, fastest horse is A1.
Now we need to find fastest two horses after A1.
You don't need to consider groups D and E. And for group C, you only need to consider C1.
You need to consider A2, A3 from group A and B1, B2 from group B and C1 from group C. Conduct one more race between these horses and it will give you second and third position.
The magic of try-catch block
What if try, catch and finally, all have return statement?
try { return 1; } catch (Exception e) { return 2; } finally { return 3; } // This will always return 3.
What if returned variable from try block is modified in finally block?
int a=4; try { return a; } finally { a=1; } // This will return 4
What if returned variable from try block is object and its member variable is modified in finally block?
MyObject obj = new obj(); obj.setNum(4); try { return obj; } finally { obj.setNum(1); } // This will return obj with num as 1.
In which scenario, finally block is not executed?
The only time finally won’t be called is if you call System.exit() or if the JVM crashes first.
Best practises to avoid NullPointerException
Call equals() on known string: Always call equals on known string, which is for sure not null. For example,"a".equals(b); This will never throw NullPointerException which might be possible if you write b.equals(“a”).
Prefer valueOf() over toString(): If an object is null, then it will throw NullPointerException, if toString() method is called on it. But String.valueOf(obj) for null object will return “null”.
Avoid returning null collection: Always prefer return a empty collection instead of null declared collection. This can be achieved in more convenient way by using Collections.EMPTY_LIST, Collections.EMPTY_SET and Collections.EMPTY_MAP.
World’s Most Expensive Cameras
I was never this much passionate about any thing as I am currently about photography (I m talkin abt thing, not abt a human being... ;)). It all started when I took a shot from my friend Rajat's camera, Sony H20 and was stunned with the small depth of field resulting to blurring in the shot. And that shot was taken while my first trip (till now also the last) to Goa. It was me, Rajat and Gaurav. And around 2-3 months after the trip, I bought my first camera which was an advanced point-and-shoot, Canon SX20. And after that, it has been 2 years and still learning many things in photography. I became the paid member of the site 500px.com which seems to me the best photography site. And there I checked the profile of Magda Indigo, http://500px.com/magdaindigo. She is a professional and she posts some shots on 500px with black and white backgrounds. All the shots are stunning. I checked her photography gear and there I came to know about this brand, Hasselblad.
I googled Hasselblad and checked the Hasselblad cameras on Amazon. And I found this camera, http://www.amazon.com/Hasselblad-H4D-60-Megapixels-Digital-40-2x53-7mm/dp/B004YG6OUQ which seems to be the world's most expensive SLR. The price of this model is $41,995 on Amazon and it includes 80mm f2.8 lens. That's almost equal to Rs.23.1 lakh in my currency. I can get BMW 3 series in that much, with Nikon D7000 .... :D
I even checked review of this camera and was stunned with this review http://www.amazon.com/review/R3NKBRISDN6L67 where the guy sold his car and his condo in Vegas to buy this camera. No doubt the review is funny and not sure, if guy is serious or just joking.
Then I came across another two brands, Phase One and Leica. I have heard about Leica but never heard about Phase One.
I checked Phase One site and found the SLR 645DF as the most superior model. The price is quoted as $25,990 on http://www.samys.com/p/Digital-SLRS/71642/IQ140-Back-Bundle-with-645DF-Body-and-80mm-Lens/47568.html which includes single 80mm lens and LCD back. Cameras like these have digital back where you get to attach it at the back of camera and the digital back contains digital image sensor.
“I’m not interested in any outcome. I’m not interested in any achievement. I’m not trying to get somewhere. I’m not trying to succeed in my life. My life is not about success. My life is about self-realization and fulfillment. And if we seek fulfillment, then we have no stress. If we seek success, we will have stress.” ~ Satish Kumar
A ride to remember
Article 15 of the Indian Constitution prohibits discrimination on the grounds of Gender... Who are we to say otherwise?
I'M NOT A COMPLETE IDIOT... some parts are missing
"The feeling that ‘no one is listening to me’ make us want to spend time with machines that seem to care about us." (Sherry Turkle)