0% found this document useful (0 votes)
147 views

Practice Test

The following document contains questions about logic development, algorithm analysis and design concepts, database management systems (DBMS) concepts and SQL. For each question, there are multiple choice options for the correct answer. Some key points covered in the questions include advantages of modular programming, good programming practices like naming conventions and modularity, defensive programming techniques like input validation, SQL joins, data types, comparison operators, stored procedure optimization techniques, and SQL commands. The questions test understanding of logic and algorithm design principles, relational database concepts, and the SQL language.

Uploaded by

Pravin Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
147 views

Practice Test

The following document contains questions about logic development, algorithm analysis and design concepts, database management systems (DBMS) concepts and SQL. For each question, there are multiple choice options for the correct answer. Some key points covered in the questions include advantages of modular programming, good programming practices like naming conventions and modularity, defensive programming techniques like input validation, SQL joins, data types, comparison operators, stored procedure optimization techniques, and SQL commands. The questions test understanding of logic and algorithm design principles, relational database concepts, and the SQL language.

Uploaded by

Pravin Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Topic Q text Option/ Answer 1 Option/ Answer 2 Option/ Answer 3 Option/ Answer 4 Option/ Option/ Correct

Answer Answer Answer


Logic Development / Which of the following are advantages of modular Modification in any module The changes made in an The main module becomes The modules introduce 1,2
Algorithm Analysis programming ? will not affect our main appropriate function will affect independent of the sub defensive programming
and Design Concepts module only that module other modules and coupling is technique by minimizing
modules will remain zeroed. testing effort.
unaffected.

Logic Development / Consider the below pseudocode: Layout Naming Conventions Modularity Maintainability 1
Algorithm Analysis
and Design Concepts BEGIN
content[30]= "Pseudocode"
FOR i=0 to content[i] not equal to end of
character
If (content[i]>=97 AND content[i]<=122)
Then
content[i]=content[i]-32;
END IF
END FOR
END

Which of the good programming practices have


been followed in the above code?
Logic Development / Consider the below statements: Error Handling Output Validation Input Validation None of the above 3
Algorithm Analysis
and Design Concepts A) Password should be of length 10 digits
B) Password can be alpha-numeric

Which of the defensive programming technique


would be used to implement the above
requirement
while writing the program?
Logic Development / Consider the below form to Book a Rail Ticket. 100 tickets is Valid. 0 and less than zero is Invalid. 10 is Valid. 11 is Invalid. 2,3,4
Algorithm Analysis
and Design Concepts

The user can book only ten tickets with a


transaction. Choose the valid equivalence
partitioning for Number of Tickets field in the given
scenarion.
Logic Development / Select the valid statements w.r.t software testing Software testing is in a way a Software testing is a process Software testing is Verifying Software testing is the process 4
Algorithm Analysis destructive process used to help identify the and Validating if the Software of executing a program with
and Design Concepts correctness, completeness and is working as it is intended to the intent of finding the errors
quality of a developed be working
computer software

DBMS Concepts & Sonali wants to include all rows from both emp and SELECT Empid, Empname, SELECT Empid, Empname, SELECT Empid, Empname, SELECT Empid, Empname, 4
SQL (RDBMS) dept tables, regardless of whether or not the other DeptID, DeptName DeptID, DeptName DeptID, DeptName DeptID, DeptName
table has a matching value. Which Join you would FROM Emp CROSS OUTER JOIN FROM Emp RIGHT OUTER JOIN FROM Emp LEFT OUTER JOIN FROM Emp FULL OUTER JOIN
recommend her? Dept Dept Dept Dept
ON Dept.DeptID= Emp.DeptID ON Dept.DeptID= Emp.DeptID ON Dept.DeptID= Emp.DeptID ON Dept.DeptID= Emp.DeptID

DBMS Concepts & You need to define multiple groupings in the same GroupBy Order By Grouping Sets Top command 3
SQL (RDBMS) query. Which SQL Server feature you will use?

DBMS Concepts & Mahesh needs to store many email addresses in his Hierarchyid Alias XML Varchar 3
SQL (RDBMS) employee database, in various tables. Which data
type you would recommend Mahesh?
DBMS Concepts & __________ stores values of various SQL Server- Sql variant table XML Max 1
SQL (RDBMS) supported data types.
DBMS Concepts & To list all those products whose price is above all SELECT ProductID, SELECT ProductID, SELECT ProductID, SELECT ProductID, 3
SQL (RDBMS) the price of products supplied by supplier 10098 ProductName, SupplierID ProductName, SupplierID ProductName, SupplierID ProductName, SupplierID
FROM Products FROM Products FROM Products FROM Products
WHERE UnitPrice > ANY (Select WHERE UnitPrice > SOME WHERE UnitPrice > ALL (Select WHERE EXISTS (Select
UnitPrice FROM Products (Select UnitPrice FROM UnitPrice FROM Products UnitPrice FROM Products
WHERE SupplierID=10098) Products WHERE WHERE SupplierID=10098) WHERE SupplierID=10098)
SupplierID=10098)
DBMS Concepts & Manoj need to optimize the queries for his RECOMPILE SCHEMABINDING ENCRYPTION NO RECOMPILE 1
SQL (RDBMS) InsertCustomer Stored Procedure. What he should
specify while creating the Stored Procedure?

