ASP.NET Interview Questions and answers
his is a list of questions I have gathered and created over a period of time from my experience, many of which I felt where incomplete or simply wrong. I have finally taken the time to go through each question and correct them to the best of my ability. However, please feel free to post feedback to challenge, improve, or suggest new questions. I want to thank those of you that have contributed quality questions and corrections thus far.
There are some questions in this list that I do not consider to be good questions for an interview. However, they do exist on other lists available on the Internet so I felt compelled to keep them here for easy access.
-
Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
- What’s the difference between Response.Write() andResponse.Output.Write()?
Response.Output.Write() allows you to write formatted output. - What methods are fired during the page load?
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading. - When during the page processing cycle is ViewState available?
After the Init() and before the Page_Load(), or OnLoad() for a control. - What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page - Where do you store the information about the user’s locale?
System.Web.UI.Page.Culture - What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only. - What’s a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents. - Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();"); - What data types do the RangeValidator control support?
Integer, String, and Date. - Explain the differences between Server-side and Client-side code?
Server-side code executes on the server. Client-side code executes in the client's browser. - What type of code (server or client) is found in a Code-Behind class?
The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code. - Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user. - What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performas a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address. - Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Valid answers are:
· A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
· A DataSet is designed to work without any continuing connection to the original data source.
· Data in a DataSet is bulk-loaded, rather than being loaded on demand.
· There's no concept of cursor types in a DataSet.
· DataSets have no current record pointer You can use For Each loops to move through the data.
· You can store many edits in a DataSet, and write them to the original data source in a single operation.
· Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
- What is the Global.asax used for?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events. - What are the Application_Start and Session_Start subroutines used for?
This is where you can set the specific variables for the Application and Session objects. - Can you explain what inheritance is and an example of when you might use it?
When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class. - Whats an assembly?
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN - Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page. - Explain what a diffgram is, and a good use for one?
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service. - Whats MSIL, and why should my developers need an appreciation of it if at all?
MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer. - Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The Fill() method. - Can you edit data in the Repeater control?
No, it just reads the information from its data source. - Which template must you provide, in order to display data in a Repeater control?
ItemTemplate. - How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate. - What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
You must set the DataSource property and call the DataBind method. - What base class do all Web Forms inherit from?
The Page class. - Name two properties common in every validation control?
ControlToValidate property and Text property. - Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
DataTextField property. - Which control would you use if you needed to make sure the values in two different controls matched?
CompareValidator control. - How many classes can a single .NET DLL contain?
It can contain many classes.
Web Service Questions
- What is the transport protocol you use to call a Web service?
SOAP (Simple Object Access Protocol) is the preferred protocol. - True or False: A Web service can only be written in .NET?
False
- What does WSDL stand for?
Web Services Description Language. - Where on the Internet would you look for Web services?
http://www.uddi.org - True or False: To test a Web service you must create a Windows application or Web application to consume this service?
False, the web service comes with a test page and it provides HTTP-GET method to test.
State Management Questions
- What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks. - What is the lifespan for items stored in ViewState?
Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page). - What does the "EnableViewState" property do? Why would I want it on or off?
It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate. - What are the different types of Session state management options available with ASP.NET?
ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.
Common Questions and Answers from Performance Tuning Webinars
Q: Which will be faster out of these two queries?
SELECT ... WHERE some_col IN (1,2,3) or
SELECT ... WHERE some_col = 1 OR some_col = 2 OR some_col = 3
A:
Neither. The optimizer rewrites an IN() operator to a series of OR conditions, so there will be no performance diffference. Use IN() as it makes the code shorter and more readable.
Q: Where does MyISAM cache table records?
A:
Nowhere. MyISAM does not cache table records like InnoDB does in it's innodb_buffer_pool. Instead, MyISAM relies on the operating system buffering to buffer table records as it reads them from the .MYD file. The MyISAM key_buffer only stores index blocks, not data records.
Q: Which will be faster out these two queries:
SELECT ... FROM t1, t2 WHERE t1.id = t2.id
SELECT ... FROM t1 INNER JOIN t2 ON t1.id = t2.id
A:
Neither. The optimizer actually will rewrite the bottom query into the top form. The SQL style you use is, of course, entirely up to you, however I recommend using the bottom style (known as ANSI syntax) over the top style (known as Theta syntax) for a couple reasons:
- MySQL only supports the inner and cross join for the Theta syntax. However, MySQL supports INNER, CROSS, LEFT and RIGHT outer joins for the ANSI syntax. Mixing and matching both styles can lead to hard-to-read SQL code.
- It is supremely easy to miss a join condition with Theta style, especially when joining many tables together. Leaving off a join condition by accident in the WHERE clause will lead to a cartesian product (not a good thing!). ANSI syntax is more explicit, and it is much harder to forget a join condition
Q: Is InnoDB faster/better than MyISAM
A:
It completely depends. Nobody ever really likes the answer to this question, but it is completely true. There are strengths and disadvantages to each storage engine. MyISAM has very good read performance, bulk load performance, and has a small footprint. But, InnoDB is great for heavy UPDATE environments, transaction needs, referential integrity, and fast single key lookups. You need to pick an engine based on what your application needs, and not some general "only use XXX engine" dictate.
Q: Is CHAR faster than VARCHAR?
A:
No, not really. If there is any performance difference, it is negligible. Pick CHAR if you know that the data has a specific number of characters (like a social security number, for instance) and VARCHAR otherwise.
Q: Is VARCHAR(80) faster than VARCHAR(255)
A:
Yes, but probably not in the way you think. AFAIK, there's no difference (at least in recent versions of MySQL and InnoDB) between the speed at which VARCHAR columns of different lengths are retrieved from disk or memory. However, there is a big difference when either of the following scenarios occurs:
- A temporary table is implicitly created to handle a GROUP BY or ORDER BY clause and a VARCHAR column is in the SELECT statement
- A temporary table is created explicitly which contains a VARCHAR column
In these cases, the length of the VARCHAR columns does come into play. Why? Because temporary tables in memory are actually just tables of the MEMORY storage engine. The MEMORY storage engine, for some reason, treats all VARCHAR(X) columns as CHAR(X) columns.
This means that if you define two fields, one as VARCHAR(255) and another as VARCHAR(128), the latter will consume half as much space when allocated in a temporary table. The more records can fit into the max_heap_table_size, the fewer cases of swapping to disk tables (look for SHOW STATUS LIKE 'Created_tmp_disk_';) will occur, resulting in better overall performance.
Q: Are there performance issues when joining tables from different storage engines
A:
No. Issuing a SELECT against multiple storage engines is fine. It's when you mix and match transactional and non-transactional engines within a transaction that modifies data that you will get unpredictable results.
Q: If I change a derived table to a view, will performance increase?
A:
No. A view is simply a derived table behind the scenes (at least when created using the TEMPTABLE algorithm). This means there is no performance difference between a regular derived table and a view. The view will simply make the code more readable and more "componentized".
Q: If I see "Using temporary; Using filesort" in the Extra column of EXPLAIN output, does that mean a temporary table is created on disk?
A:
No. A disk-based table will only occur in the following situations:
- When the size of the implicitly created temporary table (from a GROUP BY or ORDER BY on a non-indexed column) is greater than both tmp_table_size and max_heap_table_size
- When there are any BLOB or TEXT fields in the SELECT expression
- When a full table scan occurs that exceeds the read_buffer_size variable (configured per connection thread)
These are the scenarios (off the top of my head) I can think of which cause disk-based temporary table creation. There could be a few more. By the way, the disk-based temporary table created is a MyISAM table.
Q: Is it possible to do a FULL OUTER JOIN in MySQL?
A:
Yes. Use both LEFT and RIGHT JOIN on the same join condition in the same query, like so:
SELECT * FROM A LEFT JOIN B ON A.id = B.id UNION ALL SELECT * FROM A RIGHT JOIN B ON A.id = B.id WHERE A.id IS NULLPosted in: Interview Questions database | Tags: interview questions and answers interview performance mysql database sql pl sql tuning webinars full outer join outer join using
55 screening questions for Windows admin
- What is Active Directory?
- What is LDAP?
- Can you connect Active Directory to other 3rd-party Directory Services? Name a few options.
- Where is the AD database held? What other folders are related to AD?
- What is the SYSVOL folder?
- Name the AD NCs and replication issues for each NC
- What are application partitions? When do I use them
- How do you create a new application partition
- How do you view replication properties for AD partitions and DCs?
- What is the Global Catalog?
- How do you view all the GCs in the forest?
- Why not make all DCs in a large forest as GCs?
- Trying to look at the Schema, how can I do that?
- What are the Support Tools? Why do I need them?
- What is LDP? What is REPLMON? What is ADSIEDIT? What is NETDOM? What is REPADMIN?
- What are sites? What are they used for?
- What’s the difference between a site link’s schedule and interval?
- What is the KCC?
- What is the ISTG? Who has that role by default?
- What are the requirements for installing AD on a new server?
- What can you do to promote a server to DC if you’re in a remote location with slow WAN link?
- How can you forcibly remove AD from a server, and what do you do later? • Can I get user passwords from the AD database?
- What tool would I use to try to grab security related packets from the wire?
- Name some OU design considerations.
- What is tombstone lifetime attribute?
- What do you do to install a new Windows 2003 DC in a Windows 2000 AD?
- What do you do to install a new Windows 2003 R2 DC in a Windows 2003 AD?
- How would you find all users that have not logged on since last month?
- What are the DS* commands?
- What’s the difference between LDIFDE and CSVDE? Usage considerations?
- What are the FSMO roles? Who has them by default? What happens when each one fails?
- What FSMO placement considerations do you know of?
- I want to look at the RID allocation table for a DC. What do I do?
- What’s the difference between transferring a FSMO role and seizing one? Which one should you NOT seize? Why?
- How do you configure a “stand-by operation master” for any of the roles?
- How do you backup AD?
- How do you restore AD?
- How do you change the DS Restore admin password?
- Why can’t you restore a DC that was backed up 4 months ago?
- What are GPOs?
- What is the order in which GPOs are applied?
- Name a few benefits of using GPMC.
- What are the GPC and the GPT? Where can I find them?
- What are GPO links? What special things can I do to them?
- What can I do to prevent inheritance from above?
- How can I override blocking of inheritance?
- How can you determine what GPO was and was not applied for a user? Name a few ways to do that.
- A user claims he did not receive a GPO, yet his user and computer accounts are in the right OU, and everyone else there gets the GPO. What will you look for?
- Name a few differences in Vista GPOs
- Name some GPO settings in the computer and user parts.
- What are administrative templates?
- What’s the difference between software publishing and assigning?
- Can I deploy non-MSI software with GPO?
- You want to standardize the desktop environments (wallpaper, My Documents, Start menu, printers etc.) on the computers in one department. How would you do that?
- What do you do to install a new Windows 2003 DC in a Windows 2000 AD?
50 hot SEO Interview Questions
Technical / Tactics
Every SEO prefers certain tactics over others, but familiarity with many could indicate a deeper understanding of the industry. And while every SEO doesn't need to have a web developer background, having such skills can help set someone apart from the crowd.
- Give me a description of your general SEO experience.
- Can you write HTML code by hand?
- Could you briefly explain the PageRank algorithm?
- How you created any SEO tools either from scratch or pieced together from others?
- What do you think of PageRank?
- What do you think of using XML sitemaps?
- What are your thoughts on the direction of Web 2.0 technologies with regards to SEO?
- What SEO tools do you regularly use?
- Under what circumstances would you look to exclude pages from search engines using robots.txt vs meta robots tag?
- What areas do you think are currently the most important in organically ranking a site?
- Do you have experience in copywriting and can you provide some writing samples?
- Have you ever had something you've written reach the front-page of Digg? Sphinn? Or be Stumbled?
- Explain to me what META tags matter in today's world.
- Explain various steps that you would take to optimize a website?
- If the company whose site you've been working for has decided to move all of its content to a new domain, what steps would you take?
- Rate from 1 to 10, tell me the most important "on page" elements
- Review the code of past clients/company websites where SEO was performed.
- What do you think about link buying?
- What is Latent Semantic Analysis (LSI Indexing)?
- What is Phrase Based Indexing and Retrieval and what roles does it play?
- What is the difference between SEO and SEM?
- What kind of strategies do you normally implement for back links?
- What role does social media play in an SEO strategy?
- What things wouldn't you to do increase rankings because the risk of penalty is too high?
- What's the difference between PageRank and Toolbar PageRank?
- Why might you want to use nofollow on an internal link?
Analysis
A big part of SEO involves assessing the effectiveness of a campaign both relative to past performance as well as to competing sites.
- Are you familiar with web analytics and what packages are your familiar with?
- From an analytics perspective, what is different between a user from organic search results vs. a type-in user?
- How do you distinguish the results of your search optimization work from a seasonal change in traffic patterns?
- How do you evaluate whether an SEO campaign is working?
- What does competitive analysis mean to you and what techniques do you use?
- If you've done 6 months of SEO for a site and yet there haven't been any improvements, how would you go about diagnosing the problem?
- How many target keywords should a site have?
- How do *you* help a customer decide how to their budget between organic SEO and pay-per-click SEM?
- You hear a rumor that Google is weighting the HTML LAYER tag very heavily in ranking the relevance of its results – how does this affect your work?
- Why does Google rank Wikipedia for so many topics?
Industry Involvement
Is SEO just a job to pay the bills? Nothing wrong with that, but some senior positions can benefit from more enthusiasm and interest that can be measured by work done outside of the office.
- If salary and location were not an issue, who would you work for?
- In Google Lore – what are 'Hilltop', 'Florida' and 'Big Daddy'?
- Have you attended any search related conferences?
- Google search on this candidates name, (if you cannot find them, that's a red flag).
- Do you currently do SEO on your own sites? Do you operate any blogs? Do you currently do any freelance work and do you plan on continuing it?
- Of the well-known SEOs, who are you not likely to pay attention to?
- What are some challenges facing the SEO industry?
- What industry sites, blogs, and forums do you regularly read?
- Who are the two key people – who started Google?
- Who is Matt Cutts?
- If you were bidding on a contract, what competitor would you most worry about?
Open-Ended
These questions are more about how an answer is given rather than the actual answer. They often scare interviewees, but with no wrong answer they're actually a good opportunity to shine.
- Tell me your biggest failure in an SEO project
- What areas of SEO do you most enjoy?
- In what areas of SEO are you strongest?
- In what areas of SEO are you weakest?
- How do you handle a client who does not implement your SEO recommendations?
- Can you get "xyz"? company listed for the keyword "Google"? in the first page?
- What do you think is different about working for an SEO agency vs. doing SEO in-house?
- Why are you moving from your current position and/or leaving any current projects?
39 student interview questions from NetApp
- Why did you choose your major?
- Describe a recent leadership experience.
- Which courses have you enjoyed the most? The least? Why?
- What is your GPA?
- If you could do so, how would you plan your education differently?
- Describe your most rewarding college experience. Your most challenging.
- Tell me about yourself.
- What do you consider to be your greatest strengths?
- If you could change one thing about yourself, what would it be?
- Describe a time you failed at something and how you handled it?
- What three keywords would your peers use to describe you, and why?
- Give me an example of something complex that you needed to effectively communicate to others. What made it complex? Why was it difficult to communicate?
- Tell me about an important goal that you set in the past. Were you successful? Why?
- Tell me about a situation where you had to speak up (be assertive) in order to put across a point that was important to you.
- Describe the most significant written document, report, or presentation, you have completed.
- Tell me about something you have done that is very creative.
- Describe a time when you were faced with problems or stress that tested your coping skills. What did you do?
- What motivated you to apply for this position?
- What interests you most about this job? Least?
- Why do you want to work for our company?
- What do you know about our company?
- What two or three things are most important to you in your job?
- If you were hiring a graduate for this position, what successful characteristics would you look for in a candidate?
- Describe three key skills or qualities you would bring to this position.
- Why should we hire you?
- Describe your job-related skills and experience, and how they relate to this position.
- What have you learned most from some of the jobs you have held?
- What did you enjoy most about your last job? Least?
- How would a former supervisor or professor describe you and your work?
- Describe a workplace challenge you faced and how you handled it.
- Tell me about a time you worked on a team. How did you handle it?
- Describe an experience involving a deadline. How were you able to finish on time?
- Describe a time you went above and beyond the call of duty to get a job done.
- Give me an example of your ability to lead others.
- Tell me about a time you wish you had done more planning. What did you learn?
- What are your short-range career goals?
- What are your long-range career goals? How are you preparing yourself to achieve them?
- What characteristics do you possess that will make you successful in your career?
- Who, or what, influenced you most with regard to your career objectives?