JSON vs XML

One of the most obvious of these is that JSON is significantly less verbose than XML, because XML necessitates opening and closing tags (or in some cases less verbose self-closing tags), and JSON uses name/value pairs, concisely delineated by “{“ and “}” for objects, “[“ and “]” for arrays, “,” to separate pairs, and “:”… Continue reading JSON vs XML

Advertisements

OOPS Basic

  The four principles of OOP. 1. Encapsulation 2. Abstraction 3. Inheritance 4. Polymorphism Inheritance is a mechanism of acquiring the features and behaviors of a class by another class. The class whose members are inherited is called the base class, and the class that inherits those members is called the derived class. Inheritance implements… Continue reading OOPS Basic

Design a highly consistent and is network partition tolerant DB

Link to original IntervieBit article Q: What is the amount of data that we need to store?  Anwer: Let's assume a few 100 TB. Q: Do we need to support updates?  A: Yes. Q: Can the size of the value for a key increase with updates?  A: Yes. In other words, its possible a sequence of keys could co-exist on one server previously,… Continue reading Design a highly consistent and is network partition tolerant DB

CTCI: Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file.

Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file. Assume you have 1 GB of memory FOLLOW UP What if you have only 10 MB of memory? Solution There are a total of 2^32, or 4 billion, distinct integers possible. We have… Continue reading CTCI: Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file.