DBMS Concepts & The __________ option obfuscates the definition WITH ENCRYPTION RECOMPILE SCHEMA BINDING NO RECOMPILE 1
SQL (RDBMS) of the procedure when querying the system catalog
or using metadata functions
DBMS Concepts & For his Online Banking WebSite Rahul wish to Fetch and OffSet GroupBy Grouping Sets Order By 1
SQL (RDBMS) display just a small selection of customer details
region wise. Which SQL command you would
suggest Rahul?
DBMS Concepts & Choose the correct query to find out all customers SELECT CustomerID FROM SELECT CustomerID FROM SELECT CustomerID FROM SELECT CustomerID FROM 1
SQL (RDBMS) who haven't placed any order. Customers Customers Customers Customers
EXCEPT INTERSECT UNION UNION ALL
SELECT CustomerID FROM SELECT CustomerID FROM SELECT CustomerID FROM SELECT CustomerID FROM
Orders Orders Orders Orders
DBMS Concepts & What would be the result of the following The statement increases the The statement increases the The statement increases the The statement increases the 1
SQL (RDBMS) statement in T-SQL ? Salary of all Employees by 5 Salary of all Employees by 50 Salary of first record in Salary of last record in
UPDATE dbo.EmployeePayDetails percent percent EmployeePayDetails by 5 EmployeePayDetails by 5
SET Salary = Salary + 0.05*Salary; percent percent
DBMS Concepts & What will be the output of this query? It will display the name of all It will display the name of all Error in the syntax of query It will display the name of all 4
SQL (RDBMS) SELECT pname Products under Electronics Products not under Electronics Products under Electronics or
FROM Products and Computers Computers
WHERE categoryId IN (SELECT CategoryId
FROM Category
WHERE categoryName
IN('Electronics', ' Computers'))
DBMS Concepts & What would the following subquery imply? This would return the highest This would return the second This would return second This would return the second 2
SQL (RDBMS) SELECT Min(salary) salary of employee lowest salary of employee highest salary of employee lowest salary of employee if
FROM employees NOT is excluded from the
WHERE salary NOT IN (SELECT Min(salary) FROM query
employees)
DBMS Concepts & Which of the following in SQL Server makes the @@ERROR RAISE ExceptionName RAISERROR None of the above 3
SQL (RDBMS) execution to jump from a TRY block to the
associated CATCH?
DBMS Concepts & Assume a Course table with columns CourseId, SELECT * SELECT * SELECT * SELECT * 1
SQL (RDBMS) Title, Duration. Choose appropriate query to list FROM Course FROM Course FROM Course FROM Course
out all titles which contains the word "Database". WHERE title LIKE WHERE title LIKE 'Database' WHERE title ='Database%' WHERE title LIKE %'Database'
'%Database%'
DBMS Concepts & State whether True or False: Both are true Both are false Statement 1 is true and 2 is Statement 1 is false and 2 is 3
SQL (RDBMS) 1. Return Statement unconditionally terminates a false true
query or a stored procedure or a batch.
2. Throw statement contains a severity parameter
to specify the Severity level of the exception
thrown
DBMS Concepts & Identify the Domain Constraint type. CHECK UNIQUE DEFAULT FOREIGN KEY 1
SQL (RDBMS)
DBMS Concepts & Which of the following are not types of Views in Standard Views Partitioned View Non-IndexedView Special Views 3,4
SQL (RDBMS) SQL Server?
HTML CSS & <!DOCTYPE HTML> Wrong attributes used, instead The first date is displayed from The first date is displayed from Min and Max attributes have 3
JavaScript,XML <html> use "minimum" and December, 1979 and after that December, 1979 and before no effect on input type as date
<body> "maximum" with input type and will span to year 1980 or that and will not span to year and date picker shows current
<form action=""> date to apply constraints afterwards. The second date is 1980 or afterwards. The date
Enter a date before 1980-01-01: displayed before year 2000 second date is displayed after
<input type="date" name="bday" max="1979-12- year 2000 and not before
31">
<br>
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-
01">
<br>
<input type="submit">
</form>
</body>
Given the above code snippet in HTML5, what date
the date picker will display ?
</html>
HTML CSS & Which of the following code will help me to create
<input type="text" <input type="date" <input type="month" <input type="monthyear" 3
JavaScript,XML the textbox to select month and year name="bday" name="date"> name="bdaymonth"> name="date">
list="monthList"/>
<datalist id="monthlist">
<option value="January">
<option value="February">
<option value="March">
<option value="April">
<option value="May">
<option value="June">
<option value="July">
<option value="August">
HTML CSS & Rakshana likes to create an input field only to <input type="text" <textarea <textarea>Content</textarea> <textarea value="Content" 2
JavaScript,XML display contents and contents length may exceeds value="Content" readonly/> readonly>Content</textarea> disabled/>
more than one line. Which statement is more
suitable for this requirement?

HTML CSS & Consider the below code snippet: User will able to select more Default selected country is Name of this drop down list By default, all the options are 2,3
JavaScript,XML Select a country: than one country from this list "India" box is "country" visible in the drop down list
<select name="country"> box.
<option value="Germany">Germany</option>
<option value="India" selected>India</option>
<option value="China">China</option>
<option value="Japan" >Japan</option>
</select>

Which of the statement(s) is/are true about the


above given code snippet?
HTML CSS & Which of the following selector will apply the style .hover :hover :onfocus .onfocus 2
JavaScript,XML on the element designated by a pointing device?

HTML CSS & Match the following: 1-b, 2-c, 3-d, 4-a 1-b, 2-d, 3-c, 4-a 1-b, 2-c, 3-a, 4-d 1-c, 2-b, 3-d, 4-a 1
JavaScript,XML
1) *
2) #Data
3) .Data
4) :Data

a) Pseudoclasses selector
b) Universal Selector
c) Id Selector
d) Class Selector

HTML CSS & Consider HTML code snippet: document.frm.skill[index1].sel document.frm.skill[index1].che document.frm.skill[index1].dis document.frm.skill[index1].unc 2
JavaScript,XML ected cked abled hecked
<input type="checkbox" value="Web Basics"
name="skill"/>WebBasics
<input type="checkbox" value="Oracle"
name="skill"/>Oracle<BR>
<input type="checkbox" value="Core Java"
name="skill"/>Core Java
<<input type="checkbox" value="Spring"
name="skill"/>Spring

Consider JavaScript Code snippet:

