Sunday, September 3, 2023

Interview Questions

.Net
  1. Singleton code
  2. Oops
  3. Abstraction and Encapsulation with example
  4. Linq
  5. IEnumerable vs IList
  6. Collection
  7. How List works internally
  8. Linkedlist
  9. Array vs Arraylist
  10. Boxing and unboxing
  11. Generic method
  12. Get second highest salary in LINQ
  13. How transaction works in LINQ
  14. Get Average in LINQ
  15. Left join in LINQ
  16. Global.asax file
  17. SOLID principle
  18. Abstract class vs interface
  19. Method hiding in c#
  20. Dictionary vs Hashtable
  21. Dictionary vs  List
  22. Use case scenario for dictionary
  23. Explain need of design pattern
  24. Explain predicate
  25. State management
  26. Different ways of parallel programing
  27. Difference between String and StringBuilder
  28. Difference between Finalize and Dispose 
  29. Can we have static parameterized constructor
  30. Queue in C#
  31. IEnumerable vs IEnumerator
  32. Garbage collector and stages
  33. Method overloading criteria


ASP NET CORE 
  1. What is Aspnet core ?
  2. Explain startup.cs
  3. Difference between statrtup.cs and program.cs
  4. What is middleware
  5. What are filters
  6. Async call in aspnet core
  7. What is background service
  8. Attribute routing vs Conventional Routing
  9. What is Repository pattern
  10. Aspnet core life cycle
  11. How to implement cache .. Redis cache ,Distributed cache
  12. Explain Scoped , Transient , Singleton
  13. What is option pattern
  14. validation in aspnet core
  15. What is cors
  16. difference between app.use and app.run
  17. Explain JWT token
  18. Different types of action result
  19. How to implement OAuth
  20. Explain different status code in web api
  21. angular content projection
  22. difference between zone.js and ngZone
  23. Resolve Guard
Ans -

1xx (Informational):

  • 100 Continue: The server has received the request headers and the client should proceed to send the request body.
  • 101 Switching Protocols: The server is indicating a protocol change, typically in response to a Upgrade header from the client.

2xx (Successful):

  • 200 OK: The request was successful, and the server has returned the requested data.
  • 201 Created: The request has been fulfilled, and a new resource has been created as a result.
  • 204 No Content: The request was successful, but there is no response body to return.

3xx (Redirection):

  • 300 Multiple Choices: The request has multiple possible responses, and the client should choose one.
  • 302 Found (or 303 See Other): The requested resource has been temporarily moved to a different URL.
  • 304 Not Modified: The client's cached copy of the resource is still valid.

4xx (Client Errors):

  • 400 Bad Request: The server couldn't understand the request, often due to invalid syntax.
  • 401 Unauthorized: Authentication is required, and the provided credentials are either missing or invalid.
  • 403 Forbidden: The client does not have permission to access the requested resource.
  • 404 Not Found: The requested resource could not be found on the server.

5xx (Server Errors):

  • 500 Internal Server Error: An unexpected error occurred on the server.
  • 501 Not Implemented: The server does not support the functionality required to fulfill the request.
  • 502 Bad Gateway: The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
  • 503 Service Unavailable: The server is currently unable to handle the request due to temporary overloading or maintenance.

 21 Can we return view from api ?

Microservices
  1. What is microservices
  2. Monolithic vs Microservices
  3. Advantages and disadvantages of microservices
  4. Sync and Asyn call
  5. Microservices Qeue

ANGULAR
  1. Difference between JS and typescript 
  2. Angular lifecycle hooks
  3. NgModules
  4. Explain Lazy loading in Angular
  5. What is Directive in Angular
  6. What is pipe method
  7. What is Zone.js
  8. What is change detection strategy
  9.  What is pre loading , can we customize loading , can we load module with some interval
  10. What are rxjs operators
  11. promise vs subscriptions
  12. subject vs Behavior Subject
  13. Providers
  14. Interceptors , HttpInterceptors and Error Interceptor
  15. Treeshaking techniq
  16. What is component
  17. What is service
  18. ngOninit method 
  19. Unit test case
  20. debounce in Angular
  21. model driven form vs template driven form
  22. What is component resolver
  23. server side rendering
  24. ClientSide Sessions
  25. AuthGuards in Angular CanActivate and CanDeactivate

Azure
  1. What is Azure
  2. What is VM
  3. What is Active Directory
  4. What is Storage , Structered ,Semi Strunctured, UnStructured data
  5. MSMQ
  6. Azure Service Bus
  7. Horizontal vs Vertical Scaling
SQL :


Javascript : 

  1.    ES6 features
  2.    var let const
  3.    shallow copy vs deep copy
  4.    closure
  5.    javascript hoisting


Program : 
C# get char occurance from given string




 Javascript Get Max from given array :

 var array = [1,2,3,4,5,9,4,10,6,9];

 var initialValue = 0;

 const output =  array.reduce((a,v)=> v>a?a=v:a,0);

 console.log(output);

 //or
 
 console.log(Math.max(...array));



C# remove duplicate

var name = "google";

string newString = string.Empty;

foreach(Char c in name){
    if(newString.IndexOf(c.ToString())==-1){
        newString=newString+c.ToString();
    }
}

Console.WriteLine(newString);

Output :
gole


In Javascript :

 var name = "google";

console.log([...new Set(name.split(''))].join(''));

Sort Array with single Loop