{
"iq":[{"id":"1",
"q":"What is LINQ?",
"answer":"It stands for Language Integrated Query. LINQ is collection of standard query operators that provides the query facilities into .NET framework language like C# , VB.NET. "
},
{"id":"2",
"q":"How LINQ is beneficial than Stored Procedures? ",
"answer":"There are couple of advantage of LINQ over stored procedures.\n1. Debugging - It is really very hard to debug the Stored procedure but as LINQ is part of .NET, you can use visual studio's debugger to debug the queries.\n2. Deployment - With stored procedures, we need to provide an additional script for stored procedures but with LINQ everything gets complied into single DLL hence deployment becomes easy.\n3. Type Safety - LINQ is type safe, so queries errors are type checked at compile time. It is really good to encounter an error when compiling rather than runtime exception!"
},
{"id":"3",
"q":"Write the basic steps to execute a LINQ query.",
"answer":"The following are the three basic steps to execute a LINQ query:\nObtain the data source (The data source can be either an SQL database or an XML file)\nCreate a query\nExecute the query"
},
{"id":"4",
"q":"In which statement the LINQ query is executed?",
"answer":"A LINQ query is executed in the For Each statement in Visual Basic and in the foreach statement in C#."
},
{"id":"5",
"q":"In LINQ, lambda expressions underlie many of the standard query operators. Is it True or False?",
"answer":"It is true"
},
{"id":"6",
"q":"Explain what is the difference between Statement Lambda and Expression Lambda?",
"answer":"Expression Lambdas are extensively used in the construction of Expression Trees\nTo create expression trees statement lambdas cannot be used "
},
{"id":"7",
"q":"Mention what is the role of DataContext classes in LINQ?",
"answer":"DataContext class acts as a bridge between SQL Server database and the LINQ to SQL. For accessing the database and also for changing the data in the database, it contains connections string and the functions. "
},
{"id":"8",
"q":" Explain what are LINQ query expressions?",
"answer":"Query expression is nothing but an LINQ query. It is a combination of query clauses that identifies the data sources for a query. It contains information for sorting, filtering, grouping or joining to apply to the source data. It determines what information should be retrieved from the data source.CV."
},
{"id":"9",
"q":"Explain what are compiled queries? ",
"answer":"In compiled LINQ queries, the plan is cached in a static class and static class is a global cache. Rather than preparing the query plan from scratch, LINQ prepares plan using stating class object."
},
{"id":"10",
"q":"Explain how standard query operators useful in LINQ?",
"answer":"Standard Query Operators useful in LINQ are\nGet a total count of elements in the collection\nOrder the results of a collection\nGrouping\nComputing average\nJoining two collections based on matching keys\nFilter the results"
},
{"id":"11",
"q":"Explain what is the purpose of LINQ providers in LINQ?",
"answer":"LINQ providers are set of classes that take an LINQ query which generates method that executes an equivalent query against a particular data source."
},
{"id":"12",
"q":"Name a few different return types of a controller action method?",
"answer":"The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that derives from ActionResult class.\n1. ViewResult\n2. JavaScriptResult\n3. RedirectResult\n4. ContentResult\n5. JsonResult"
},
{"id":"13",
"q":"What is the significance of NonActionAttribute?",
"answer":"TIn general, all public methods of a controller class are treated as action methods. If you want prevent this default behaviour, just decorate the public method with NonActionAttribute."
},
{"id":"14",
"q":"What is the extension of the file, when LINQ to SQL is used?",
"answer":"The extension of the file is .dbml."
},
{"id":"15",
"q":"Why can't datareader by returned from a Web Service's Method",
"answer":"because, it's not serializable "
},
{"id":"16",
"q":"What is the LINQ file extension that interacts with Code Behind's objects. ",
"answer":"its .dbml "
},
{"id":"17",
"q":"What is the use of System.XML.XLinq.dll?",
"answer":"System.XML.XLinq.dll contains classes to provide functionality to use LINQ with XML. "
},
{"id":"18",
"q":" Which assembly represents the core LINQ API? ",
"answer":"System.Query.dll assembly represents the core LINQ API. "
},
{"id":"19",
"q":"What is the function of the DISTINCT clause in a LINQ query? ",
"answer":"The DISTINCT clause returns the result set without the duplicate values. "
},
{"id":"20",
"q":"What is the difference between the Take and Skip clauses?",
"answer":"The Take clause returns a specified number of elements. For example, you can use the Take clause to return two values from an array of numbers. The Skip clause skips the specified number of elements in the query and returns the rest. For example, you can use the Skip clause to skip the first four strings in an array of strings and return the remaining array of string. "
},
{"id":"21",
"q":"What The 0/R Designer provides a visual design surface to create LINQ to SQL entity classes and associations (relationships) that are based on objects in a database. "
},
{"id":"22",
"q":"Which extension method do you need to run a parallel query in PLINQ? ",
"answer":"The AsParallel extension method is required to run a parallel query in PLINQ. "
},
{"id":"23",
"q":"What is a LinqDataSource control?",
"answer":"The LinqDataSource control enables you to use LINQ. in an ASP.NET Web page by setting the properties in the markup text. You can use the control retrieve or modify data. It is similar to the SqIDataSource and ObjectDataSource controls in the sense that it can be used to declaratively bind other ASP.NET controls on a page to a data source. The difference is that instead of binding directly to a database or to a generic class, the LinqDataSource control is designed to bind a LINQ enabled data model."
},{"id":"24",
"q":" Which interface implements the standard query operators in LINQ? ",
"answer":"The standard query operators implement the IEnumerable<T> or the IQueryable<T> interface in C# and the IEnumerable(Of T) or the IQueryable(Of T) interface in Visual Basic."
},{"id":"25",
"q":" Which command-line tool generates code and mapping for the LINQ to SQL component of .NET Framework? ",
"answer":"The SqlMetal.exe command-line tool generates code and map the LINQ to SQL component."
},{"id":"26",
"q":"What are lambda expressions in LINQ?",
"answer":"A lambda expression is a function without a name that calculates and returns a single value. All lambda expressions use the lambda operator =>, which read as goes to. The left side of the lambda operator specifies the input parameters and the right side holds the expression or statement block."
},{"id":"27",
"q":" Explain what is “LINQ to Objects”?",
"answer":"When LINQ queries any IEnumerable(Of T) collection or IEnumerable directly without the use of an intermediate LINQ provider or API such as LINQ to SQL or LINQ to XML is referred as “LINQ to Objects.”"
},{"id":"28",
"q":" LINQ query is executed in which statement?",
"answer":" In VB, an LINQ query is executed in the For Each Statement, and in the foreach statement for C#."
},{"id":"29",
"q":"Explain how LINQ with databases can be used?",
"answer":"LINQ supports XML, SQL, Dataset and Objects. Through LINQ to objects or LINQ to Datasets one can use LINQ with other databases. The objects and datasets take care of database particular operations, and LINQ only needs to deal with those objects and not the database operations directly."
},{"id":"30",
"q":"Explain what is the difference between Skip() and SkipWhile() extension method? ",
"answer":"Skip() : It will take an integer argument and from the given IEnumerable it skips the top n numbersSkipWhile (): It will continue to skip the elements as far as the input condition is true. It will return all remaining elements if the condition is false"
}
]
}
"iq":[{"id":"1",
"q":"What is LINQ?",
"answer":"It stands for Language Integrated Query. LINQ is collection of standard query operators that provides the query facilities into .NET framework language like C# , VB.NET. "
},
{"id":"2",
"q":"How LINQ is beneficial than Stored Procedures? ",
"answer":"There are couple of advantage of LINQ over stored procedures.\n1. Debugging - It is really very hard to debug the Stored procedure but as LINQ is part of .NET, you can use visual studio's debugger to debug the queries.\n2. Deployment - With stored procedures, we need to provide an additional script for stored procedures but with LINQ everything gets complied into single DLL hence deployment becomes easy.\n3. Type Safety - LINQ is type safe, so queries errors are type checked at compile time. It is really good to encounter an error when compiling rather than runtime exception!"
},
{"id":"3",
"q":"Write the basic steps to execute a LINQ query.",
"answer":"The following are the three basic steps to execute a LINQ query:\nObtain the data source (The data source can be either an SQL database or an XML file)\nCreate a query\nExecute the query"
},
{"id":"4",
"q":"In which statement the LINQ query is executed?",
"answer":"A LINQ query is executed in the For Each statement in Visual Basic and in the foreach statement in C#."
},
{"id":"5",
"q":"In LINQ, lambda expressions underlie many of the standard query operators. Is it True or False?",
"answer":"It is true"
},
{"id":"6",
"q":"Explain what is the difference between Statement Lambda and Expression Lambda?",
"answer":"Expression Lambdas are extensively used in the construction of Expression Trees\nTo create expression trees statement lambdas cannot be used "
},
{"id":"7",
"q":"Mention what is the role of DataContext classes in LINQ?",
"answer":"DataContext class acts as a bridge between SQL Server database and the LINQ to SQL. For accessing the database and also for changing the data in the database, it contains connections string and the functions. "
},
{"id":"8",
"q":" Explain what are LINQ query expressions?",
"answer":"Query expression is nothing but an LINQ query. It is a combination of query clauses that identifies the data sources for a query. It contains information for sorting, filtering, grouping or joining to apply to the source data. It determines what information should be retrieved from the data source.CV."
},
{"id":"9",
"q":"Explain what are compiled queries? ",
"answer":"In compiled LINQ queries, the plan is cached in a static class and static class is a global cache. Rather than preparing the query plan from scratch, LINQ prepares plan using stating class object."
},
{"id":"10",
"q":"Explain how standard query operators useful in LINQ?",
"answer":"Standard Query Operators useful in LINQ are\nGet a total count of elements in the collection\nOrder the results of a collection\nGrouping\nComputing average\nJoining two collections based on matching keys\nFilter the results"
},
{"id":"11",
"q":"Explain what is the purpose of LINQ providers in LINQ?",
"answer":"LINQ providers are set of classes that take an LINQ query which generates method that executes an equivalent query against a particular data source."
},
{"id":"12",
"q":"Name a few different return types of a controller action method?",
"answer":"The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that derives from ActionResult class.\n1. ViewResult\n2. JavaScriptResult\n3. RedirectResult\n4. ContentResult\n5. JsonResult"
},
{"id":"13",
"q":"What is the significance of NonActionAttribute?",
"answer":"TIn general, all public methods of a controller class are treated as action methods. If you want prevent this default behaviour, just decorate the public method with NonActionAttribute."
},
{"id":"14",
"q":"What is the extension of the file, when LINQ to SQL is used?",
"answer":"The extension of the file is .dbml."
},
{"id":"15",
"q":"Why can't datareader by returned from a Web Service's Method",
"answer":"because, it's not serializable "
},
{"id":"16",
"q":"What is the LINQ file extension that interacts with Code Behind's objects. ",
"answer":"its .dbml "
},
{"id":"17",
"q":"What is the use of System.XML.XLinq.dll?",
"answer":"System.XML.XLinq.dll contains classes to provide functionality to use LINQ with XML. "
},
{"id":"18",
"q":" Which assembly represents the core LINQ API? ",
"answer":"System.Query.dll assembly represents the core LINQ API. "
},
{"id":"19",
"q":"What is the function of the DISTINCT clause in a LINQ query? ",
"answer":"The DISTINCT clause returns the result set without the duplicate values. "
},
{"id":"20",
"q":"What is the difference between the Take and Skip clauses?",
"answer":"The Take clause returns a specified number of elements. For example, you can use the Take clause to return two values from an array of numbers. The Skip clause skips the specified number of elements in the query and returns the rest. For example, you can use the Skip clause to skip the first four strings in an array of strings and return the remaining array of string. "
},
{"id":"21",
"q":"What The 0/R Designer provides a visual design surface to create LINQ to SQL entity classes and associations (relationships) that are based on objects in a database. "
},
{"id":"22",
"q":"Which extension method do you need to run a parallel query in PLINQ? ",
"answer":"The AsParallel extension method is required to run a parallel query in PLINQ. "
},
{"id":"23",
"q":"What is a LinqDataSource control?",
"answer":"The LinqDataSource control enables you to use LINQ. in an ASP.NET Web page by setting the properties in the markup text. You can use the control retrieve or modify data. It is similar to the SqIDataSource and ObjectDataSource controls in the sense that it can be used to declaratively bind other ASP.NET controls on a page to a data source. The difference is that instead of binding directly to a database or to a generic class, the LinqDataSource control is designed to bind a LINQ enabled data model."
},{"id":"24",
"q":" Which interface implements the standard query operators in LINQ? ",
"answer":"The standard query operators implement the IEnumerable<T> or the IQueryable<T> interface in C# and the IEnumerable(Of T) or the IQueryable(Of T) interface in Visual Basic."
},{"id":"25",
"q":" Which command-line tool generates code and mapping for the LINQ to SQL component of .NET Framework? ",
"answer":"The SqlMetal.exe command-line tool generates code and map the LINQ to SQL component."
},{"id":"26",
"q":"What are lambda expressions in LINQ?",
"answer":"A lambda expression is a function without a name that calculates and returns a single value. All lambda expressions use the lambda operator =>, which read as goes to. The left side of the lambda operator specifies the input parameters and the right side holds the expression or statement block."
},{"id":"27",
"q":" Explain what is “LINQ to Objects”?",
"answer":"When LINQ queries any IEnumerable(Of T) collection or IEnumerable directly without the use of an intermediate LINQ provider or API such as LINQ to SQL or LINQ to XML is referred as “LINQ to Objects.”"
},{"id":"28",
"q":" LINQ query is executed in which statement?",
"answer":" In VB, an LINQ query is executed in the For Each Statement, and in the foreach statement for C#."
},{"id":"29",
"q":"Explain how LINQ with databases can be used?",
"answer":"LINQ supports XML, SQL, Dataset and Objects. Through LINQ to objects or LINQ to Datasets one can use LINQ with other databases. The objects and datasets take care of database particular operations, and LINQ only needs to deal with those objects and not the database operations directly."
},{"id":"30",
"q":"Explain what is the difference between Skip() and SkipWhile() extension method? ",
"answer":"Skip() : It will take an integer argument and from the given IEnumerable it skips the top n numbersSkipWhile (): It will continue to skip the elements as far as the input condition is true. It will return all remaining elements if the condition is false"
}
]
}