Netflix Interview Question
135 Interview Reviews |
Back to all Netflix Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Netflix:
Helpful Question?
Yes |
No
Inappropriate?
0 of 0 people found this helpful
by Sarty:
Singleton design pattern is used in Logger class,Shared Resource environment.
Example of singleton:
public class singleton{
private static singleton instance=new singleton();
private singleton(){
}
public ststic getinstance()
{
return instance;
}
}
another synchrinized way :
public class singleton{
private static singleton instance;
private singleton(){
}
public static getinstance(){
if (instance==null)
{
synchronized(singleton.class)
{
if(instance==null)
{
instance=new singleton();
}
}
}
return instance;
}
}