Posts

Showing posts from 2015

Difference between array, arraylist, List, Hashtable, Dictionary and SortedList in c#

Basic difference is that arrays are of fixed size. Whereas an ArrayList implements the list data structure and can dynamically grow. While arrays would be more performance that a list, a list would be far more flexible since you don't need to know the required size initially. Array - represents an old-school memory array - kind of like a alias for a normal type[] array. Can enumerate. Can't grow automatically. I would assume very fast insertion, retrieve and speed. ArrayList - automatically growing array. Adds more overhead. Can enum., probably slower than a normal array but still pretty fast. These are used a lot in .NET List - one of my favorites - can be used with generics, so you can have a strongly typed array, e.g. List . Other than that, acts very much like ArrayList. Hashtable - plain old hashtable. O(1) to O(n) worst case. Can enumerate the value and keys properties, and do key/val pairs. Dictionary - same as above only strongly typed via generics, such a...

. What is Cross Linking?

It is considered as one of the best strategy that can come in handy to yield high search engine rankings, by leveraging several domains owned by you

What do you know about Keyword stemming ?

It is trick to find out root word from search . For instance, a keyword like “house design” will be split to the word “house” by stemming algorithm that turns it possible. Thus, the search result appears on the screen will contain the word “house” in it

What is robots.txt?

It is a kind of text file utilized to provide the instructions to the crawlers about the caching and indexing of a website, directory, domain or a file of a webpage.

What methods would you apply for decreasing the loading time of a website

We can use the external style sheets, minimum images, decrease the file size of the images that we use, without compromising on the quality and use the CSS sprites to regulate the HTTP requests.

What is Google Sandbox

This is the place where the fresh and less authoritative sites were kept for a certain time period, till their establishment in the search results. This may happens due to the building of so many links within a short time span.

What is Googlebot

Googlebot is a kind of software used by the Google as a search bot to index a webpage. This software collects the information from every webpage by doing the crawling, caching and then indexing of a webpage. ..

What is a Back link in seo

Back links are the incoming links to your webpage or website and getting these back links from good PR and relevant site is always better for your site.

How to Improve Your Search Engine Ranking on Google

Improving Your Site's Placement on Google's Search Engine Results Google ranks a page according to a large number of factors. Exactly what these factors are is apparently a trade secret, although there are number of well-known things that contribute to the ranking of a page. 1. Links Pointing to Your Website One of the factors that contribute to a web page being considered "important" is the number of links pointing to that page. For example, if your page has 100 quality links leading to it, it will be ranked higher (in Google's estimation) than one that only has 20. But what are "quality" links"? These are links from other popular pages, that is, pages that have, themselves, many (quality) links pointing to them. (Yeah, I know. My definition is circular. And it's possible that the search engine has other factors that determine the quality of a link.) Anyway, in general, since Google ranks your pages according to the number of links p...

What are meta descriptions and do they still matter?

A meta description is the text that appears below your page in a search engine result that explains what the page is all about. In this example, the meta description is "Learn the elements needed to write a comprehensive blog post in just 9 easy steps Meta descriptions still matter, just not in the same way they used to. They used to be a place to optimize for keywords so crawlers would know more about your page contents; now, it's more important you write something compelling that makes readers want to click so you can improve conversion rates from SERP results to your website.

What is Off-Page Optimization?

We can say on page is the soul than its body without off page its quite difficult to get higher position in search engines for competitive keywords. In a simple language we can say off page optimization don’t allow you to make any changes in the website. It’s the process of building quality links, forum discussion, article, directory, bookmarking etc to boost the rank of your website.

What is On-Page Optimization?

On page optimization is very important part of SEO & play a vital role in the improvement of SERP (Search Engine Result Page). We can whatever changes made by us in coding or internal part of our webpage call on page for instance content adding, meta tag placing, meta description, image alt tag etc.

Which SEO techniques are popular?

Mainly two type of SEO technique is popular 1. White Hat SEO 2. Black Hat SEO (Negative SEO) One more type of SEO techniques which is also known is “Grey Hat SEO”

what is SEO?

SEO mainly stands foearch engine optimization and it’s a part of Internet Marketing. SEO is technique or process via this we can improve website visibility in major search engines like Google, Yahoo & Bing etc.

What is the difference between an ID selector and CLASS?

An ID selector identifies and sets style to only one occurrence of an element, while CLASS can be attached to any number of elements.

