What are the Arrays in C#?
When a group of similar elements is clubbed together under one name,
they are called arrays.
For ex. An array of tea Atea[4]: [green tea, chamomile tea, black tea,
lemon tea]. The length of the array defines how many elements are
present in the array.
In C#, the memory allocations for the elements of the array happen
dynamically. This is how values are stored in an array sequentially.
Some of the basic string operations are:
Concatenate: Two strings can be concatenated either by using a
[Link] or by using + operator.
Modify: Replace(a,b) is used to replace a string with another string. Trim()
is used to trim the string at the end or at the beginning.
Compare: [Link]() is used to compare two strings,
either a case-sensitive comparison or not case sensitive. Mainly takes two
parameters, original string, and string to be compared with.
Search: StartWith, EndsWith methods are used to search a particular
string.
What is a Thread? What is Multithreading?
Answer: A Thread is a set of instructions that can be executed, which will enable
our program to perform concurrent processing. Concurrent processing helps us
do more than one operation at a time. By default, C# has only one thread. But the
other threads can be created to execute the code in parallel with the original
thread.
Thread has a life cycle. It starts whenever a thread class is created and is
terminated after the execution. [Link] is the namespace which needs
to be included to create threads and use its members.
Threads are created by extending the Thread Class. Start() method is used to
begin thread execution.
//CallThread is the target method//
ThreadStart methodThread = new ThreadStart(CallThread);
Thread childThread = new Thread(methodThread);
[Link]();
C# can execute more than one task at a time. This is done by handling different
processes by different threads. This is called MultiThreading.
What do you mean by Constructor Chaining in C#?
Answer: Constructor chaining in C# is a way of connecting two or more classes in a
relationship as an inheritance. Every child class constructor is mapped to the parent
class constructor implicitly by using the base keyword in constructor chaining.
What is a Deadlock?
Answer: A Deadlock is a situation where a process is not able to
complete its execution because two or more processes are waiting for
each other to finish. This usually occurs in multi-threading.
Here a shared resource is being held by a process and another process
is waiting for the first process to release it and the thread holding the
locked item is waiting for another process to complete.
What is view state?
The web is stateless. But in [Link], the state of a page is maintained in the in the
page itself automatically. How? The values are encrypted and saved in hidden controls.
this is done automatically by the [Link]. This can be switched off / on for a single
control
SQL
1. What are the type of joins in SQL
2. Common table expression (CTE)
A common table expression, or CTE, is a temporary named result set
created from a simple SELECT statement that can be used in a
subsequent SELECT statement. Each SQL CTE is like a named query,
whose result is stored in a virtual table (a CTE) to be referenced later in
the main query.
WITH my_cte AS (
SELECT a,b,c
FROM T1
)
SELECT a,c
FROM my_cte
WHERE ....
3. Table variable Vs Temp Table
4. Tigger
5. Store Procedure
6. Views
7. Cluster