Sei sulla pagina 1di 3

.

NET/C#

1. What is the purpose of the USING statement (not the namespace import directive)?
Give an example use-case in a sample code.

2. Consider the following classes:

public class ClassA


{
private int _value;

public ClassA()
{
}

public ClassA(int value)


{
_value = value;
}

public int Value


{
get { return _value; }
protected set { _value = value; }
}
}

public class ClassB : ClassA


{
protected ClassB(int value) : base(value * 10)
{ }
}

public class ClassC : ClassB


{
}

Show how many different ways you can create a new instance of each of the classes?
(e.g. StringBuilder sb = new StringBuilder(); is one way to instantiate a
StringBuilder class object instance.) Also after each object instantiation, what will be
the value returned by the Value property of that object instance.

3. Lets say that you have a doubly-linked list (a list in which each item has reference to the
previous as well as the next item in the list) where each node is represented with the following
class:
public class ListItemNode
{
object Value;
ListItemNode NextItem;
ListItemNode PreviousItem;
}

The DoubleLinkedList class has a member variable named HeadNode of type ListItemNode.
This head node is the first item in the list.

Write a method for the DoubleLinkedList class to reverse the order of the items in the list.

4. Consider the following two arrays:

string[] arrStrings = new string[] { Bal, Yuriy, Ken, Apple, Ken };


int[] arrNumbers = new int[] { 11, 2, 25, 34, 66, 25, 0, 0, 3, 4, 2, 89 };

Write a single method which can be passed either one of these arrays and it returns the list of
unique items in the specified list. You cannot use LINQ to solve this problem.

5. Lets say you are developing an API which draws a diagram on a screen canvas. The
diagram is composed of different types of shapes circles, rectangles, lines, etc.
Each shape knows how to draw itself. Multiple shapes placed at different locations
within the canvas area makes up a diagram image. Define an object/class model (set
of classes) which can be used to represent the shapes (just target circle, rectangle,
and line shape types) and the diagram class. Note that this class model should be
extensible so that other types of shapes (like pentagon, star, etc.) can be supported
later on without having the change the diagram class. The canvas class (which you
dont have to write) will use the diagram object to draw shapes that make up the
image. You dont need to write the body of the methods, just the skeleton API design
is sufficient. This should demonstrate the common OOP aspects of the skills.

JavaScript

1. Write a JavaScript for a loop to print out numbers from 1 to 100 that are evenly
divisible by 3.

2. Write a JavaScript/jQuery statement to retrieve the value of a DIV element with ID


FullName and an INPUT field with the ID FirstName.

3. Write a JavaScript/jQuery statement to update the value of a DIV element with ID


FullName and an INPUT field with the ID FirstName.

4. Write a JavaScript/jquery statement to retrieve the 3rd button object on the page.

5. Define prototype inheritance and closure.


6. How does the var keyword affect scope?

SQL

1. Explain the difference between sql logins and sql users.

2. Explain the difference between sql backup/restore and detach/attach.

3. Consider the following database table:

Promotions(CustomerID, PromotionCode)

This table has a unique index based on CustomerID and PromotionCode columns.

The table contains records for the customers who received any promotions. Lets say two of the
promotions are named PromA and PromB.

Write the code for the following SQL queries:

a) Build the query that will show unique Customer IDs of customers who received
PromA, but didnt receive PromB.

b) Build the query that will show the number of customers who received each
Code stored in the table. Display Promotion Code and number of customers who
received that promotion. However do not display Promotion Codes that were sent to
small number of customers (less than 30).

c) Will the following query utilize the index mentioned above?

SELECT CustomerID FROM Promotions WHERE PromotionCode = PromA

4. Write the code that will give a flat hike to your employees using the following criteria:

EmployeeSalary(EID, Name, Salary)

Salary between 30000 and 40000 -- 5000 hike


Salary between 40000 and 55000 -- 7000 hike
Salary between 55000 and 65000 -- 9000 hike

Potrebbero piacerti anche