What is a class? What is an ID?

A class is a style (i.e., a group of CSS attributes) that can be applied to one or more HTML elements. This means it can apply to instances of the same element or instances of different elements to which the same style can be attached. Classes are defined in CSS using a period followed by the class name. It is applied to an HTML element via the class attribute and the class name. The following snippet shows a class defined, and then it being applied to an HTML DIV element.  .test {font-family: Helvetica; font-size: 20; background: black;} Also, you could define a style for all elements with a defined class. This is demonstrated with the following code that selects all P elements with the column class specified.   p.column {font-color: black;}  An ID selector is a name assigned to a specific style. In turn, it can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name. The foll...

How do CSS precedence/cascading rules work? How does the !important directive affect the rules?

CSS style rules “cascade” in the sense that they follow an order of precedence. Global style rules apply first to HTML elements, and local style rules override them. For example, a style defined in a style element in a webpage overrides a style defined in an external style sheet. Similarly, an inline style that is defined in an HTML element in the page overrides any styles that are defined for that same element elsewhere.  The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important property will always be applied no matter where that rule appears in the CSS document. So if you wanted to make sure that a property always applied, you would add the !important property to the tag. So, to make the paragraph text always red, in the above example, you would write:  p { color: #ff0000 !important; }

What are different ways to apply styles to a Web page

There are four ways to apply style to a Web page.   Inline CSS: HTML elements may have CSS applied to them via the STYLE attribute.You can always check HTML, CSS and JavaScript code impact using Online HTML Javascript editor. <p style=”font-size: 12px; color: #000000;”>Test </p> Embedded CSS: CSS may be embedded in a Web page by placing the code in a STYLE element within the HEAD element.For Example: If You have element into webpage, you can apply embedded style like shows in example. <head> <style type=”text/css”> h2 { font-size: 16px; color: #2d2d2d; font-weight: 900; } </style> </head> Linked CSS : CSS can be placed in an external file (a simple text file containing         CSS) and linked via the link element.You can apply style to webpage using external file as shown in example. <link rel=”stylesheet” href=”custom/custom.css” type=”text/css” media=”screen, projection” /> Import...

What are advantages of HTML5?

a) Cleaner markup than earlier versions of HTML b) Additional semantics of new elements like     Header, nav, and time c) New form input types and attributes that will (and in Opera’s case, do) take the hassle out of            scripting forms.

Difference between HTML and HTML5 ?

HTML5 is nothing more then upgraded version of HTML where in HTML5 supports the innovative features such as Video, Audio/mp3, date select function , placeholder , Canvas, 2D/3D Graphics, Local SQL Database added so that no need to do external plugin like Flash player or other library elemenents

What is the major improvement with HTML5 in reference to Flash?

Flash is not supported by major mobile devices such as iPad, iPhone and universal android applications. Those mobile devices have lack of support for installing flash plugins. HTML5 is supported by all the devices, apps and browser including Apple and Android products. Compared to Flash, HTML5 is very secured and protected. That eliminates major concerns that we have seen with Flash.

What is the purpose of HTML5 versus XHTML?

HTML5 is the next version of HTML 4.01, XHTML 1.0 and DOM Level 2 HTML. It aims to reduce the need for proprietary plug-in- based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, Apache Pivot, and Sun JavaFX. Instead of using those plugins, it enables browser to serve elements such as video and audio without any additional requirements on the client machine.

What are Session state modes in ASP.NET?

ASP.NET supports different session state storage options: In-Process is the default approach. It stores session state locally on same web server memory where the application is running.  State-server mode stores session state in a process other than the one where application is running. Naturally, it has added advantages that session state is accessible from multiple web servers in a Web Farm and also session state will remain preserved even web application is restarted.  SQLServer mode stores session state in SQL Server database. It has the same advantages as that of State-server. Custom modes allows to define our custom storage provider. Off mode disables session storage.

What is the difference between custom controls and user controls?

Following is the difference between custom controls and user controls Custom controls are basically compiled code i.e. DLLs. These can be easily added to toolbox, so it can be easily used across multiple projects using drag and drop approach. These controls are comparatively hard to create. But User Controls (.ascx) are just like pages (.aspx). These are comparatively easy to create but tightly couple with respect to User Interface and code. In order to use across multiple projects, we need to copy and paste to the other project as well.

What is the concept of Postback in ASP.NET?

