Test for ASP.NET developers
Скоро си тествах познанията с един онлайн тест.
Пускам теста с отговорите, защото самият тест е концептуален и е задължително за един developer да е запознат с ООП и База данни.
This test
is designed to test your skills in programming, design and SQL.
Programming
What’s the difference
between an abstract class and interface? When would you want to use them?
Abstract class can contain abstract methods, abstract property as well as other members (just like normal class).
Interface
can only contain abstract methods, properties but we don’t need to put abstract
and public keyword. All the methods and properties defined in Interface are by
default public and abstract.
What's the difference between
overriding and overloading a method?
Overriding - same method names with same arguments and same return types
associated in a class and its subclass.
Overloading - same method name with different arguments, may or may not be
same return type written in the same class itself.
What's the difference between
protected and internal?
Protected:
A protected member is accessible from within the class in which it is
declared
Internal:
Internal types or members are accessible only within files in the same
assembly.
What's the difference between
a static method and a non-static method?
The static methods can by accessed directly from the class, while
non-static methods have to be accessed from an instance
Explain what happens when you
pass a "ref" or "out" parameter into a method
Ref tells the compiler that the object is initialized before entering the
function, while out tells the compiler that the object will be initialized
inside the function
What's the difference between
a value-type and a reference type?
Value types are stored
directly on the stack.
Value types are always accessed directly
Reference types are stored
on the run-time heap
A variable of reference type always contains a reference to a value of that
type or a null reference
What does the
"readonly" keyword in C# mean?
Marking a field as read-only only means that we cannot change the value of
that field
What
is the difference between a thread and a process?
Process
Each process provides the resources needed to execute a program
A process has a virtual address
Each process is started with a single thread, often called the primary
thread, but can create additional threads from any of its threads
Thread
A thread is the entity within a process that can be scheduled for execution
All threads of a process share its virtual address space and system
resources
each thread maintains exception handlers
What
is an Interface and how is it different from a Class?
Classes as a template to put the properties and functionalities
A class can contain declarations of the following members:
Constructors, Destructors, Constants, Fields, Methods, Properties
An interface contains only the signatures of methods, delegates or events
The implementation of the methods is done in the class that
implements the interface.
A class that implements an interface can explicitly implement members of
that interface. An explicitly implemented member cannot be accessed through
a class instance, but only through an instance of the interface
An interface can inherit from one or more base interfaces
What
is Reflection?
Reflection helps us to browse methods, properties and function of a given class
or assembly on run time and invoke the methods and functions using reflection
How
does the generational garbage collector in the .NET CLR manage object lifetime?
What is non-deterministic finalization?
No time ???
What
is the difference between Finalize() and Dispose()?
Dispose() is called by the user of an object to indicate that he is
finished with it, enabling that object to release any unmanaged resources it
holds. Finalize() is called by the run-time to allow an object which has not
had Dispose() called on it to do the same
What is lambda expression?
Lambda
expressions are similar to anonymous methods
they can contain expressions and statements, and
can be used to create delegates or expression tree types
example:
customers.Where(c => c.City == "London");
Design
What is object oriented
programming and why developers should use it?
OOP gives
us
flexibility
polymorphism
encapsulation
inheritance
It makes the coding more organized
What is polymorphism?
Polymorphism.
It allows you to invoke derived class methods through a base class reference
during run-time. This is handy when you need to assign a group of objects to an
array and then invoke each of their methods. They won't necessarily have to be
the same object type. However, if they're related by inheritance, you can add
them to the array as the inherited type. Then if they all share the same method
name, that method of each object can be invoked.
Name all design patterns
that you know.
Describe MVC pattern.
(Model View Controller) A
design pattern used in services architectures
The 'Model'
is how the underlying data is structured. The 'View' is what is presented to
the user or consumer. The 'Controller' is the element that performs the
processing.
Describe IOC pattern and
dependency injection principle.
What is TDD and why
developers should use it?
SQL
Explain types of JOINs:
INNER JOIN
inner Join
: Two tables having the common column values go with inner join
LEFT and RIGHT OUTER JOIN
Left outer join:
Taking Left side values of the table checking into right side
Right Outer join:Taking Right side values of the table checking
left side
Outer join has two sub types left outer join,Right outer
join
FULL JOIN
Full join is combined with left outer join ,Right outer
join.
CROSS JOIN
cross join
is an carteasion product ,its like matrix format
What is a key?
A candidate key?
A Candidate
Key can be any column or a combination of columns that can qualify as unique
key in database. There can be multiple Candidate Keys in one table. Each
Candidate Key can qualify as Primary Key
A primary key?
The PRIMARY
KEY constraint uniquely identifies each record in a database table.
Primary keys
must contain unique values.
A primary key
column cannot contain NULL values.
An alternate key?
It is
commonplace in SQL databases to declare a single primary key, the most important
unique key. However, there could be further unique keys that could serve the
same purpose. These should be marked as 'unique' keys. This is done to prevent
incorrect data from entering a table (a duplicate entry is not valid in a
unique column) and to make the database more complete and useful. These could
be called alternate keys
A foreign key?
A FOREIGN
KEY in one table points to a PRIMARY KEY in another table
What is an index and how
does it help your database?
create
indexes in tables
Indexes
allow the database application to find data fast without reading the whole
table.
CREATE
INDEX index_name
ON table_name
(column_name)
Поздрави Мехмедов