1:function validate() {
2: var len1=document.frm.skill.length;
3: var skillsList='';
4: var count=0;
5: for(index1=0;index1<len1;index1++) {
6: if(________________________) {
7: count++;
8: skillsList=skillsList+" ,
"+document.frm.skill[index1].value; }
9: }
10: if(count==0) {
11: alert("Select any one of the skills");
12: return false;
13: } else {
14: alert("Selected skills"+skillsList+"\nSelected
HTML CSS & city "+document.frm.city.value);
Which of the event handlers are supported in OnClick OnChange OnMouseUp OnMouseDown 1,3,4
JavaScript,XML button objects?
HTML CSS & You have an application which enables a user to Use decode method. Use append method. Use escape method. Use encode method. 3
JavaScript,XML enter a URL. The URL may contain spaces, which
are not supported in requests which are sent from
browsers. You need to solve this problem by
replacing the space by a special symbol like %. How
can this be achieved?

HTML CSS & What would be printed, if the following function is Nothing is printed. Prints a random date. The function does not compile. Prints the current date. 4
JavaScript,XML invoked? Variable "date" is not declared.
function printDay()
{
date=new Date();
document.write(date.getDate());
}

HTML CSS & Consider the below code snippet: <xs:attribute name="id" <xs:attribute name="id" <xs:attribute name="id" <xs:attribute name="id" 3
JavaScript,XML <employee id="rj2222"></employee> type="xs:string"/> type="xs:string" mandatory/> type="xs:string" type="xs:string"
By default, all the attributes use="required"/> required="true"/>
Which XML schema code snippet is valid to are mandatory to be used in
describe that an "id" attribute is mandatory to be an element.
used in "employee" element?

HTML CSS & Which of the following statements are false only i i & ii iii & iv ii & iii 1
JavaScript,XML w.r.t. XML?

i) XML document can contain more than one root


element.
ii) XML tags are case sensitive.
iii) XML document can contain empty elements.

OOP UML What will be true as per below diagram? NetProfit attribute is Discount attribute is accessible NetProfit attribute is CustomerCode attribute is not 3,4
accessible in all classes only within the component. accessible only within the accessible in other class.
component.

OOP UML Which of the following is not a true UML diagram? Activity Diagram Object Diagram Deployment Diagram Data Flow Diagram Class 4
Diagram
OOP UML When two or more classes serve as base class for a Multiple inheritance Polymorphism Encapsulation hierarchical inheritance 1
derived class the situation is know as?
OOP UML Which access Modifier ensures encapsulation of public protected private protected internal 3
data?
OOP UML Consider an online shopping site named Is - A relationship Has - A relationship Realization Generalization 2
"shoppee.com". Customers are supposed to fill a
form for ordering the items. What relationship
exists between form and fields available in the
form?
OOP UML Match the following notations with relevant 1. d 1. b 1. d 1. b 3
diagrams: 2. c 2. c 2. a 2. d
1. Swim lanes a. Sequence Diagram 3. b 3.d 3. b 3. c
2. Lifeline b. Usecase Diagram 4. a 4. a 4. c 4. a
3. Stick figure c. Object Diagram
4. Links d. Activity Diagram
.NET Framework and Check the following : 1 - True, 2- False, 3 - False, 4 - 1 - False, 2- False, 3 - False, 4 - 1 - True, 2- False, 3 - True, 4 - 1 - True, 2- True, 3 - False, 4 - 1
C# 5.0 1. Type safety of the code is assured by CLR True True True True
2. CLR is a compiler for .NET Framework
3. CLR provides services to run unmanaged
applications
4. CLR provides a code-execution environment that
manages code targeting the .NET Framework

.NET Framework and Check the following : 1 - True, 2 - True, 3- False, 4 - 1 - True, 2 - True, 3- True, 4 - 1 - True, 2 - True, 3- False, 4 - 1 - True, 2 - True, 3- True, 4 - 2
C# 5.0 1. .NET class library is a collection of reusable True False False True
classes, or types, that tightly integrate with the
common language runtime.
2. The class library builds on the object-oriented
nature of the runtime.
3. .NET class library reduces the learning curve
associated with using a new piece of code.
4. Third-party components can not integrate with
the classes in the .NET Framework.
.NET Framework and Which of the following is not correct about await? The ‘await’ keyword is applied await blocks the thread on await signals to the compiler Once the task is completed, 2
C# 5.0 on the task in an asynchronous which it is executing to continue with other async await resumes back where it
method and suspends the methods, till the task is in an left off from
execution of the method, until await state
the awaited task is not
completed

.NET Framework and Ashmita has created a class library named sn –k ClientLogic.snk gacutil –i ClientLogic.dll gacutil –u ClientLogic sn –k ClientLogic 1,2
C# 5.0 ClientLogic to which she wants to add a strong
name key and get the same registered in the GAC.
What are the command that she needs to use on
the Visual Studio command Prompt to get this
done?
.NET Framework and Which of the following component manages CLR CTS CLS FCL 1
C# 5.0 lifecycle of objects by reference counting and
garbage collection?
.NET Framework and MVC is introduced in which version of .NET .NET Framework 3.0 .NET Framework 3.5 .NET Framework 3.5 + SP1 .NET Framework 4.0 3
C# 5.0 Framework?
.NET Framework and Which of the following library is introduced in .NET Task Based Async Model Task Parallel Library LINQ DLR 1
C# 5.0 Framework 4.5?
.NET Framework and Which of the following statement is correct about The collection of values are Compile Time Error : Can not Compile Time Error : Can not Runtime Error 3
C# 5.0 the below code snippet? assigned to marks covert implicitly initialize variable with array
initializer
Var marks = {"aa",10,2.3};
.NET Framework and Predict the output of the following code. Char : 2 Char : 1 Char : 2 Char : 1 1
C# 5.0 Boolean : 1 Boolean : 1 Boolean : 1 Boolean : 1
static void Main(string[] args) Unsigned Short : 2 Unsigned Short : 2 Unsigned Short : 2 Unsigned Short : 2
{ Single : 4 Single : 4 Single : 2 Single : 2
Console.WriteLine("Char : {0}", sizeof(char));
Console.WriteLine("Boolean : {0}",
sizeof(bool));
Console.WriteLine("Unsigned Short : {0}",
sizeof(short));
Console.WriteLine("Single : {0}",
sizeof(Single));

Console.ReadKey();
}

.NET Framework and What will be the output of the following code? CORP CORPORATE CORPORATE CORP 4
C# 5.0
static void Main(string[] args)
{
string str1 = "CAPGEMINI CORPORATE
UNIVERSITY";
string substr;

substr = str1.Substring(10, 4);

Console.WriteLine(substr);
Console.ReadKey();
}
.NET Framework and How many elements will be there in the following 8 12 18 29 3
C# 5.0 array?
int [ , , ] arr = new int [3, 2, 3];
.NET Framework and Which of the following are the correct ways to Nullable int Nullable<Int32> Nullable Int32 int Nullable int? 2,5
C# 5.0 declare the nullable integer variable? Nullable
.NET Framework and Which of the following is the correct syntax to class Maths class Maths class Maths class Maths 2
C# 5.0 create write only property? { { { {
int num; int num; public int Num int num;
{
public writeonly int Num public int Num set public Num
{ { { {
get set num = value; set
{ { } {
return num; num = value; } num = value;
} } } }
set } }
{ } }
num = value;
}
}
}
.NET Framework and Shape Draw Method Shape Draw Method Square Draw Method Shape Draw Method 2
C# 5.0 What will be the output of the following code? Shape Draw Method Square Draw Method Square Draw Method Square Draw Method
Square Draw Method
class Shape
{
public void Draw()
{
Console.WriteLine("Shape Draw Method");
}
}

