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


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

Laravel: Lazy Load and Lazy Eager Loading

Laravel Lazy Load If you do not need to add additional constraints to an Eloquent relationship query, you may simply access the relationship as if it were a property. For example, continuing to use our User and Postexample models, we may access all of a user's posts like so: $user = App\User::find(1); foreach ($user->posts as $post) { //… Continue reading Laravel: Lazy Load and Lazy Eager Loading

Session and Cookies

These link basically sum up session very well. It's a very trivial topic to cover but nonetheless very fundamental. Sometimes interviewers dig into these topics (mostly for freshers or less experienced applicants). The explanation is very simple and the best part is the debug part which has been copied below. https://www.quora.com/How-Session-and-Cookies-related or http://machinesaredigging.com/2013/10/29/how-does-a-web-session-work/   Why would a… Continue reading Session and Cookies

HTTP, TCP/IP and …

HTTP The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, and hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web. HTTP is an application layer protocol designed within the framework of the Internet protocol suite. Its definition presumes an underlying and reliable transport layerprotocol, and Transmission Control Protocol (TCP) is commonly used. However HTTP can be adapted to use unreliable… Continue reading HTTP, TCP/IP and …