What is an IEnumerable?

  • IEnumerable is an interface available in the System.Collection namespace
  • Any collection that implements the IEnumerable implements the GetEnumerator method of the IEnumerable interface, making it iterable.
  • The IEnumerable or the Generic IEnumerable must be used over in-memory objects.

How can you compile a .NET Project without using Visual Studio?

  • We can compile .NET Framework projects without using Visual Studio on the Command Line using csc.exe file.
  • We can supply additional arguments to csc.exe, in-addition to the csproj file of the .NET project.
  • In .NET Core, we use the dotnet build command on the command-line which can build the csproj without using Visual Studio.

What is JIT Compilation?

  • A JIT (Just-In-Time) compiler converts the MSIL (MS Intermediate Language) into native code on demand during the application runtime, when the application components are loaded and executed.
  • The JIT compilation happens specific to the running CPU architecture, since the common language runtime supplies a JIT compiler for each supported CPU architecture.
  • If the managed code calls platform-native APIs or runs platform-specific assemblies, the JITed code runs on only that particular system.

What is a Tuple? How many values can a Tuple Hold?

  • A Tuple is a data structure which can hold data of multiple types in a single variable.
  • Tuple was first introduced in .NET 4.0.
  • A Tuple can generally represent a row in a database table, where each column can represent a different type.
  • Individual values of "Items" inside a single tuple variable can be accessed by means of properties (Item1, Item2, ..)
  • A tuple can hold a maximum of 8 Items in itself, where the individual Items can themselves be Tuples of different items.
var tuple = new Tuple<T1, T2, T3, ... , T7, T8>();

What is GAC in .NET?

  • GAC stands for Global Assembly Cache
  • It is a place in the Windows directory where the assemblies (the DLL files) designated to be shared by the applications are stored for reuse.
  • Any assembly or component which is desired to be shared across applications in a machine is registered on the Global Assembly Cache.
  • To register an assembly into the Global Assembly Cache, we can do so by using the GACUtil.exe as below:
> gacutil -i [Path][Assembly Name].dll

What are Namespaces?

Namespaces are used to group and organize classes which are somewhat related to each other. Any class created would reside under a namespace and is referenced using the namespace in other classes or modules.

namespace MyModule {
  class MyClass {
   // all things under class
  }
  class MyOtherClass {
   // all things under class
  }
}

What are the different lifecycle hooks available to Components in Angular?

The below are the lifecycle hooks available in Angular. These are added by implementing the respective interface on the component.

  1. ngOnChange - before OnInit and whenever Input property changes in value
  2. ngOnInit - called once the Input properties are set, used to fetch initial data
  3. ngDoCheck - detect and act upon any changes that are by default on detected
  4. ngAfterContentInit - after loading any external entity into the component, such as a directive
  5. ngAfterContentChecked - after the content loaded is checked
  6. ngAfterViewInit - after the view is initialized
  7. ngAfterViewChecked - after the view is checked
  8. ngOnDestroy - just before the component is destroyed