Skip to content

Instantly share code, notes, and snippets.

@Whistler092
Last active January 10, 2020 19:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whistler092/d624e4c9b126f771ac8dfa793769e098 to your computer and use it in GitHub Desktop.
Save Whistler092/d624e4c9b126f771ac8dfa793769e098 to your computer and use it in GitHub Desktop.
Path de estudio .Net

Temas para Repasar

  1. .net desde que es OOP

  2. polimorfismo

    • https://desarrolloweb.com/articulos/polimorfismo-programacion-orientada-objetos-concepto.html 2.1 Inicialmente se entiende que Sobrecarga hace referencia a un conjunto de Métodos con el mismo Nombre pero diferente Número de Parámetros y/o Tipos de estos, además que estos Métodos se encuentran definidos en una misma Clase. En tanto que Polimorfismo hace referencia a un conjunto de Métodos con el mismo Nombre e igual Número de Parámetros y Tipos, pero que se encuentran definidos en diferentes Clases.

    Cuando tu sobrecargas un método tu objetivo es que tanto uno como el otro hagan la misma funcionalidad, mientras que el polimorfismo se utiliza para realizar diferentes funcionalidades.

  3. herencia

  4. manejo de memoria heap y stack

  5. value types y reference types

  6. TLP

  7. MVC

  8. Web api

  9. EF

  10. WCF

  11. delegados y eventos

  12. SQL

  13. inyeccion de dependencias

  14. Abstracción y encapsulamiento

  15. Async / Await

Nivel Senior

  1. Owin And katana
  2. JWT
  3. Patrones de diseño
  4. Buenas practicas
  5. Analizar en tiempo de compilacion de los algoritmos / performance
  6. Automatización y publicación.

Links de Repaso

