the Edgerank algorithm is used in Facebook to determine the order of posts that should be shown on a user's Top News feed.
This blog is an Ultimate Guide to Mastering Coding Interviews! Dive into the world of Data Structures, Algorithms, and Design Patterns with expert insights, practical tips, and in-depth tutorials. Whether you're a seasoned developer or just starting out, this blog is a go-to resource for acing technical interviews. Unlock the secrets to writing efficient code, optimizing algorithms, and applying design patterns to build robust solutions. Join us on this journey towards coding excellence!
Friday, November 16, 2012
Sunday, November 4, 2012
Flyweight Design Pattern
The flyweight design pattern is used to dramatically increase the speed of code when using many similar objects.
To reduce memory usage the flyweight design pattern shares Objects that are the same rather than creating new ones.
To reduce memory usage the flyweight design pattern shares Objects that are the same rather than creating new ones.
Bridge Design Pattern
This pattern is used to build a group of classes that slowly adds functionality from one class to the next.
Facade Design Pattern


Labels:
Design Pattern,
Java,
Patterns and Anti-Patterns
Iterator Design Pattern

This is done by creating a common interface that all the different collection classes share. Then an iterator is provided to traverse the objects they contain.
Because all different Collection classes share a common interface they can be treated polymorphically and it eliminate duplicate code.
Below is the video tutorial for the Iterator pattern
Related articles
The For-Each Loop(iontech.wordpress.com)

State Design Pattern

Below is the video tutorial on State Design Pattern
Related articles
Object Oriented Design Patterns for Model Attribute Events(stackoverflow.com)

Labels:
Design Pattern,
Java,
Patterns and Anti-Patterns
Command Design Pattern


void start();
void shutdown();
}
public class Laptop implements Computer {
public void start() {
System.out.print("Laptop is started");
}
public void shutdown() {
System.out.print("Laptop is shutdown");
}
}
public interface Command {
void execute();
void undo();
}
public class StartLaptop implements Command {
Computer theComputer;
public StartLaptop (Computer newComputer ) {
theComputer = newComputer;
}
public void execute() {
theComputer.start();
}
public void undo() {
theComputer.shutdown();
}
}
Below is the video tutorial about the Command pattern.
Related articles
Command Pattern(slanto.wordpress.com)

Singleton Design Pattern Tutorial
Singleton Pattern is used to prevent instantiation of an object more than once.
Saturday, November 3, 2012
Factory Design Pattern
Factory design pattern is used to define the class of an object at runtime. It allows encapsulating object creation to keep all object creation code in one place. (separation of concerns)
You cannot instantiate an abstract class. It is just there to facilitate polymorphism.
You cannot instantiate an abstract class. It is just there to facilitate polymorphism.
Subscribe to:
Posts (Atom)