1. Have you ever looked at the source code of the libraries/frameworks you use? A. Monolog, Dispatcher, League\Csv\Writer 2. How do you organize your code? A. 3. Describe two good uses - and practices - for callback usage. 4. HMVC Pros and Cons - HMVC can do anything that MVC can and more...one of… Continue reading General Question

# Category: Miscellaneous

## Monolog

Monolog is a logging library and provides a simple way to log to different logging means like to logstash, sentry, redis etc... We need to configure Monolog handler as per our need. Suppose we need to configure Monolog to send logs to Logstash. Check this blogCheck this blog (If you set up everything correctly, Monolog is… Continue reading Monolog

## Ordered Set

An ordered set is same as the sorted set data structure in Redis. An ordered set can be implemented using a number of data structure. Like the sorted set in Redis is implemented using Skip List. It can be implemented using AVL tree, Red-Black Tree, Splay Tree. An ordered set is a common data structure that… Continue reading Ordered Set

## Gnutella Working

Video How a Gnutella client finds a song Given that there is no central server to store the names and locations of all the available files, how does the Gnutella software on your machine find a song on someone else's machine? The process goes something like this: You type in the name of the song… Continue reading Gnutella Working

## B – Tree

B-Tree is a self-balancing search tree. In most of the other self-balancing search trees (like AVL and Red Black Trees), it is assumed that everything is in main memory. To understand use of B-Trees, we must think of huge amount of data that cannot fit in main memory. When the number of keys is high, the data is… Continue reading B – Tree

## Binary Tree – Set 3

BT Set – 2, BT Set – 1, Question Set (101- ..) Binary Tree Visualizer Remove nodes on root to leaf paths of length < K. GFG Algo: The idea here is to use post order traversal of the tree. Before removing a node we need to check that all the children of that node in the shorter… Continue reading Binary Tree – Set 3

## Binary Tree – Set 2

BT Set - 1, BT Set - 3 , Question Set(41-101) Binary Tree Visualizer *** Populate Inorder Successor for all nodes Code This is also referred to as Threaded Binary Tree. GFG Algo: 1. We need to do a reverse inorder traverse. 2. The same can be easily implemented using queue.We first do an inorder… Continue reading Binary Tree – Set 2

## Sorting – Set 3

Sorting, Sorting Set 1, Sorting Set 2 [Merge Sort] Sort array after converting elements to their squares Given a array of both positive and negative integers ‘arr[]’ which are sorted. Task is to sort square of the numbers of the Array. GFG Algo: 1. Efficient solution is based on the fact that given array is… Continue reading Sorting – Set 3

## Prime

Sieve of Eratosthenes - Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. GFG Least prime factor of numbers till n - Given a number n, print least prime factors of all numbers from 1 to n. GFG Algo: Use Sieve of… Continue reading Prime

## Sorting – Set 2

Sorting Set 1 Sorting Set 3 Given an array of n integers. The task is to check whether an arithmetic progression can be formed using all the given elements. If possible print “Yes”, else print “No”. GFG Algo: We don't really need to know the arithmetic difference. We can just take the diff of first two and… Continue reading Sorting – Set 2