13 Essential .NET Interview Questions - Traducido

  • Explique la diferencia entre Clase y Objeto

    • Una clase es la definición de un objeto, y un objeto es una instancia de una clase. Podemos mirar la clase como un template de un objeto; Ese describe todas las propiedades, metodos, estados y comportamientos implementados en el objeto. Se menciona que el objeto es una instancia de una clase y una clase no se convierte en un objeto hasta que no sea instanciada
  • Diferencia entre código administrado y código no administrado

    • El código administrado es creado por el compilador .Net. No depende de la arquitectura que tendrá la maquina porque será ejecutado en el CLR (Common Language Runtime), y no por el sistema operativo en si.
  • Diferencias entre While y for

    • El código administrado es creado por el compilador .Net. No depende de la arquitectura que tendrá la maquina porque será ejecutado en el CLR (Common Language Runtime), y no por el sistema operativo en si.   * Ambos Loops son usados cuando la unidad de código son necesita ser ejecutado repetidamente.   * La diferencia del loop foor es usado cuando tu sabes cuantas veces necesitaras iterar el código.   * En cambio el ciclo while se usa cuando necesitas repetir algo hasta hasta que la sentencia sea True
  • Explique la diferencia entre Boxing y outBoxing

    • Boxing es el proceso de convertir un valor de un tipo en un objeto de tipo, y outboxing es extraer el tipo del valor del objeto
    • Mientras el Boxing es implicito, onboxing es explicito ´int i = 13; object myObject = i; // boxing i = (int)myObject; // unboxing ´
  • Diferencia entre Constantes y variables read-only

    • Comparten similaridades. Pero las constantes son evaluadas en tiempo de compilación mientras las variables read-only en el runtime
    • Las constantes soportan solo variables value-type mientras que las variables read-only puedes tener referenci
    • Las constantes deben ser usadas cuando el valor no cambia durante el runtime y las variables read-onlu son usadas mayormente cuando el valor actual es desconocido antes del rutime
  • Explicar que es LINQs

    • Acronico de Lenguaje integrado de consultas, agregado caracteristicas de consulta para la manipulación de datos a fuente s de datos
  • Como funciona el Garabage Collector

    • Es un recolector de basura de un proceso de baja prioridad que gestiona el manejo automatico de memoria, que gestiona la asignación y liberación de memoria en las aplicaciones.
    • Cada vez que se crea un objeto nuevo, el CLR asigna memoria que esté disponible en el HEAP, mientras haya más memoria disponible en el HEAP, el runtime continuará asignando espacio para nuevos objetos. Más sin embargo cuando la memoria llena el espacio HEAP, el garbage collector entra a liberar memoria. El garbage collector detendrá todos los subprocesos en ejecución, encontrará todos los objetos en el montón que no están siendo accedidos por el programa principal y los eliminará.
    • Ejecutar manualmente el garbage collector System.GC.Collect();
  • Acronimos .Net

    • IL: Lenguaje intermedio, es un código compilado parcialmente por la CPU, El código IL compilará a código de Maquina nativa utilizando las variables del entorno por el compilador Just-In-Time Compiler (JIT). El compilador JIT convertira el código IL en codigo assembly y usará la arquitectura del CPU para ejecutar la aplicación .NET. En .NET IL es llamado CIL (Common Intermediate Language)
    • CLI: o Common Language Infrastructure, es una especificaión abierta desarrollada por microsoft. Esto compula las librerias de código usadas para publicación, versionamiento y seguridad. En .Net hay dos tipos de CLI. (EXE) procesos assembies y (DLL) librerias assembies.
    • When compiled, source code is first translated to IL (in .NET, that is CIL, and previously called MSIL).
    • CIL is then assembled into a bytecode and a CLI assembly is created.
    • Before code execution, CLI code is passed through the runtime’s JIT compiler to generate native machine code.
    • The computer’s processor executes the native machine code.
  • Diferencia entre Stack y Heap

    • Stack almacena los Tipos de Valor (Tipos heredados del System.ValueType). Responsable de mantener el seguimiento de lo que se está ejecutando y donde se está ejecutando cada Thread.
    • Heap almacena Tipos de referencia (Tipos heredados del System.Object). Responsable de mantener el seguimiento de los datos o mas precisamente de los objetos.
  • Herencia

    • Concepto importante de la POO. junto con el encapsulamiento y polimorfismo. La herencia permite a los desarrolladores crear nuevas clases que reusan, extienden y modifican el comportamiento definido en otras clases. Esto permite reutilizar codigo y aumentar el tiempo de desarrollo.
    • Con la herencia los desarrolladores pueden escribir y debugear ona clase solo una ves y despues reutilizar las bases del código en nuevas clases.
    • Las clases cuyos miembros se heredan se deniminan clases base y las clases que hereda a esos miembros se denominna clases derivadas. Por defecto todas las clases en .net son derivadas.
  • Diferencia entre Interfaces y Clases abstractas en .NET

    • Una interfaz simplemente declara un contrato o un comportamiento que deben tener las clases en las que se implementaran. Puede declarar sólo propiedades, métodos y eventos sin modificar el acceso. Todos los miembros declarados deben de ser implementados.
    • Una clase abstracta proporciona una implementación parcial para una funcionalidad y algunos mienbros abstractos / virtuales que deben de ser implementados por las entidades hereditarias. También se pueden declarar campos
    • Ninguna de la 2 pueden ser instanciadas.
  • Ejecución aplazada vs ejecución inmediata en LINQ

    • Ejecución aplazada: El query no se ejecuta en el tiempo especificado. Uno puede asignar el query a una variable.
    • Ejecución Inmediata: Se usa con las siguiente sentencias Average, Sum, Count, List, ToList, or ToArray
  • Delegado

    • Es similar a un apuntador en C o C++. Usar un delegado permite al programador encapsular una referencia a un metodo dentro de un objeto delegado. El objeto delegado puede ser despues pasado a código que puede llamar el metodo referenciado sin tener the conocer en tiempo de compilación que metodo se invokara.
    • Se pueden hacer delegados para crear eventos propios para una clase public delegate void FooDelegate();

class FooClass { // custom event public event FooDelegate FooEvent; }

FooClass FooObj = new FooClass() FooObj.FooEvent += new FooDelegate();

  • difference between clustered & non-clustered index

Clustered Index

Only one per table Faster to read than non clustered as data is physically stored in index order Non Clustered Index

Can be used many times per table Quicker for insert and update operations than a clustered index Both types of index will improve performance when select data with fields that use the index but will slow down update and insert operations.

Because of the slower insert and update clustered indexes should be set on a field that is normally incremental ie Id or Timestamp.

SQL Server will normally only use an index if its selectivity is above 95%.

@Whistler092
Copy link
Author

  • Explain the difference between a class and an object.

In short, a class is the definition of an object, and an object is instance of a class.

We can look at the class as a template of the object: it describes all the properties, methods, states and behaviors that the implementing object will have. As mentioned, an object is an instance of a class, and a class does not become an object until it is instantiated. There can be more instances of objects based on the one class, each with different properties.