A postback is a request sent from a client to server from the same page user is already working with. ASP.NET was introduced with a mechanism to post an HTTP POST request back to the same page. It's basically posting a complete page back to server (i.e. sending all of its data) on same page. So, the whole page is refreshed. Another concept related to this approach is "Callback" that is also asked sometimes during a technical interview question.

What is difference between DELETE and TRUNCATE commands?

Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.   1. TRUNCATE: TRUNCATE is faster and uses fewer system and transaction log resources than DELETE. TRUNCATE removes the data by deallocating the data pages used to store the table's data, and only the page deallocations are recorded in the transaction log. TRUNCATE removes all rows from a table, but the table structure, its columns, constraints, indexes and so on, remains. The counter used by an identity for new rows is reset to the seed for the column. You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint. Because TRUNCATE TABLE is not logged, it cannot activate a trigger.  TRUNCATE cannot be rolled back.  TRUNCATE is DDL Command. TRUNCATE Resets identity of the table   2. DELETE:  DELETE removes row...

What is SQL Server Agent in sql?

SQL Server agent plays an important role in the day- to-day tasks of a database administrator (DBA).  It is often overlooked as one of the main tools for SQL Server management.  Its purpose is to ease the implementation of tasks for the DBA, with its full- function scheduling engine, which allows you to schedule your own jobs and scripts.

How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?

One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships. One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships.  Many- to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table

What is NOT NULL Constraint in sql?

A NOT NULL constraint enforces that the column will not accept null values. The NOT NULL constraints are used to enforce domain integrity, as the check constraints.

Advantages of using Stored Procedures?

1. Stored procedure can reduced network traffic and latency, boosting application performance. 2. Stored procedure execution plans can be reused, staying cached in SQL Server's memory, reducing server overhead. 3. Stored procedures help promote code reuse. 4. Stored procedures can encapsulate logic. You can change stored procedure code without affecting clients. 5. Stored procedures provide better security to your data.

What is PRIMARY KEY in sql?

A PRIMARY KEY constraint is a unique identifier for a row within a database table.  Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table.  The primary key constraints are used to enforce entity integrity.

What is Log Shipping in sql?

Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and can be used this as the Disaster Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically restore them on the standby server at defined interval.  

what is foreign key in sql

What is FOREIGN KEY? A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the corresponding data values.  A foreign key in one table points to a primary key in another table. Foreign keys prevent actions that would leave rows with foreign key values when there are no primary keys with that value.  The foreign key constraints are used to enforce referential integrity.

sql interview questions and answers part 2

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE? They specify a search condition for a group or an aggregate. But the difference is that HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

sql interview questions and answer part 1

What's the difference between a primary key and a unique key? Both primary key and unique key enforces uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a non-clustered index by default. Another major difference is that, primary key doesn't allow Nulls, but unique key allows one NULL only.

differences between function and stored procedure?

1) Function returns only one value but procedure returns one or more than one value. 2) Function can be utilized in select statements but that is not possible in procedure. 3) Procedure can have an input and output parameters but function has only input parameters only. 4) Exceptions can be handled by try catch block in procedures but that is not possible in function.

What is HashTable?

A Hashtable is a collection of key-value pairs. Entries in this are instance of DictionaryEntry type.  It implements IDictionary, ISerilizable, IDeserializable collback interface.

What is BitArray?

The BitArray collection is a composite of bit values. It stores 1 or 0 where 1 is true and 0 is false.  This collection provides an efficient means of storing and retrieving bit values.

What is ArrayList in c sharp?

ArrayList is a dynamic array. Elements can be added and removed from an arraylist at the runtime.  In this elements are not automatically sorted.

What is Array in C sharp?

An array is a collection of related instance either value or reference types. Array posses an immutable structure in which the number of dimensions and size of the array are fixed at instantiation. C# Supports Single, Mult dimensional and Jagged Array. Single Dimensional Array: it is sometimes called vector array consists of single row. Multi-Dimensional Array: are rectangular & consists of rows and columns. Jagged Array: also consists of rows & columns but in irregular shaped (like row 1 has 3 column and row 2 has 5 column)

Features of c# .net

Boolean Conditions Automatic Garbage Collection Standard Library Assembly Versioning Properties and Events Delegates and Events Management Easy-to-use Generics Indexers Conditional Compilation Simple Multithreading LINQ and Lambda Expressions Integration with Windows

