Monthly Archives: October 2014

Late Static Binding in PHP

http://php.net/manual/it/language.oop5.late-static-bindings.php Basically, it boils down to the fact that the self keyword does not follow the rules of inheritance. self always resolves to the class in which it is used. This means that if you make a method in a … Continue reading

Posted in PHP | Leave a comment

Reflection Concept in PHP

http://php.net/manual/en/book.reflection.php http://www.sitepoint.com/introspection-and-reflection-in-php/

Posted in PHP | Leave a comment

Javascript Prototype Pattern

http://javascriptissexy.com/javascript-prototype-in-plain-detailed-language/ http://sporto.github.io/blog/2013/02/22/a-plain-english-guide-to-javascript-prototypes/ 1. First, there is a prototype property that every JavaScript function has (it is empty by default), and you attach properties and methods on this prototype property when you want to implement inheritance.Note that this prototype property is … Continue reading

Posted in Javascript | Leave a comment

Javascript Set2 of Interview questions

1) Does Javascript support read only attributes of Object? With any javascript interpreter that implements ECMAScript 5 you can use Object.defineProperty to define readonly properties. In loose mode the interpreter will ignore a write on the property, in strict mode … Continue reading

Posted in Javascript | Leave a comment

Scope of variables in Javascript

Javascript has two types of scopes global and local(function) level scope. Variables declared globally that are visible throughout the javascript program come under global scope. Variables declared inside functions, may have same name as global varibles, are accessible only within … Continue reading

Posted in Javascript | Leave a comment

JSON

JSON : Javascript Object Notation JSON syntax is a subset of the JavaScript object notation syntax: – Data is in name/value pairs – Data is separated by commas – Curly braces hold objects – Square brackets hold arrays JSON values … Continue reading

Posted in Javascript | Leave a comment

Complexity of Algorithms

Sorting : O(n^2) : Bubble Sort, Selection Sort, Insertion Sort http://bigocheatsheet.com/

Posted in Algorithms | Leave a comment

Algorithms on Graphs

1) DFS Remember its recursive 2) BFS Queue based 3) Shortest Path in unweighted graph. 4) Shortest Path in weighted graph. 5) Determine if directed graph has a cycle Karumanchi , pg 236 If a node is seen a second … Continue reading

Posted in Algorithms | Leave a comment

Depth First Search vs Breadth First Search

Karumanchi (pg 216) DFS 1) Visit a node, then one of its child, then one of its child, till you reach the leaf. Then backtrack and visit other childs. 2) lower memory requirements since its not required to store all … Continue reading

Posted in General | Leave a comment

Questions on Testing

1) Difference between functional testing and unit testing Unit Tests are written from a programmers perspective. They are made to ensure that a particular method (or a unit) of a class performs a set of specific tasks. Functional Tests are … Continue reading

Posted in General | Leave a comment