  • Explain the difference between managed and unmanaged code.

Managed code is a code created by the .NET compiler. It does not depend on the architecture of the target machine because it is executed by the CLR (Common Language Runtime), and not by the operating system itself. CLR and managed code offers developers few benefits, like garbage collection, type checking and exceptions handling.

On the other hand, unmanaged code is directly compiled to native machine code and depends on the architecture of the target machine. It is executed directly by the operating system. In the unmanaged code, the developer has to make sure he is dealing with memory usage and allocation (especially because of memory leaks), type safety and exceptions manually.

In .NET, Visual Basic and C# compiler creates managed code. To get unmanaged code, the application has to be written in C or C++.

  • Explain the difference between the while and for loop. Provide a .NET syntax for both loops.

Both loops are used when a unit of code needs to execute repeatedly. The difference is that the for loop is used when you know how many times you need to iterate through the code. On the other hand, the while loop is used when you need to repeat something until a given statement is true.

The syntax of the

while loop in C# is:

while (condition [is true])
{
  // statements
}

The syntax of the for loop in C# is:

for (initializer; condition; iterator)
{
  // statements
}
  • Explain what inheritance is, and why it’s important.

Inheritance is one of the most important concepts in object-oriented programming, together with encapsulation and polymorphism. Inheritance allows developers to create new classes that reuse, extend, and modify the behavior defined in other classes. This enables code reuse and speeds up development. With inheritance, developers can write and debug one class only once, and then reuse that same code as the basis for the new classes. The class whose members are inherited is called the base class, and the class that inherits those members is called the derived class. By default, all classes in .NET are inheritable.

  • Explain the differences between an Interface and an Abstract Class in .NET.

An interface merely declares a contract or a behavior that implementing classes should have. It may declare only properties, methods, and events with no access modifiers. All the declared members must be implemented.

An abstract class provides a partial implementation for a functionality and some abstract/virtual members that must be implemented by the inheriting entities. It can declare fields too.

Neither interfaces nor abstract classes can be instantiated.

  • What is a delegate in .NET?

A delegate in .NET is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked. In addition, we could use delegate to create custom event within a class. For example,

public delegate void FooDelegate();

class FooClass
{
    // custom event
    public event FooDelegate FooEvent;
}

FooClass FooObj = new FooClass()
FooObj.FooEvent += new FooDelegate();
  • How do you implement a generic action in WebAPI?

It’s not possible, as the WebAPI runtime needs to know the method signatures in advance.

  • Why can’t you specify access modifiers for items in an interface?

It is always public

  • When break is used inside two nested for loops, control comes out of which loop, the inner or the outer for loop? (I.e. does it break from all the present loops?)

It breaks from the inner loop only.

  • You would know that System.Object is the parent class of all .NET classes; In other words all types in .NET (whether implicit, explicit, or user-created) derive from the System.Object class.
    What are the various methods provided to System.Object’s deriving classes/types?

System.Object provides the following important methods, among others:

ToString—Returns a string that represents the current object
both overrides of Equals(object), Equals(object, object)
GetHashCode
Finalize
GetType
ReferenceEquals
MemberwiseClone
Most of these methods provide the basic implementation required of any type that a developer will work with in the .NET stack.

@Whistler092
Copy link
Author

Whistler092 commented Jun 25, 2018

  • Basic

Principles of OOP
Abstract VS encapsulation
How did you implement encapsulation?
Difference between shadowing and overriding?
Different types of polymorphism in c#.

  • .NET fundamentals

CLR, CTS, CAS,IL code etc.
Delegates , events , difference between them
Reflection,threading, application domain,boxing, unboxing etc.

  • ASP.NET

Page life cycle.
Authentication and Authorization
Session , cache , view state and applications.
Server controls and user controls.

  • Experience with IOC and unit/integration tests.

https://www.c-sharpcorner.com/UploadFile/dacca2/fundamentals-of-unit-testing-unit-testing-of-ioc-code/

Inversion of Control (IoC or IOC) describes a system that follows the Hollywood Principle.
That is, flow of control within the application is not controlled by the application itself,
but rather by the underlying framework.

Typically in such an architecture, the application is written such that it ties into the application framework
by handling framework events or plugging in to framework extension points.

An IOC Container, also known as a Dependency Inversion (DI) container,
is a specialized factory used to facilitate dependency injection.

  • Second level WCF / MVC and EF

Why WCF ?
WCF vsWebservicesvsremoting
Operation contract, data contract and service contract.
One way and two way contracts.
Security, Transactions,REST , Instancing etc.

  • Senior level categories

For senior’s, questions around design patterns, UML and project management will be asked more. They will probed around management capabilities, writing technical documents, architecture etc.

  • Others

What’s your role?
What’s your architecture of your current project?
Why you are leaving your current organization?
What’s your salary expectation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment