Posts

Angular Interview Questions

Angular Interview Questions   Lifecycle Hooks: Q1. What is the sequence of component lifecycle hooks? Q2. If there is a nested component like the parent and child component then what will be the order of lifecycle hooks? Q3. What is the difference between ngDoCheck() and ngOnChanges()? Q4. Which of the lifecycle method called when the input properties changes . Q5. Which of the lifecycle method called after the child views are initialized . Q6.   What are the lifecycle methods called only once in the lifecycle ? Q7. Can we access the Dom element inside the Constructor?   Component: Q1. What is the difference between the providers section present in the component and present in app.module.ts file? Q2. How do you reference a child component inside a parent component? Q3. What is the difference between @ViewChild and @ViewChildren? Q4. What is the difference between @ContentChild and @ContentChildren?   Data Binding: Q1. What is two-way bin...

iframe vs embed vs object in HTML 5

HTML5 - Embedded content <iframe> vs <embed> vs <object> Embed, object and iframe tags are used to embed external resources in html document. <iframe> Primarily used to include resources from other domains or subdomains but can be used to include content from the same domain as well.   < iframe   id = "myFrame"   frameborder = "0"   allowtransparency = "true"   src = "report.html"   width = "100%"   height = "700" style = "border:none;" >   </ iframe >  Pros : ·          The  <iframe> 's strength is that the embedded code is 'live' and can communicate with the parent document. Cons : ·          Iframes Bring Security Risks: o    A malicious user can run a plug-in, change the source site URL, hijack your users' clicks ·       ...

Write a program to print the Fibonacci series in c# using Recursion.

Image
Write a program to print the Fibonacci series in c# using Recursion. class Fibonacci     {         // Using Recursion:         public static int FibonacciSeries( int n)         {            //To return the first & second Fibonacci number             if (n == 0 || n == 1) return n;                                return FibonacciSeries(n - 1) + FibonacciSeries(n - 2);         }         public static void Main( string [] args)         {             Console .Write( "Enter the leng...

Write a program to print Fibonacci series in c#.

Image
Write a program to print the Fibonacci series in c#. class Program     {         static int FibonacciNumber( int number)         {             int firstnumber = 0, secondnumber = 1, result = 0;             if (number == 0 || number == 1) return number; //Return the first & second Fibonacci number               for ( int i = 2; i <= number; i++)             {                 result = firstnumber + secondnumber;                 firstnumber = secondnumber;      ...

Write a program to print factorial of a number using recursion.

Image
Write a program to print the factorial of a number using recursion. class Program     {        // Using Recursion:         public static double factorial( int number)         {             if (number == 1)                 return 1;             else                  return number * factorial(number - 1);         }         static void Main( string [] args)         {             Console .WriteLine( "Enter the Number" );  ...
Image
Write a program to print the factorial of a number. class Program     {         static void Main( string [] args)         {             int num, fact;             Console .WriteLine( "Enter the Number" );             num = int .Parse( Console .ReadLine());             fact = num;             for ( int i = num - 1; i >= 1; i--)             {                 fact = fact * i;             }    ...

SOLID Design Principles in C#

Image
WHAT IS SOLID principles: : ü    SOLID is an acronym of 5 design principles. ü    It is foundations of good software design. ü    These  SOLID principles were introduced by  Robert C. Martin , also known as  Uncle Bob . ü    Help developer to write F lexible , Scalable , M aintainable , & R eusable code.