What is a Constructor in c#?

It is the first method that are called on instantiation of a type. It provides way to set default values for data before the object is available for use. Performs other necessary functions before the object is available for use.

What is linq (Language Integrated Query)

LINQ is a set of extensions to .NET Framework that encapsulate language integrated query, set and other transformation operations. It extends VB, C# with their language syntax for queries. It also provides class libraries which allow a developer to take advantages of these features.

What is an Event in c sharp?

When an action is performed, this action is noticed by the computer application based on which the output is displayed. These actions are called events. Examples of events are pressing of the keys on the keyboard, clicking of the mouse. Likewise, there are a number of events which capture your actions.

What is an Exception in dotNET?

Exceptions are errors that occur during the runtime of a program. The advantage of using exceptions is that the program doesn’t terminate due to the occurrence of the exception. Whenever an exception is occurred the .NET runtime throws an object of specified type of Exception. The class ‘Exception’ is the base class of all the exceptions..

What are generics in C#.NET?

Generic types to maximize code reuse, type safety, and performance. They can be used to create collection classes. Generic collection classes in the System.Collections.Generic namespace should be used instead of classes such as ArrayList in the System.Collections namespace.

What’s the advantage of using System.Text.StringBuilder over System.String?

StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text.  Strings are immutable, so each time it’s being operated on, a new instance is created

What is ACID rule for transactions in Database

Following is the important ACID rule for transactions in relational Database Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions) Transaction must be Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t) Transaction must be Isolated (no transaction sees the intermediate results of the current transaction) Transaction must be Durable (the values persist if the data had been committed even if the system crashes right after)

What is an abstract class in C#

A class that cannot be instantiated. A concept in C++ known as pure virtual method.  A class that must be inherited and have the methods over-ridden.  Essentially, it’s a blueprint for a class without any implementation.

Benefits and Limitation of using Cookies?

Following are benefits of using cookies for state management :- No server resources are required as they are stored in client. They are light weight and simple to use Following are limitation of using cookies :- Most browsers place a 4096-byte limit on the size of a cookie,although support for 8192-byte cookies is becoming more common in the new browser and client-device versions available today. Some users disable their browser or client device’s ability to receive cookies, thereby limiting the use of cookies. Cookies can be tampered and thus creating a security hole. Cookies can expire thus leading to inconsistency. Below is sample code of implementing cookies :- Request.Cookies.Add(New HttpCookie(“name”, “user1”))  

Difference between dataset and datareader in c#

Following are some major differences between Dataset and Datareader DataReader provides forward-only and read-only access to data , while the DataSet object can hold more than one table (in other words more than one rowset) from the same data source as well as the relationships between them. Dataset is a disconnected architecture while datareader is connected architecture. Dataset can persists contents while datareader can not persist contents , they are forward only.

MVC Interview Question with Answer Part 2

What is difference between TempData and ViewData ? “TempData” maintains data for the complete request while “ViewData” maintains data only from Controller to the view. Does “TempData” preserve data in the next request also? “TempData” is available through out for the current request and in the subsequent request it’s available depending on whether “TempData” is read or not. So if “TempData” is once read it will not be available in the subsequent request. What is the use of Keep and Peek in “TempData”? Once “TempData” is read in the current request it’s not available in the subsequent request. If we want “TempData” to be read and also available in the subsequent request then after reading we need to call “Keep” method as shown in the code below. @TempData[“MyData”]; TempData.Keep(“MyData”); The more shortcut way of achieving the same is by using “Peek”. This function helps to read as well advices MVC to maintain “TempData” for the subsequent request. string str = TempData.Peek("Td...

ASP.NET MVC Interview Question with answer Part 1

Image
What is MVC (Model View Controller)? MVC is an architectural pattern which separates the representation and user interaction. It’s divided into three broader sections, Model, View, and Controller. Below is how each one of them handles the task. The View is responsible for the look and feel. Model represents the real world object and provides data to the View. The Controller is responsible for taking the end user request and loading the appropriate Model and View. Figure: MVC (Model view controller) Explain MVC application life cycle? There are six broader events which occur in MVC application life cycle below diagrams summarize it. Any web application has two main execution steps first understanding the request and depending on the type of the request sending out appropriate response. MVC application life cycle is not different it has two main phases first creating the request object and second sending our response to the browser. Creating the request object: - The request objec...