16 May 2016 Sudhanshu Ranjan 720

Microsft online test question for Dotnet -1

1.    When is a static constructor called?

a.    When the class is accessed for the first time.
b.    When the object is accessed for the first time.
c.    When first object created.
d.    When the class is declared.

 

2.  You want to retrieve all employees, whether or not they have matching departments in department table. Which query would you use?

Employee Table

Last_Name

Department_Id

Salary

Getz

10

3000

Sudhanshu

20

1500

Devis

20

2200

King

30

5000

Ranjan

 

5000

Ravi

20

1500

Department Table

Department_Id

Department_Name

10

Sales

20

Marketing

30

Accounts

40

Admin

A. 	SELECT LAST_NAME,DEPARTMENT_NAME FROM EMPLOYEE e RIGHT OUTER JOIN
        DEPARTMENT d ON e.DEPARTMENT_ID=d.DEPARTMENT_ID

B.	SELECT LAST_NAME,DEPARTMENT_NAME FROM EMPLOYEE e FULL OUTER JOIN
        DEPARTMENT d ON e.DEPARTMENT_ID=d.DEPARTMENT_ID

C.	None of mentioned Option

D.	SELECT LAST_NAME,DEPARTMENT_NAME FROM EMPLOYEE e LEFT OUTER JOIN
        DEPARTMENT d ON e.DEPARTMENT_ID=d.DEPARTMENT_ID

 

 

3.    Which of the following snippets show the correct way to create a custom book object in JavaScript?

a.    var book = { title: "MyBook", author: "Sudhanshu", pages: 20 };
b.    var book = new { title: "MyBook", author: "Sudhanshu", pages: 20 };
c.    var book = "title: 'MyBook'" + " author: 'Sudhanshu'" + "pages: 20";
d.    var book = (title = "MyBook", author = "Sudhanshu", pages = 20);

 

4.    Which of the following OFFSET-FETCH options are valid in T-SQL?

SELECT...ORDER BY orderid OFFSET 25 ROWS

SELECT...ORDER BY orderid FETCH NEXT 25 ROWS ONLY

SELECT...ORDER BY orderid OFFSET 25 ROWS FETCH NEXT

SELECT...<NO ORDER BY> OFFSET 0 ROWS FETCH FIRST 25 ROWS ONLY

a.    4 only
b.    Only 1 and 4
c.    Only 3 and 4
d.    Only 1 and 2

 

5.    What is the correct Output of below code?

class A
    {
        public void F() { Console.WriteLine("A.F"); }
        public virtual void G() { Console.WriteLine("A.G"); }
    }
    class B : A
    {
        new public void F() { Console.WriteLine("B.F"); }
        public override void G()
        {
            Console.WriteLine("B.G");
        }
    }
    class Test
    {
        static void Main()
        {
            B b = new B();
            A a = b;
            a.F();
            b.F();
            a.G();
            b.G();
        }
    }

 

6.    You are creating Asp.net MVC application. The application must accept user input for a ProductName field. To reduce delays due to invalid entries making round trips between client and servers, user input should be validated on the client before being submitted to the server. Which code segment should you chose.

A._______________________________________________________________________
    <div>
        @Html.EditorFor(model => model.ProductName)
        @Html.ValidationMessageFor(model => model.ProductName)
    </div>
   B._______________________________________________________________________
    <div>
        @Html.EditorFor(model => model.ProductName)
    </div>
   C. _______________________________________________________________________
    <div>
        @Html.LabelFor(model => model.ProductName)
    </div>
    D._______________________________________________________________________
    <div>
        @Html.LabelFor(model => model.ProductName)
        @Html.ValidationMessageFor(model => model.ProductName)
    </div>
    

 

7.    Which of the following is a mechanism of static polymorphism?

a.    Templates/Generics
b.    Function Overloading
c.    All of these
d.    Operator Overloading

8.    When the values in one or more attributes being used as a foreign key must exist in another set of one or more attributes in other table, we have created a……?

a.    Normal form
b.    Referential integrity constraints
c.    Insertion anomaly
d.    Transitive dependency

9.    Which ADO.net’s command object’s method would you use to execute a query that does not return any result??

a.    Execute
b.    ExecuteNonQuery
c.    ExecuteScalar
d.    ExecuteDataReader

10.    You are creating a solution in which the majority of the application is dynamic, but some area can be cached for a long time. What kind of approach would you take?

a.    Data caching
b.    Donut hole caching
c.    Donut caching
d.    Windows AppFabric caching

 

 

You can share at :

About Author
Sudhanshu Kumar Ranjan | Lead Engineer at HCL Technologies | Expertise in Microsoft Technology | Author | Blogger | Programmer
Know More
Connect with him on Facebook | Google+ | LinkedIn | Twitter

Recommended Post

Leave a comment

About Dotnet Cube

It's my blog - Dotnet Cube, where you will learn and get solutions about programming, web designing and development. I started this website to share my knowledge and experience which might help someone.

You can get more details about me and my blog at About Us page.

Subscribe Newsletter

Subscribe to our monthly newsletter to get the latest industry news, Media Group updates and our current specials.

Follow On Us...

Home | About | Advertise | Copyrights | Privacy | Contact | Admin

Copyrights © 2015-2017 dotnetcube.com. All rights reserved