class Square:Shape
{
public void Draw()
{
Console.WriteLine("Square Draw Method");
}
}
class Program
{
static void Main(string[] args)
{
Shape sh = new Square();
sh.Draw();

Square sq = new Square();


sq.Draw();

.NET Framework and Which Console.ReadKey();


of the following statement is not correct Class is a template that defines Class is a set of plans that Physical representation of C# is a reference type 3
C# 5.0 about a C# class? the form of an object specify how to build an object class exist in memory when
you just declare the object
.NET Framework and Consider the below given code and identify the Employee Display Method Static Employee Constructor Static Employee Constructor Employee Display Method 2
C# 5.0 output generated. Employee Display Method Static Employee Constructor

class Employee
{
static Employee()
{
Console.WriteLine("Static Employee
Constructor");
}

public static void Display()


{
Console.WriteLine("Employee Display
Method");
}
}
static void Main(string[] args)
{
Employee.Display();

Console.ReadKey();
}
.NET Framework and Indexers permit instances of a _______ to be class only structure only interface only class or structure 4
C# 5.0 indexed in the same way as arrays
.NET Framework and Which of the following statements are true? Statement 1 is true but Statement 2 is true but Both the statements are true Both the statements are false 3
C# 5.0 Statement 1: Statement 2 is not true Statement 1 is not true
If user don't provide any constructor, the compiler
will generate a default constructor.
Statement 2:
The default constructor created by compiler is just
initializes reference variables to null, value type
variables to zero and boolean variables to false.

.NET Framework and Which of the following statements are true? Statement 1 is true but Statement 2 is true but Both the statements are true Both the statements are false 4
C# 5.0 Statement 1: Statement 2 is not true Statement 1 is not true
Output parameters must be initialized before they
are passed to the method.
Statement 2:
Reference parameters do not need to be initialized
before they are passed to the method.
.NET Framework and Predict the output of the following code: program crashes due to prints "some exception". compilation error. executes successfully. 1
C# 5.0 class Test unhandled exception.
{
void TestMethod()
{
throw new Exception();
}
static void Main(string[] args)
{
try
{
new Test().TestMethod();
}
catch (SystemException)
{
Console.WriteLine("some exception");
}

}
}
.NET Framework and Which of the following statements are correct Exceptions are typically Exception handling is a Exceptions are notifications Exception is an event that 2,4
C# 5.0 about Exception? regarded as compile time technique that some syntax errors have occurs during the execution of
anomalies for dealing with runtime occurred in program. a program that disrupts the
exceptions. normal flow of instructions
during the execution of
program.
.NET Framework and A try block must be followed by _____ catch only finally only catch or finally throw 3
C# 5.0
.NET Framework and A Hashtable dept maintains the collection of dept.ContainsKey(101); dept.HasValue(101); dept.HasKey(101); dept.ContainsValue(101); 1
C# 5.0 department id and department name in the
company. Which of the following is the correct way
to find out whether "101" department id is present
in the collection or not?
.NET Framework and Which of the following is the correct property to GrowSize Capacity MaxCount Count 2
C# 5.0 find out the maximum limit of elements that can be
present in an ArrayList?
.NET Framework and Which of the following statement is not correct Each collection class must IEnumerable is not inherited The IEnumerable interface has Class implementing 2
C# 5.0 about IEnumerable interface? implement IEnumerable by ICollection one method called the GetEnumerator() method must
interface GetEnumerator() method return a class that implements
the IEnumerator interface
.NET Framework and Which of the following statements are correct? 1 - False, 2 - False, 3 - True, 4 - 1 - True, 2 - False, 3 - False, 4 - 1 - True, 2 - False, 3 - True, 4 - 1 - True, 2 - False, 3 - True, 4 - 3
C# 5.0 1. To provide stronger compile-time type checking True True True False
and reduce type casts, C# permits an optional list of
constraints to be supplied for each type parameter.
2. Constraints can not be specified on generics.
3. Constraints are declared using the word where,
followed by the name of a type parameter,
followed by a list of class or interface types.
4. A type parameter constraint specifies a
requirement that a type must fulfill in order to be
used as an argument for that type parameter.

.NET Framework and Predict the output of the following code: exception: collection modified prints: prints: compilation error. 3
C# 5.0 class Test in for each loop. 2 2
{ 4 3
static void Main(string[] args) 3
{
List<int> numbers = new List<int>();
numbers.Add(2);
numbers.Add(4);
numbers.Add(3);
foreach (int num in numbers)
{
numbers.Remove(4);
break;
}
foreach (int num in numbers)
{
Console.WriteLine(num);
}
}
}
.NET Framework and Which of the following statement is/are not correct When the yield return The yield keyword is used to It is used in an iterator block to The return statement is as 1,4
C# 5.0 about yield? statement is reached, the specify the value, or values, provide a value to the below:
previous location is stored. returned. enumerator object or to signal return yield <expression>;
the end of iteration
.NET Framework and Which of the following is the .NET compatible void Handler(EventArgs arg) void Handler(object source, void Handler(object source) void Handler(EventArgs arg, 2
C# 5.0 event handlers form? { EventArgs arg) { object source)
} { } {
} }
.NET Framework and public void Multiply(double n1, double n2) public delegate public delegate double public delegate void public delegate double 3
C# 5.0 { MultiplyAddCalculatorDelegat CalculatorDelegate(double n1, CalculatorDelegate(paramarra CalculatorDelegate(paramarra
Console.WriteLine((n1 * n2).ToString()); e; double n2); y double[]); y double[]);
}
public void Addition(double n1, double n2)
{
Console.WriteLine((n1 + n2).ToString());
}

