There are 7 states in c# threading :-
- Unstarted
- Start
- Running
- Suspended
- Stopped
- Blocked
- WaitSleepJoin
See the following video on windows application in C#: -
Click to get c# interview question
Regards
Get more c# interview question from author’s blog
- Location:India, Mumbai
There are nine types of diagrams in UML:-
Use case diagram:
They describe "WHAT" of a system rather than "HOW" the system does it. They are used to identify the primary elements and processes that form the system. The primary elements are termed as "actors" and the processes are called "use cases". Use Case diagrams shows "actors" and there "roles".
Class diagram:
From the use case diagram, we can now go to detail design of system, for which the primary step is class diagram. The best way to identify classes is to consider all "NOUNS" in use cases as classes, "VERBS" as methods of classes, relation between actors can then be used to define relation between classes. The relationship or association between the classes can be either an "is-a" or "has-a" relationship which can easily be identified from use cases.
Object diagram:
An object is an instance of a class. Object diagram captures the state of classes in the system and their relationships or associations at a specific point of time.
State diagram:
A state diagram, as the name suggests, represents the different states that objects in the system undergo during their life cycle. Object change in response to certain simulation so this simulation effect is captured in state diagram. Therefore, it has a initial state and final state and events that happen in between them. Whenever you think that some simulations are complicated, you can go for this diagram.
Sequence diagram:
Sequence diagrams can be used to explore the logic of a complex operation, function, or procedure. They are called sequence diagrams because sequential nature is shown via ordering of messages. First message starts at the top and the last message ends at bottom. The important aspect of a sequence diagram is that it is time-ordered. This means that the exact sequence of the interactions between the objects is represented step by step. Different objects in the sequence diagram interact with each other by passing "messages".
Collaboration diagram:
A collaboration diagram groups together the interactions between different objects to fulfill a common purpose.
Activity diagram:
Activity diagram is typically used for business process modeling, for modeling the logic captured by a single use case, or for visualizing the detailed logic of a business rule. Complicated process flows in the system are captured in the activity diagram. Similar to a state diagram, an activity diagram also consists of activities, actions, transitions, initial and final states, and guard conditions. However, difference is state diagrams are in context of simulation while activity gives detail view of business logic.
Deployment diagram:
Deployment diagrams show the hardware for your system, the software that is installed on that hardware, and the middleware used to connect the disparate machines to one another. It shows how the hardware and software work together to run a system. In one, line its shows the deployment view of the system.
Component diagram:
The component diagram represents the high-level parts that make up the system. From .NET angle point of view, they form the "NAMESPACES". This diagram depicts, at a high level, what components form part of the system, and how they are interrelated. Its shows the logical grouping of classes or group of other components.
See the following video on UML diagram: -
Click to get UML Training
Regards,
Get more UML training stuffs from author's blog
- Location:India, Mumbai
IIS has three level of isolation:-
LOW (IIS process):- In this main IIS, process, and ASP.NET application run in same process. So if any one crashes the other is also affected. Example let us say (well this is not possible) I have hosted yahoo, hotmail .amazon and goggle on a single PC. So all application and the IIS process runs on the same process. In case any website crashes, it affects everyone.
Figure: - LOW IIS process scenario
Medium (Pooled):- In Medium pooled scenario, the IIS, and web application run in different process. Therefore, in this case there are two processes process1 and process2. In process1, the IIS process is running and in process2, we have all Web application running.
Figure: - Medium pooled scenario
High (Isolated):-In high isolated scenario every process is running is there own process. In below figure there are five processes and every one handling individual application. This consumes heavy memory but has highest reliability.
Figure: - High isolation scenario
See the following video on ASP.NET4.0 Redirectpermanent: -
Click to get C# Training
Regards,
Get more C# training stuffs from author's blog
- Location:India, Mumbai
Following are the major differences between them:-
‘Response. Redirect’ sends message to the browser saying it to move to some different page, while server. Transfer does not send any message to the browser but rather redirects the user directly from the server itself. So in ‘server. Transfer’ there is no round trip while ‘response. Redirect’ has a round trip and hence puts a load on server.
Using ‘Server. Transfer’ you cannot redirect to a different from the server itself. Example if your server is www.yahoo.com you cannot use server. Transfer to move to www.microsoft.com but yes, you can move to www.yahoo.com/travels, i.e. with in websites. Cross server redirect is possible only by using Response. Redirect.
With ‘server. Transfer’ you can preserve your information. It has a parameter called as “preserveForm”.Therefore, the existing query string etc. will be able in the calling page.
If you are navigating within the same website use “Server. Transfer” or else go for “response.Redirect ()”
See the following video on ASP.NET4.0: -
Click for more ASP.NET interview questions
Regards,
Visit for more Authors’ blog on ASP.NET interview questions
- Location:India, Mumbai
This is the most practical oriented ASP.NET Interview Questions which may be asked during the Interview by the Interviewer.
ASP.NET new feature supports are as follows:-
Better Language Support
- New ADO.NET Concepts have been implemented.
- ASP.NET supports full language (C#, VB.NET, C++) and not simple scripting like VBSCRIPT...
Better controls than ASP
- ASP.NET covers large set’s of HTML controls..
- Better Display grid like Data grid, Repeater and datalist.Many of the display grid havpaging support.
Controls have events support
- All ASP.NET controls support events.
- Load, Click, and Change events handled by code makes coding much simpler and much better organized.
Compiled Code
ASP.NET supports forms-based user authentication, including cookie management and automatic redirecting of unauthorized logins. (You can still do your custom login page and custom user checking).
Better Authentication Support
ASP.NET supports forms-based user authentication, including cookie management and automatic redirecting of unauthorized logins. (You can still do your custom login page and custom user checking).
User Accounts and Roles
ASP.NET allows for user accounts and roles, to give each user (with a given role) access to different server code and executables.
High Scalability
- Much has been done with ASP.NET to provide greater scalability.
- Server to server communication has been greatly enhanced, making it possible to scale an application over several servers. One example of this is the ability to run XML parsers, XSL transformations, and even resource hungry session objects on other servers.
Easy Configuration
- Configuration of ASP.NET is done with plain text files.
- Configuration files can be uploaded or changed while the application is running. No need to restart the server. No more metabase or registry puzzle.
Easy Deployment
No more server restart to deploy or replace compiled code. ASP.NET simply redirects all new requests to the new code.
See the following video on ASP.NET for importance of session and view state: -
Click for more ASP.NET interview questions
Regards,
Visit for more Authors’ blog on ASP.NET interview questions
- Location:India, Mumbai
ASP.NET does not run by itself, it runs inside the process of IIS. Therefore, there are two authentication layers, which exist in ASP.NET system. First authentication happens at the IIS level and then at the ASP.NET level depending on the WEB.CONFIG file.
Below is how the whole process works:-
- IIS first checks to make sure the incoming request comes from an IP address that is allowed access to the domain. If not it denies the request.
- Next IIS performs its own user authentication if it is configured to do so. By default IIS allows anonymous access, so requests are automatically authenticated, but you can change this default on a per – application basis with in IIS.
- If the request is passed to ASP.NET with an authenticated user, ASP.net checks to see whether impersonation is enabled. If impersonation is enabled, ASP.net acts as though it were the authenticated user. If not ASP.net acts with its own configured account.
- Finally, the identity from step 3 is used to request resources from the operating system. If ASP.net authentication can obtain all the necessary resources it grants the users request otherwise it is denied. Resources can include much more than just the ASP.net page itself you can also use .NET’s code access security features to extend this authorization step to disk files, Registry keys and other resources.
See the following video on ASP.NET Forms authentication by using session hijack: -
Click for more ASP.NET interview questions
Regards,
Visit for more Author's blog on ASP.NET interview questions
- Location:India, Mumbai
A simple but most frequently asked ASP.NET interview question.
A query string is information sent to the server appended to the end of a page URL.
Following are the benefits of using query string for state management:-
- No server resources are required. The query string containing in the HTTP requests for a specific URL.
- All browsers support query strings.
Following are limitations of query string:-
- Query string data is directly visible to user thus leading to security problems.
- Most browsers and client devices impose a 255-character limit on URL length.
See the following video on ASP.NET for importance of session and viewstate: -
Explore for more ASP.NET interview questions tutorials.
Regards,
From Author’s blog see other blog links ASP.NET interview questions
- Location:India, Mumbai
HTTP is a stateless protocol , session and viewstate help you to maintain states between request and response.
For more information see the below video.
Click for more ASP.NET Interview questions
Regards,
Visit for more authors’ blog on ASP.NET Interview questions
- Location:India, Mumbai
Rule 1:- What is the Nature of the application(OLTP or OLAP)?
Rule 2:- Break your data in to logical pieces, make life simpler
Rule 3:- Do not get overdosed with rule 2
Rule 4:- Treat duplicate non-uniform data as your biggest enemy
Rule 5:- Watch for data separated by separators.
Rule 6:- Watch for partial dependencies.
Rule 7:- Choose derived columns preciously
Rule 8:- Do not be hard on avoidingredundancy, if performance is the key
Rule 9:- Multidimensional data is a different beast altogether
Rule 10:- Centralize name value table design
Rule 11:- For unlimited hierarchical data self-reference PK and FK
Courtesy: - Image from Motion pictures
Before you start reading this article let me confirm that I am not a guru in database designing. The below 11 points which are listed are points which I have learnt via projects, my own experiences and my own reading. I personally think it has helped me a lot when it comes to DB designing. Any criticism welcome.
The reason why I am writing a full blown article is, when developers sit for designing a database they tend to follow the three normal forms like a silver bullet. They tend to think normalization is the only way of designing. Due this mind set they sometimes hit road blocks as the project moves ahead.
In case you are new to normalization, then click and see 3 normal forms in action which explains all three normal forms step by step.
Said and done normalization rules are important guidelines but taking them as a mark on stone is calling for troubles. Below are my own 11 rules which I remember on the top head while doing DB design.
Rule 1:- What is the Nature of the application(OLTP or OLAP)?
When you start your database design the first thing to analyze is what is the natureof theapplication you are designing for, is it Transactional or Analytical. You will find many developers by default applying normalization rules without thinking about the nature of the application and then later getting in to performance and customization issues. As said there are 2 kinds of applications transaction based and analytical based,let’s understand what these types are.
Transactional: - In this kind of application your end user is more interested in CRUD i.e. Creating, reading, updating and deleting records. The official name for such kind of database is called as OLTP.
Analytical: -In these kinds of applications your end user is more interested in Analysis, reporting, forecasting etc. These kinds of databases have less number of inserts and updates. The main intention here is to fetch and analyze data as fast as possible. The official name for such kind of databases is OLAP.
So in other words if you think insert, updates and deletes are more prominent then go for normalized table design or else create a flat denormalized database structure.
Below is a simple diagram which shows how the names and address in the left hand side is a simple normalized table and by applying denormalized structure how we have created a flat table structure.
Rule 2:- Break your data in to logical pieces, make life simpler
This rule is actually the 1st rule from 1st normal formal. One of the signs of violation of this rule is if your queries are using too many string parsing functions like substring, charindexetc , probably this rule needs to be applied.
For instance you can see the below table which has student names , if you ever want to query student name who is having “Koirala” and not “Harisingh” , you can imagine what kind of query you can end up with.
So the better approach would be to break this field in to further logical pieces so that we can write clean and optimal queries.
Rule 3:- Do not get overdosed with rule 2
Developers are cute creatures. If you tell them this is the way, they keep doing it; well they overdo it leading to unwanted consequences. This also applies to rule 2 which we just talked above. When you think about decomposing, give a pause and ask yourself is it needed. As said the decomposition should be logical.
For instance you can see the phone number field; it’s rare that you will operate on ISD codes of phone number separately(Until your application demands it). So it would be wise decision to just leave it as it can lead to more complications.
Rule 4:- Treat duplicate non-uniform data as your biggest enemy
Focus and refactor duplicate data. My personal worry about duplicate data is not that it takes hard disk space, but the confusion it creates.
For instance in the below diagram you can see “5th Standard” and “Fifth standard” means the same. Now you can say due to bad data entry or poor validation the data has come in to your system. Now if you ever want toderive a report they would show them as different entities which is very confusing from end user point of view.
One of the solutions would be to move the data in to a different master table altogether and refer then via foreign keys. You can see in the below figure how we have created a new master table called as “Standards” and linked the same using a simple foreign key.
Rule 5:- Watch for data separated by separators.
The second rule of 1st normal form says avoid repeating groups. One of the examples of repeating groups is explained in the below diagram. If you see the syllabus field closely, in one field we have too much data stuffed.These kinds of fields are termed as “Repeating groups”. If we have to manipulate this data, the query would be complex and also I doubt performance of the queries.
These kinds of columns which have data stuffed with separator’s need special attention and a better approach would be to move that field to a different table and link the same with keys for better management.
So now let’s apply the second rule of 1st normal form “Avoid repeating groups”. You can see in the above figure I have created a separate syllabus table and then made a many-to-many relationship with the subject table.
With this approach the syllabus field in the main table is no more repeating and having data separators.
Rule 6:- Watch for partial dependencies.
Watch for fields which are depending partially on primary keys. For instance in the above table we can see primary key is created on roll number and standard. Now watch the syllabus field closely. Syllabus field is associated with a standard and not with a student directly (roll number).
Syllabus is associated with the standard in which the student is studying and not directly with the student. So if tomorrow we want to update syllabus we have to update for each student which is pain staking and not logical. It makes more sense to move these fields out and associate them with the standard table.
You can see how we have move the syllabus field and attached the same to standards table.
This rule is nothing but second normal form “All keys should depend on the full primary key and not partially”.
Rule 7:- Choose derived columns preciously
If you are working on OLTP applications must be getting rid of derive columns would be good thought, until there is some pressing reason of performance. In case of OLAP where we do lot of summations, calculations these kinds of fields are necessary to gain performance.
In the above figure you can see how average field is dependent on marks and subject. This is also one of form of redundancy. So for such kind of fields which are derived from other fields give a thought are they really necessary.
This rule is also termed as 3rd normal form “No columns should depend on other non-primary key columns”. My personal thought is do not apply this rule blindly see the situation; it’s not that redundant data is always bad. If the redundant data is calculative data , see the situation and then decide do you want to implement the third normal form.
Rule 8:- Do not be hard on avoidingredundancy, if performance is the key
Do not make it a strict rule that you will always avoid redundancy. If there is a pressing need of performance think about de-normalization. In normalization you need to make joins with many table and in denormalization the joins reduces and thus increasing performance.
Rule 9:- Multidimensional data is a different beast altogether
OLAP projects mostly deal with multidimensional data. For instance you can see the below figure, you would like to get sales as per country, customer and date. In simple words you are looking at sales figure which have 3 intersections of dimension data.
For such kind of situations a dimension and fact design is a better approach. In simple words you can create a simple central sales fact table which has the sales amount field and he makes a connection with all dimension tables using a foreign key relationship.
Rule 10:- Centralize name value table design
Many times I have come across name value tables. Name and value tables means it has key and some data associated with the key. For instance in the below figure you can see we have currency table and country table. If you watch the data closely they actually only have Key and value.
For such kind of table creating one central table and differentiating the data by using a type field makes more sense.
Rule 11:- For unlimited hierarchical data self-reference PK and FK
Many times we come across data with unlimited parent child hierarchy. For instance consider a Multi-level marketing scenario where one sales person can have multiple sales people below them. For such kind of scenarios using a self-referencing primary key and foreign key will help to achieve the same.
This article is not meant to say that do not follow normal forms , but do not follow them blindly , look at your project nature and type of data you are dealing with.
Out of full respect, below is a video which explains 3 normal forms step by step using a simple school table.
You can also visit my site for step by step videos on Design Patterns, UML, SharePoint 2010, .NET Fundamentals, VSTS, UML, SQL Server, MVC and lot more.
Visit for more authors blog on .NET Interview questions
- Location:India, Mumbai
There are five levels of the CMMI. According to the SEI,
Level 1 – Initial
At maturity level 1, processes are usually ad hoc and the organization usually does not provide a stable environment. Success in these organizations depends on the competence and heroics of people in the organization and not on the use of proven processes. In spite of this ad hoc, chaotic environment, maturity level 1 organizations often produce products and services that work; however, they frequently exceed the budget and schedule of their projects.
Maturity level 1 organizations are characterized by a tendency to over commit, abandon processes in the time of crisis, and not be able to repeat their past successes again.
Level 2 – Repeatable
At maturity level 2, software development successes are repeatable. The organization may use some basic project management to track cost and schedule.
Process discipline helps to ensure that existing practices are retained during times of stress. When these practices are in place, projects are performed and managed according to their documented plans.
Project status and the delivery of services are visible to management at defined points (for example, at major milestones and at the completion of major tasks).
Basic project management processes are established to track cost, schedule, and functionality. The necessary process discipline is in place to repeat earlier successes on projects with similar applications.
Level 3 – Defined
At maturity level 3, processes are well characterized and understood, and are described in standards, procedures, tools, and methods.
The organization has set of standard processes, which is the basis for level 3, is established and improved over time. These standard processes are used to establish consistency across the organization. Projects establish their defined processes by the organization’s set of standard processes according to tailoring guidelines.
The organization’s management establishes process objectives based on the organization is set of standard processes and ensures that these objectives are appropriately addressed.
A critical distinction between level 2 and level 3 is the scope of standards, process descriptions, and procedures. At level 2, the standards, process descriptions, and procedures may be quite different in each specific instance of the process (for example, on a particular project). At level 3, the standards, process descriptions, and procedures for a project are tailored from the organization’s set of standard processes to suit a particular project or organizational unit.
Level 4 – Managed
Using precise measurements, management can effectively control the software development effort. In particular, management can identify ways to adjust and adapt the process to particular projects without measurable losses of quality or deviations from specifications.
Sub processes are selected that significantly contribute to overall process performance. These selected sub processes are controlled using statistical and other quantitative techniques.
A critical distinction between maturity level 3 and maturity level 4 is the predictability of process performance. At maturity level 4, the performance of processes is controlled using statistical and other quantitative techniques, and is quantitatively predictable. At maturity level 3, processes are only qualitatively predictable.
Level 5 – Optimizing
Maturity level 5 focuses on persistently improving process performance through both incremental and innovative technological improvements. Quantitative process-improvement objectives for the organization are established, continually revised to reflect changing business objectives, and used as criteria in managing process improvement. The effects of deployed process improvements are measured and evaluated against the quantitative process-improvement objectives. Both the defined processes and the organization set of standard processes are targets of measurable improvement activities.
Process improvements to address common causes of process variation and measurably improve the organization’s processes are identified, evaluated, and deployed.
Optimizing processes that are nimble, adaptable and innovative depends on the participation of an empowered workforce aligned with the business values and objectives of the organization. The organization’s ability to rapidly respond to changes and opportunities is enhanced by finding ways to accelerate and share learning.
A critical distinction between maturity level 4 and maturity level 5 is the type of process variation addressed. At maturity level 4, processes are concerned with addressing special causes of process variation and providing statistical predictability of the results. Though processes may produce predictable results, the results may be insufficient to achieve the established objectives. At maturity level 5, processes are concerned with addressing common causes of process variation and changing the process (that is, shifting the mean of the process performance) to improve process performance (while maintaining statistical probability) to achieve the established quantitative process-improvement objectives.
Below is the figure, which will help you remembering the same.
Figure: - CMMI Levels
See the following video in c# using VSTS unit testing: -
Click for more .NET Interview questions
Regards,
Visit for more authors’ blog on .NET Interview questions
- Location:India, Mumbai