Wednesday, 17 July 2019

Insight InterGlobe Technologies (IGT)

Note: All this data has been copied from various sources for the purpose of knowledge sharing. Data content  can be either as it is or with little modification.
---------------------------------------------------------------------------------------------------------------------

1. What is the purpose of using properties?
properties are smart fields. Smart being you can add logic when you want to get or set the value.
 implementation of read only properties could be as follows
 int positiveNumber;

    public int PositiveNumber
    {
        get { return positiveNumber; }


    }

2. What is state management?

State management means to preserve state of a control, web page, object/data, and user in the application explicitly because all ASP.NET web applications are stateless, i.e., by default, for each page posted to the server, the state of controls is lost. Nowadays all web apps demand a high level of state management from control to application level.]

3. What are Difference between Store Procedure and functions?


4. What is Triggers? Explain different type of Triggers?
5. Explain steps to create CLR Triggers.
6. What is identity column?
7. What is the difference between out and ref keyword in parameters?
11. What is difference between truncate and delete command?
12. What are different types of authentication mode in ASP.NET?
13. How to implement form authentication?
14. How to implement Passport authentication?
15. What is SQL Injection? How it can be preveneted?
16. What is Serialization and De-serialization?
17. What is marshalling and unmarshalling?
18. What is Globe.aspx file and what for it is used?
19. Can we have multiple master pages in a web application?
20. What is Web Farms and Web Garden?
21. How to create public assembly?
22. What is the difference between finally and Dispose?
23. Can we manually force Garbage collector to reclaim unreferenced objects?
24. What is the difference between Primary Key and Unique Key?
25. What is normalization and different type of normalization forms? Give example?
26. Write down example of right outer join?
27. How to achieve polymorphism in c#?
28. What is abstract class?
29. What are the differences between abstract class and Interface?
30. Can be inherit multiple base classes in a drive class?
31. Can be have private methods inside Interface?
32. What is encapsulation and abstraction?



1. what are view bag ?
2. Tell the requesting process of a . when user hits a URL.
3. what are connection pool 
4. what is obejct pooling
5. what is application pooling ?
6. what is code access security ?
7. what is the extension of linq to sql file ?
8. what are quantifiers in linq ?
9. which one is better linq query or a stored procedure ?
10. what is the mechanism behind the linq to sql ?
11. what are areas in MVC ?
12 . what are HTTP handlers and HTTP modules ?
13. what are filters in MVC ? different types of filters ?
14. What are attributes ?
15. what are different types of action result ?
16. what is wsdl ?
17. what is the difference between wsdl and ubi in web services ?
18. what is serialization and how many types of serialization is there ?
19. what is the diff btw binary serialization and xml serialization ?
20. what is remoting ?
21. how can we implement sessions in .net ? what is the mechanism behind it ? 
22. what are the different types of session state management options OR session management options OR session-state modes are 

there?
23. what are different ASP.NET State Management options? OR List different ways that help to preserve data on both a per-page 

basis and an application-wide  
basis ?
24. what are views in sql ? is we can update data through views ? and how ? what is the procedure to update data ?
24. what are triggers ? how may types of triggers are there ?
25 . can we call a trigger form stored procedure ?
26.  what is the diff btw truncate and delete command ?
27. what id DBMS ?
28. What is the diff btw DBMS nd RDBMS ?
29. What is the 5 th codd rule ?
30. what is jquery ?
31. what is the use of $ sign ? 
32. if we want to select something , can we use anything else instead of $ or jquery in jquery?
33. if we want to disable a control using jqury , what we have to use ?
34. how we can make ajax call using jquery ?
35. how we can call a web service using jquery ?
36. what is polymorpphism ? how may types are there ?
37. what is overiding ? can we overide an abstract method ? ANS : yes , multiple times
38. can we override a virtual method ?
39. if we over riding a abstract method in a derived class , can we override it again in another derived class ? ANS : YES
40. what is n- tier architecture ?
41. what is the architecture of your project ? how many layers are there ? 
42. what is the output of  "1" + 1 in javascript ? ANS : 11
43 . what is the output of 1 + "1" + 1 in javascript ? ANS : 111
44. what are lamda expressions ? what comes before and after the  =>  sign ?
45.  what are partial views in MVC?
46. What is done in the inialization phase of MVC application ? ANS : Registering all areas and routes .
47. what is the diff btw a view and stored procedure ? where we have to use stored procedure and where a view ?
48. what is windows service ?
49. which namespace we have to use for window service ?
50.  what we have to do to install a webservice ? 
51. what are after and instead of triggers ?