Which of the following delegate will call both the


methods given above?
.NET Framework and Consider the code given below. delegate void delegate void delegate void delegate void 2
C# 5.0 MyGenericDelegate(T arg); MyGenericDelegate<T>(T arg); MyGenericDelegate<int, MyGenericDelegate<T>(arg);
class Program string>(T arg);
{
static void LowerCase(string str)
{
Console.WriteLine(str.ToLower());
}

static void UnaryAddition(int num)


{
Console.WriteLine(1 + num++ + 1);
}
}
Which of the following delegate will be used to
refer/call both the methods given in the code?
.NET Framework and Check the following : 1 - True, 2 - False, 3 - True 1 - True, 2 - False, 3 - False 1 - False, 2 - False, 3 - False 1 - False, 2 - False, 3 - True 1
C# 5.0 1. In the multicast delegate += operator is used to
add methods to invocation list and to remove
methods - operator is used.
2. In the multicast delegate methods will be
invoked in the reverse manner, as they added.
3. Multicast delegates must contain only methods
that return void.
.NET Framework and Check the following : 1 - True, 2 - True, 3- True, 4 - 1 - True, 2 - True, 3- False, 4 - 1 - True, 2 - False, 3- False, 4 - 1 - True, 2 - True, 3- False, 4 - 3
C# 5.0 1. An anonymous method is, a block of code that is False True False False
passed to a delegate.
2. An anonymous method consists of the keyword
delegate, an optional parameter list, and a
statement list enclosed in { and } delimiters
3. Anonymous methods can access ref or out
parameters for defining methods
4. Anonymous methods are not working with
events
.NET Framework and Check the following : 1 - True, 2 - True, 3 - True, 4 - 1 - True, 2 - True, 3 - False, 4 - 1 - True, 2 - True, 3 - False, 4 - 1 - True, 2 - True, 3 - False, 4 - 2
C# 5.0 1. Dispose method cannot call Finalize. False, 5 - True False, 5 - True False, 5 - False True, 5 - True
2. Finalize method can call Dispose.
3. User can call Finalize method.
4. User cannot call Dispose method.
5. Finalize is protected method.
.NET Framework and Which of the following is used to release the raw object finalization object deletion object deallocation object referencing 3
C# 5.0 memory back to the heap?
.NET Framework and Which of the following statements are true? Statement 1 is true but Statement 2 is true but Both the statements are true Both the statements are false 3
C# 5.0 Statement 1: Statement 2 is not true Statement 1 is not true
Directory class exposes static methods for creating,
moving, and enumerating through directories and
subdirectories.
Statement 2:
DirectoryInfo class exposes instance methods for
creating, moving, and enumerating through
directories and subdirectories.
.NET Framework and Which of the following is not restriction on The class to be serialized must The binary format produced is The binary format is not It can serialize and restore only 4
C# 5.0 BinaryFormatter? either be marked with the specific to the .NET Framework human-readable, which makes public members of an object
SerializableAttribute attribute, and it cannot be easily used it more difficult to work with if
or must implement the from other systems or the original program that
ISerializable interface and platforms produced the data is not
control its own serialization available
and deserialization

.NET Framework and To enable the class to initialize a nonserialized IDeserializationCallBack OnDeserialization IDeserializationBack IserializationCallBack 1
C# 5.0 member automatically, which of the following
interfaces can be used?
.NET Framework and Which of the following are valid enumeration Update Read ReadWrite Delete Write 2,3,5
C# 5.0 values of File Access?
.NET Framework and Identify the correct way to load the assembly and Assembly maths = Assembly maths = Assembly maths = Assembly maths = 1
C# 5.0 retrieve a list of various types in the assembly. Assembly.LoadFrom("Maths.dl Assembly.LoadFrom("Maths.dl Assembly.Load("Maths.dll"); Assembly.Load("Maths.dll");
l"); l"); Type[] mathType = Type[] mathType =
Type[] mathType = Type[] mathType = maths.GetTypes(); maths.GetType();
maths.GetTypes(); maths.GetType();
.NET Framework and Which of the following statement is not correct Attribute is a sub class of Attributes can be applied to Attributes concept in .Net is a The Runtime can not change 4
C# 5.0 about attributes? System.Attribute various code parts in .net and way to mark or store meta its behavior or course of action
are called Targets for an data about the code in based on the attribute present
attribute assembly
.NET Framework and Which of the following statement/s is/are correct? Statement 1 is true but Statement 2 is true but Both statements are true Both statements are false 4
C# 5.0 Statement 2 is false Statement 1 is false
Statement 1 : A block of code on the caller's side
that invokes the exception-prone member is
known as catch block
Statement 2 : A block of code on the caller's side
that processes the exception is known as try block
.NET Framework and Which of the following is component used for SystemException DivideByZeroException ApplicationException FormatException 1
C# 5.0 exceptions that are usually thrown by the .NET
runtime or
which are considered of a very generic nature and
may be thrown by almost any application?
.NET Framework and Which of the following collection class will allow SortedList HashTable ArrayList Stack 2
C# 5.0 the user to access the element based on key?
.NET Framework and Which of the following statement/s is/are correct? Statement 1 is true but Statement 2 is true but Both statements are true Both statements are false 4
C# 5.0 Statement 2 is false Statement 1 is false
Statement 1 : The Capacity property gives the total
number of items stored in the ArrayList object
Statement 2 : The Count property gets or sets the
number of items that the ArrayList object can
contain

