Interview Questions

Design Patterns in PHP – Strategy pattern

Strategy pattern The strategy pattern (also known as the policy pattern) is a behavioral software design pattern that enables selecting an algorithm at runtime. Instead of implementing a single algorithm directly, code receives run-time instructions as to which in a family of algorithms to use. Strategy lets the algorithm vary independently from clients that use …

Design Patterns in PHP – Strategy pattern Read More »

Design Patterns in PHP – Decorator design pattern

The Decorator Pattern, Adapter Pattern, Template Method Pattern, Strategy Pattern, Observer Pattern Decorator design pattern In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class. The decorator pattern is often useful for adhering …

Design Patterns in PHP – Decorator design pattern Read More »

Find the symmetric difference between arrays using javascript

Find the symmetric difference between arrays using javascript In mathematics, the symmetric difference of two sets, also known as the disjunctive union, is the set of elements which are in either of the sets, but not in their intersection. The mathematical term symmetric difference (△ or ⊕) of two sets is the set of elements …

Find the symmetric difference between arrays using javascript Read More »

Measure execution time of a function using javascript

You can measure the performance of javascript code using console.time() function. This can be helpful in debugging and optimizing code which is taking lot of memory. console.time() can be used with console.timeEnd(). console.timeEnd() function tells console to stop calculating the time. You will see result as below: Running loop :0 timesRunning loop :1 timesRunning loop …

Measure execution time of a function using javascript Read More »

Movie search application using Vue JS and Laravel framework using OMDb API – The Open Movie Database

A laravel movie search application using Vue JS, Vue Composition API and OMDBAI API. OMDBAI is used to fetch the movies data from https://www.omdbapi.com/ Requirements Installation You will need to gety API key from the OMDb API and update in /resources/js/components/movieapi/movie-api.js file Once you are done with the above steps, now its time to start building the movie …

Movie search application using Vue JS and Laravel framework using OMDb API – The Open Movie Database Read More »