52. what are clustered and non-clusteres indexes ?


53. how many clustered and non-clustered indexes can be there ?

Only one; and 999 non-clustered indexes

54. what is diff btw a ASPX and RAZOR engine ?

Syntax in @Razor is much prettier.

55. what is the difference btw response.redirect and server.transfer ?

Response.Redirect should be used when:
  • we want to redirect the request to some plain HTML pages on our server or to some other web server
  • we don't care about causing additional roundtrips to the server on each request
  • we do not need to preserve Query String and Form Variables from the original request
  • we want our users to be able to see the new redirected URL where he is redirected in his browser (and be able to bookmark it if its necessary)


Server.Transfer should be used when:

  • we want to transfer current page request to another .aspx page on the same server
  • we want to preserve server resources and avoid the unnecessary roundtrips to the server
  • we want to preserve Query String and Form Variables (optionally)
  • we don't need to show the real URL where we redirected the request in the users Web Browser
  • Server.Transfer happens without the browser knowing anything, the browser request a page, but the server returns the content of another.
the "transfer" process can work on only those sites running on the server, you can't use Server.Transfer to send the user to an external site. Only Response.Redirect can do that.



56. what is round trip in which mechanism round trip occurs in response.redirect or server.transfer ?

Roundtrip is the process of doing a postback on a web page and then having the server process the postback, generate a new page, and send the results back to the browser.
For example, if you created a simple web page that only had a button on it, clicking on the button would create a roundtrip (the browser sends the form back to the server, including the fact that you clicked the button, the server processes any code you attached to the button click event, creates a new page with the latest state of the page, and sends it back to the browser). That's one round trip.

round trip happen in response.redirect

57. what new features are added from MVC2.0 to MVC3.0 ?


58. How can you do error handling in a stored procedure ?

SQL Server now supports the use of TRY…CATCH.
BEGIN TRY
<code>
END TRY
BEGIN CATCH
<code>

END CATCH

59. what is the difference between UNION and UNION ALL ?
UNION removes duplicate records (where all columns in the results are the same), UNION ALL does not.There is a performance hit when using UNION vs UNION ALL, since the database server must do additional work to remove the duplicate rows, but usually you do not want the duplicates (especially when developing reports).

Friday, 5 July 2019

Question SET 1


  1. Relation between JQuery and Javascript?
  2. Difference between Abstract Class and Interface?
  3. While updating a table you get an error. How you will roll back the changes?
  4. There are 4 records in a table with your name. There is no primary key. How can you delete two records out of 4 records?
  5. What are indexes. What are different types of indexes present in MS sql server. 
  6. Difference between string and string builder.
  7. What does immutable mean in string builder?
  8. What are delegates? 
  9. Delegates are value type or reference type? - Reference type
  10. Difference between User defined function and Procedures. 
  11. Where all you use 4 pillars of OOPS concept. Give examples.
  12. Difference between session and Cache.
  13. Difference between creating an object and Inherting a class. 
====
  1. Javascript is a language while Jquery is a library build on top of Javascript. JQuery help to complete common task that can be done by Javascript in easy way. It is basically used to reduce the amount of work required to create web based application. 
  2. Abstract Class
    Interface
    It can contain both abstract methods and non abstract methods. Methods of abstract class implement default behavior.
    Interface contains only abstract method and methods cannot have implementation.
    Multiple inheritance cannot be achieved.
    Multiple inheritances can be achieved by Interface.
    It can contain all types of modifiers like private
    It can contain only public modifier
    Performance is fast.
    Performance is slow because it time to find the actual method in corresponding class.
  3. We can use transaction to roll back changes. 
    BEGIN TRAN
    BEGIN TRY
      update tbl set City='chennai',LastName='vinoth' from aa AS tbl;

      -- if update is what you want then
      COMMIT TRAN
    END TRY
    BEGIN CATCH
      -- if NOT then
      IF @@TRANCOUNT > 0
          ROLLBACK
      THROW
    END CATCH

  4. One option that SQL Server gives you is the ability to set ROWCOUNT
  5. SELECT * FROM dbo.duplicateTest 
     
    SET ROWCOUNT 1 
    DELETE FROM dbo.duplicateTest WHERE ID = 1 
    SET ROWCOUNT 0 
     
    SELECT * FROM dbo.duplicateTest 
    DELETE TOP(1) FROM dbo.duplicateTest WHERE ID = 1 
    >> We can delete using  RowNumber, Rank with CTE also.

Policy Bazzar


  1. How to transfer a Value from Textbox present in a.html page to b.html page.
  2. Difference between Lambda expression and Lambda Statement?
==================


  1. If we are doing in basic way then there could be mutliple ways by which we can transfer data between html pages like
    1. URL String parameters,  -- https://stackoverflow.com/questions/17502071/transfer-data-from-one-html-file-to-another
    2. Cookies, 
    3. LocalStorage

DML an DDL

DML

DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database.

SELECT – Retrieves data from a table
INSERT -  Inserts data into a table
UPDATE – Updates existing data into a table
DELETE – Deletes all records from a table

DDL

DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database.

CREATE – Creates objects in the database
ALTER – Alters objects of the database
DROP – Deletes objects of the database
TRUNCATE – Deletes all records from a table and resets table identity to initial value.

Thursday, 4 July 2019

Abstract Class and Interface

An Abstract class without any implementation just looks like an Interface.

Abstract class-
An abstract class is a special kind of class that cannot be instantiated. So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.

Interface-
An interface is not a class. It is an entity that is defined by the word Interface. An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class, it is a contract that is used to define hierarchies for all subclasses or it defines specific set of methods and their arguments. The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class. Since C# doesn’t support multiple inheritance, interfaces are used to implement multiple inheritance.


When we create an interface, we are basically creating a set of methods without any implementation that must be overridden by the implemented classes. The advantage is that it provides a way for a class to be a part of two classes: one from inheritance hierarchy and one from the interface.
When we create an abstract class, we are creating a base class that might have one or more completed methods but at least one or more methods are left uncompleted and declared abstract. If all the methods of an abstract class are uncompleted then it is same as an interface. The purpose of an abstract class is to provide a base class definition for how a set of derived classes will work and then allow the programmers to fill the implementation in the derived classes.


FeatureInterfaceAbstract class
Multiple inheritanceA class may inherit several interfaces.A class may inherit only one abstract class.
Default implementationAn interface cannot provide any code, just the signature.An abstract class can provide complete, default code and/or just the details that have to be overridden.
Access ModfiersAn interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as publicAn abstract class can contain access modifiers for the subs, functions, properties
Core VS PeripheralInterfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.An abstract class defines the core identity of a class and there it is used for objects of the same type.
HomogeneityIf various implementations only share method signatures then it is better to use Interfaces.If various implementations are of the same kind and use common behaviour or status then abstract class is better to use.
SpeedRequires more time to find the actual method in the corresponding classes.Fast
Adding functionality (Versioning)If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.
Fields and ConstantsNo fields can be defined in interfacesAn abstract class can have fields and constrants defined



Wednesday, 3 July 2019

Classes and Structures

Class
Structure
Reference type
Value type
Supports inheritance
Does not support inheritance
Has default constructors
Does not have default constructors but parameterized constructors are allowed