.NET Framework and Which of the following statement is correct about Class GenericClass requires There are multiple constraints Compile time error Exception 2
C# 5.0 below code snippet? that its type argument must on type argument to
implement IComparable GenericClass class
public class GenericClass<T> where T: class, interface
IComparable
{
}
.NET Framework and Vicky has written below code for anonymous StringDelegate del => { return StringDelegate del = str => { StringDelegate del => str = { StringDelegate del = str = { 2
C# 5.0 method : str.ToUpper(); }; return str.ToUpper(); }; return str.ToUpper(); }; return str.ToUpper(); };
Console.WriteLine(del); Console.WriteLine(del); Console.WriteLine(del); Console.WriteLine(del);
public delegate string StringDelegate(string str);

public static void Main()


{
StringDelegate del = delegate(string str)
{
return str.ToUpper();
};
Console.WriteLine(del(".Net batch");
}

Which of the following code snippet will give same


output as that of above code?
.NET Framework and Which of the following is the correct way to declare public event void delegate void MyHandler(); delegate void MyHandler(); delegate void MyHandler(); 3
C# 5.0 events? MyClickEvent; public class EventClass public class EventClass public class EventClass
{ { {
public event void public event MyHandler public MyHandler event
MyClickEvent; MyClickEvent; MyClickEvent;
} } }
.NET Framework and Which of the following statement/s is/are correct? Statement 1 is true but Statement 2 is true but Both statements are true Both statements are false 3
C# 5.0 Statement 2 is false Statement 1 is false
Statement 1 : Delegates are preferred method of
implementing callbacks in the CLR
Statement 2 : By referencing a method as a
delegate, the method will be treated as object

.NET Framework and Which of the following statement/s is/are correct? Statement 1 is true but Statement 2 is true but Both statements are true Both statements are false 3
C# 5.0 Statement 2 is false Statement 1 is false
Statement 1 : Lambda expressions passed as
arguments participate in type argument inference
and in method overload resolution.
Statement 2 : Lambda expressions with an
expression body can be converted to expression
trees.

.NET Framework and State true or false: 1 - False 1 - True 1 - True 1 - False 1
C# 5.0 2 - True 2 - True 2 - True 2 - True
1. Garbage collector releases the memory for 3 - False 3 - True 3 - False 3 - True
objects that are being used
2. Garbage collector freeing up blocks of address
space allocated to unreachable objects
3. Garbase collector sets the managed heap pointer
after first object
.NET Framework and Which of the following class provides the base class File Directory FileSystemInfo Path 3
C# 5.0 for both FileInfo and DirectoryInfo objects?
.NET Framework and Which of the following class listens to the file FileSystemWatcher File Directory FileSystemInfo 1
C# 5.0 system change notifications and raises events
when a directory, or file in a directory, changes?
.NET Framework and Which of the following namespace allows to System.Attributes System.Reflection System.Runtime.Serialization System.Collections 2
C# 5.0 inspect type information and invoke methods in
that type at runtime?
.NET Framework and Following is the feature of _________________. Attributes Reflection Assembly Generics 1
C# 5.0
1. Associate declarative information with C# code
components
2. Based on this, runtime can change its behavior or
course of action
.NET Framework and Which of the following attribute is applied on the [Serialization] [Serializable] [Serialized] [Serialize] 2
C# 5.0 class to make an object available for serialization?

.NET Framework and If user determine that a given class has some [NonSerialization] [NonSerializable] [NonSerialized] [NonSerialize] 3
C# 5.0 member data that should not participate in the
serialization scheme, then which of the following
attribute is used for the member?
.NET Framework and Which of the following statement are correct about Task parallelism refers to one TPL is based on the concept of A task represents an It is not efficient to use system 1,2,3
C# 5.0 TPL? or more independent tasks the task asynchronous operation resource
running concurrently
.NET Framework and Async programming is used for ______ productivity responsiveness referencing dereferencing 2
C# 5.0
.NET Framework and Finalize is ______ method. private protected public internal 2
C# 5.0
.NET Framework and If user needs to create an override of Destructor Delete Dispose Finalizer 1
C# 5.0 Object.Finalize then user needs to write _____
WPF Introduction When setting _______ to an ADO.NET DataTable DataContext ItemsSource DataMember Path 1
object that contains the data you want to bind.
WPF Introduction Consider a WPF Application that has a XAML Name="productListBox" Name="productListBox" 3
window with listBox control named productListBox. ItemsSource="{Binding ItemsSource="{Binding Name="productListBox" Name="productListBox"
The following code has been written to create a ElementName=Name}"/> Source=Product.Name}"/> ItemsSource="{Binding ItemsSource="{Binding
collection of Products: Path=Name}"/> Source=Product}"/>

ProductCollection products= new


ProductCollection();
products.Add(new Product(){Name = "product 1"});
products.Add(new Product(){Name = "products
2"});
products.Add(new Product(){Name = "products
3"});
productListBox.DataContext = products;

How will you configure the ListBox control to


display the value of the Name property of each
Product instance in the collection. Which XAML
content should you use?

WPF Introduction Which of the following interface is used in WPF to IDependencyProperty INotifyPropertyChanged IDisposable IPropertyChanged 2
propagate changes from source to destination
if source of a data binding expression is not a
dependency property?

WPF Introduction You have created a series of customized Brush In the Resources collection of In the Resources collection of In the Application.Resources In a separate resource 4
objects to create a common color scheme for each control that needs them each window that needs them collection dictionary
every window in each of several applications in
your company.
The Brush objects have been implemented as
resources.

What is the best place to define these resources?

WPF Introduction _______ allows you to create a brush that blends LinearGradient Brush Solid Brush RadialGradientBrush ImageBrush 1
two or more colors along a gradient,
allowing a variety of effects.
WPF Introduction The following code has been written to create a Binding ElementName Resource StaticResource 4
style in WPF:

<Style x:Key="BigFontButtonStyle">
<Setter Property="Control.FontFamily"
Value="Times New Roman" />
<Setter Property="Control.FontSize" Value="18"
/>
<Setter Property="Control.FontWeight"
Value="Bold" />
</Style>

Which of the following markup extension will be


used for applying this style to any WPF control?
WPF Introduction The following code has been written to draw a The Stroke attribute is used to The Stroke attribute is used to The Stroke attribute is used to Stroke is not valid attribute of 2
ellipse in WPF: paint everything inside borders paint the edges of the ellipse. paint everything inside borders Ellipse tag.
of the ellipse. and edges of the ellipse.
<Ellipse Fill="Yellow" Stroke="Blue"
Height="50" Width="100" Margin="5"
HorizontalAlignment="Left"></Ellipse>

What is the use of Stroke attribute in the above


code?
WPF Introduction Which layout panel would be the best choice for a Grid Canvas Wrap Panel Uniform Grid 4
user interface that requires evenly
spaced controls laid out in a regular pattern?
WPF Introduction Which of the following Trigger type will help in We cannot create triggers on Using a property trigger and Using DataTrigger By Attaching a Property trigger 3
creating a trigger on a Non Dependency Property? non dependency property setting IsPropertyDependency through C# code
as false

WPF Introduction Identify true/false statements w.r.t. to event Statement 1 is True Statement 1 is False Statement 1 is True Statement 1 is False 4
handling in WPF: Statement 2 is False Statement 2 is True Statement 2 is True Statement 2 is False

1) Bubbling event travels down the containment


hierarchy.
2) Tunneling event occurs after bubbling event.
WPF Introduction Which of the following is attached property of Orientation HorizontalAlignment VerticalAlignment Top 4
Canvas?
WPF Introduction Which of the following property of a slider can be Delay Interval TickPlacement IsSnapToTickEnabled 3
used to specify location or position of
a tick marks that a slider displays?
WPF Introduction Which of the following property is used to specify Margin HorizontalAlignment VerticalAlignment Width 1
the distance between controls in a WPF container?

WPF Introduction ______ property provides an enumerated value RoutingStrategy Bubbling Routed Tunneling 1
that tells you what type of routing the Click event
uses.
WPF Introduction _______ Shifts the coordinate system of your SkewTransform RotateTransform ScaleTransform TranslateTransform 4
object by the horizontal and vertical amounts
indicated
by the X and Y properties,respectively.
WPF Introduction Which of the following property is used to specify Margin HorizontalAlignment VerticalAlignment Width 1
distance between controls in a WPF container?

WPF Introduction Which of the following binding direction will OneWay TwoWay OneTime OneWayToSource 1
update the target if source changes?
WPF Introduction Which property of DockPanel is used to specify that LastChild LastChildFill RemainingSpace Dock 2
last control in the dock panel will occupy
the remaining space in the container?
WPF Introduction Identify true/false statements w.r.t. to data binding Statement 1 is True Statement 1 is False Statement 1 is True Statement 1 is False 3
in WPF: Statement 2 is False Statement 2 is True Statement 2 is True Statement 2 is False

1) Data binding is a relationship that conveys to


WPF to extract some information from
a source object and use it to set a property in a
target object.

2) The target property is always a dependency


property, and it is usually in a WPF element.
WPF Introduction _________allows an event to originate in one Dependency Properties Attached Properties .NET Events Event Routing 4
element but be raised by another one.
ADO.NET Which of the following is/are valid SqlCommand SQLCommand cmd=new SQLCommand cmd = new SQLCommand cmd = new SQLCommand cmd = new 1,2,3
object ? SQLCommand(); SqlCommand(String SqlCommand(String SqlCommand(String
CommandText, SqlConnection CommandText, SqlConnection CommandText, SqlTransaction
con); con, SqlTransaction trans); trans,SqlConnection con);

ADO.NET You have written the following query: NextResult HasRows GetName GetOrdinalPosition 1

("Select * from Customers; Select * from


Products)in you Sqlcommand object.

Which object you will use so that both the queries


are executed?
ADO.NET ________object of ADO.Net does not support DataAdapter Dataset DataMember DataReader 4
updating.
ADO.NET If the following query is used to retrieve data into a NextTable NextData NextResult NextValues None of 3
DataReader, these
which one of the following methods allows access
to the second set of data
(the data from Employees)?

SELECT * FROM Department; SELECT * FROM


Employees;
ADO.NET Amit wants to write C# code to calls a sql server string sqlConnectString = "Data string sqlConnectString = "Data string sqlConnectString = "Data string sqlConnectString = "Data 2
stored procedure "uspGetProductDetails" Source=(local);" + Source=(local);" + Source=(local);" + Source=(local);" +
which takes one integer parameter. What is the "Integrated "Integrated "Integrated "Integrated
correct code snippet for the same? security=SSPI;Initial security=SSPI;Initial security=SSPI;Initial security=SSPI;Initial
Catalog=Pubs;"; Catalog=Pubs;"; Catalog=Pubs;"; Catalog=Pubs;";

string sqlSelect = string sqlSelect = string sqlSelect = string sqlSelect =


"uspGetProductDetails"; "uspGetProductDetails"; "uspGetProductDetails"; "uspGetProductDetails";
SqlConnection connection = SqlConnection connection = SqlConnection connection = SqlConnection connection =
new new new new
SqlConnection(sqlConnectStrin SqlConnection(sqlConnectStrin SqlConnection(sqlConnectStrin SqlConnection(sqlConnectStrin
g); g); g); g);

SqlCommand command = new SqlCommand command = new SqlProcedure command = new SqlCommand command = new
SqlCommand(sqlSelect, SqlCommand(sqlSelect, SqlProcedure(sqlSelect, SqlCommand(sqlSelect,
connection); connection); connection); connection);
command.CommandType = command.CommandType = command.Parameters.Add("@
"Calling StoredProcedure"; CommandType.StoredProcedu ProductID", command.Parameters.Add("@
re; SqlDbType.Int).Value = 100; ProductID",
command.Parameters.Add("@ SqlDbType.Int).Value = 100;
ProductID", command.Parameters.Add("@
SqlDbType.Int).Value = 100; ProductID", DataTable dt = new DataTable(
SqlDbType.Int).Value = 100; ); DataTable dt = new DataTable(
SqlDataAdapter da = new );
DataTable dt = new DataTable( SqlDataAdapter(command); SqlDataAdapter da = new
); DataTable dt = new DataTable( da.Fill(dt); SqlDataAdapter(command);
SqlDataAdapter da = new ); da.CommandType =
SqlDataAdapter(command); SqlDataAdapter da = new AdapterType.StoredProcedure;
ADO.NET You are developing a .NET application using da.Fill(dt);
DbConnection connection = SqlDataAdapter(command);
DbConnection connection = DbProviderFactory factory =
// databaseProviderName will 4
ADO.NET. new new DbProviderFactories.GetFactor come from config file
You need to ensure that the application can OdbcConnection(connectionSt OleDbConnection(connectionS y("System.Data.Odbc");
connect to any type of database. ring); tring); DbConnection connection = DbProviderFactory factory =
How will you create this so that the application is factory.CreateConnection(); DbProviderFactories.GetFactor
database independent ? y(databaseProviderName);
DbConnection connection =
factory.CreateConnection();

ADO.NET Which ADO.NET Command object’s method would ExecuteNonQuery ExecuteScalar ExecuteReader ExecuteDataReader 2
you use when a query returns the SUM
of a column in a table?
ADO.NET Which of the following object could be used as a ForeignKeyConstraint KeyConstraint UniqueConstraint None of the above 3
primary key for a DataTable in ADO.NET?
ADO.NET Which of the following DataRowStates has the NewRowState Added Row State Deleted Row State Updated Row State 3
Current Data Row Version value for DataRow as
"Missing" ?
ADO.NET State whether true/false w.r.t. Disconnected Statement 1 is True Statement 1 is False Statement 1 is True Statement 1 is False 1
Architecture: Statement 2 is False Statement 2 is True Statement 2 is True Statement 2 is False

1) If RowState of a row in DataTable is Modified,


then CommandBuilder generates UpdateCommand
for that row.
2) If DataSet contains a row with a RowState of
Detached, then CommandBuilder generates
InsertCommand for that row.

ADO.NET DefaultView property of a ______ object returns a Command DataTable DataAdapter Connection 2
DataView.
ADO.NET Which method of a DataTable class is used to Add AddRow New NewRow 4
create a blank row with the same schema as the
table?
ADO.NET Identify true/false statements w.r.t. Disconnected Statement 1 is True Statement 1 is False Statement 1 is True Statement 1 is False 4
Architecture: Statement 2 is False Statement 2 is True Statement 2 is True Statement 2 is False

1) CommandBuilder executes insert, update and


delete statements for every inserted,
updated or deleted row in a DataSet table.

2) DataAdapter generates insert, update and delete


statements for every inserted,
updated or deleted row in a DataSet table.
ADO.NET Using ______ we can increase application DataReader object DataAdapter object Recordset object Connection object 1
performance by retrieving data as soon as it is
available,
rather than waiting for the entire results of the
query to be returned, and storing only one row
at a time in memory.
ADO.NET _________ object are in-memory objects that can DataReader DataSet ResultSet RecordSet 2
hold tables, views, and relationships.
LINQ and Entity Which of the following LINQ operator allows us to Group By Select Aggregate Select Many 4
Framework concatenate multiple projection operations
together?
LINQ and Entity What will be output of the following code: 0 15 120 1+2+3+4+5 2
Framework
private static void Calculate()
{
int[] numbers = { 1, 2, 3, 4, 5 };
var query = numbers.Aggregate((a, b) => a + b);
Console.WriteLine(query);
}
LINQ and Entity The following code has been written: distinct group by except min 1
Framework
private static void SetOperators()
{
int[] numbers = { 2, 4, 6, 8, 10,4,10 };
}
Based on the above code, identify the correct
operator to get the following output:
2
4
6
8
10
LINQ and Entity Amey is developing a restaurant management Customer cust = new Customer cust = new Customer cust = new Customer cust = new 1
Framework system. He is using entity framework as Customer(); Customer(); Customer(); Customer();
a data access mechanism. Amey wants to store Name custName = new Name { Name custName = new Name { Name custName = new Name { cust.CustomerName = new {
address of customers. To store address FirstName="Asdin",LastName= FirstName="Asdin",LastName= FirstName="Asdin",LastName= FirstName="Asdin",LastName=
information, "Dhalla" }; "Dhalla" }; "Dhalla" }; "Dhalla" };
he has created a complex types named Name and Contact custContact = new Contact custContact = new Contact custContact = new cust.CustomerContact =new
Contact as shown in the diagram: Contact Contact Contact {MobileNo=98273263772,Ema
{MobileNo=98273263772,Ema {MobileNo=98273263772,Ema {MobileNo=98273263772,Ema il="[email protected]" };
(Insert Image here) il="[email protected]" }; il="[email protected]" }; il="[email protected]" };
cust.CustomerName = cust.CustomerName = cust.CustomerName = "Amit
Identify the code snippet to store contact details of custName; custContact; Joshi";
the customer using the complex types created. cust.CustomerContact = cust.CustomerContact = cust.CustomerContact =
custContact; custName; 9988776655;

LINQ and Entity Sumit is developing Institute Management System. TrainingEntities TrainingEntities TrainingEntities TrainingEntities 1
Framework He is using the Database First approach of Entity trainingContext=new trainingContext=new trainingContext=new trainingContext=new
Framework. TrainingEntities(); TrainingEntities(); TrainingEntities(); TrainingEntities();
He has created Model named TrainingModel. var query = (from staff in var query = (from staff in var query = (from staff in var query = (from staff in
Based on this scenario, identify the code snippet to trainingContext.Staff_Master trainingContext.Staff_Master trainingContext.Staff_Master trainingContext.Staff_Master
display the total count of the staff. select select select select
staff.Salary).Count(); Count(staff.Salary)); staff.Salary).Size(); staff.Salary).Length;
LINQ and Entity Identify true/false statements: Statement 1 is True Statement 1 is False Statement 1 is True Statement 1 is False 3
Framework Statement 2 is False Statement 2 is True Statement 2 is True Statement 2 is False
1) Using LINQ, we can fetch data from database, in-
memory collections and XML file.
2) LINQ bridges the gap between the world of
objects and the world of data.
LINQ and Entity Identify true/false statements: Statement 1 is True Statement 1 is False Statement 1 is True Statement 1 is False 3
Framework Statement 2 is False Statement 2 is True Statement 2 is True Statement 2 is False
1) LINQ allows us to work with data in a consistent
way, regardless of type of data.
2) LINQ allows us to interact with data as objects.

You might also like