All the ASP.NET Interview questions listed in this article are asked in many company interviews. They give you system and ask you to write code to solve these questions. You may have to write programs for 1 or 2 questions not for all the questions in this article.
Question 1:
Please write a sample program that parses the string into a series of substrings where the delimiter between the substrings is ^*!%~ and then reassembles the strings and delimiters into a single new string where each of the substrings is in the reverse order from the original string. The method must return the final string.
Original String
Token A^*!%~Token B^*!%~Token C^*!%~Token D^*!%~Token E
Output String
Token E^*!%~Token D^*!%~Token C^*!%~Token B^*!%~Token A
Click here to get the answer for question 1
Question 2:
How to bind an XML file to dropdownlist. The dropdownlist items should be sorted in ascending order. Click here for the complete question with the answer, Click here to get the answer.
Question 3:
Reading and writing to an XML file. Click here to get the answer.
Question 4:
Write a custom reusable function to populate a dropdownlist, Click here to get the answer.
Question 5:
List all the files in a directory on a web form. The files must be displayed in a gridview control. The name of the file and create date must be displayed, Click here to get the answer.
Question 6:
Give an example to show how to write and read a cookie from a client's computer, Click here to get the answer.
Question 7:
Write a reusable split function that can be used to split any given string with a given delimiter?
Subscribe to:
Post Comments (Atom)
You had done good job.
ReplyDeleteThanks man... good stuff...
ReplyDeletecan you please post ASP.NET and C#,SQL SERVER 2005 objective type Questions?
ReplyDeletehow to create a login page using username and password
ReplyDeleteWe want to add xmlfile in two dropdownlist like one dropdownlist contains states of country after that automatically contains all district of selected state of country in another dropdownlist in .net C#
ReplyDeletePlease Help Me
Atul
hi....
ReplyDeleteThis is an Interview question asked to me..
How do you access a web service which is having windows authentication,where do you provide password for such web services.can any one tell me the answer
please post some objectives and oral sort of question asked in the interviews for trainees
ReplyDeleteHi,you can use network credentials object and attach that to ur webservice
ReplyDeletecan you please write a program regarding the use of Captcha???
ReplyDeleteSIR YOU HAVE DONE GREAT JOB I AHVE READ ALL YOUR PAGES HAVIG BEST COLLECTION IN ALL SECTION....HARTLY THANKS
ReplyDeletecan u pls mail me all .net related question asked in interviews? pls.
ReplyDeleteemail id:pratikbhra@gmail.com
Write an algorithm to find non-repeat character from a string i.e. In "total"char "o" would be the result , in "teeter" char "r" would be the result.
ReplyDeleteGood Evening sir,your blogspot is awesomee.can you please mail me all .net questions and answers which they will asked in an interview,please sir..
ReplyDeleteemail id: praveen.19.2007@gmail.com
can u pls mail me all .net,c#,sql server related question asked in interviews? pls.
ReplyDeleteemail id:gpanday60@gmail.com
Hi Venkat,
ReplyDeleteThis is Gautam Kumar and I am preparing for .net interview and found your tutorials are best for freshers like me. I want a help on the below question that was asked during my interview :
I was asked to develop a time-card applicaiton. A timecard application is used to keep time logs of work done by the employees in an organization. Requirements are follows:
-Time card entries from employees are kept in files.
-Each file contains timecard entries of one division.
-Each line is one time-record of employee.
-Some divisions keep their records in comma seprated key-value pair format:
Empid=xx,day=ddmmyyyy, time=xx xx
-While others keep their records in the fixed length format
IdxxxxDayddmmyyyytimexxxx
-time is float, xxxx represents xx.xx
-First line of file indicates format type, fixedlength(FL)or key valye(KV)and Division ID
There are 10 divisions of the company, and each divisions has 1000 employees. There are 365 records per employee (that is one year of records).
1. as a first step, create your own file creation program which crates such files with random data records,
2. The main exercise is to create an application.
Your application has to process all the records presents in the files and calculate following things:-
-Average daily employee time of each division.
-Highest and Lowest time of each division.
-Average of Company
-Highest and Lowest time of company
This information is to be written to an output file in the following format:
File will be of the following format. DIV must be passed, DIV is Division name and not ID.
DIV=AVGDIV
DIV=HIGHDIV
DIV=LOWDIV
AVGCOM
LOWCOM
HIGHCOM
Considering that the format of the output might change in future, what kind of design would make it pre-prepared for it. include that.
Can u please publish the solution for this question or you can mail me to my email: gautam.pandit@yahoo.co.in. Also can you please provide some more written program example for common.
I would be very grateful to you an wish you a good luck for your life for such excellent work.
Thanks and regards,
Gautam Kumar
can you plz give me the solution of folloeing program..
ReplyDeletestring:Ajay kumar Singh
output:A. K. Singh
Hey Ajay Singh here is the solution for your output -:
DeleteVB.Net Code -:
Public Sub replace()
Dim mstrName As String = "Ajay kumar Singh"
Literal1.Text = mstrName
Dim mstrName1 As String = mstrName.Replace("Ajay", "A.").Replace("kumar", "k.")
Literal1.Text = mstrName1
End Sub
Output :
A. k. Singh
C# Code:
Deletestatic void Main(string[] args)
{
string inputName = "Ajay Kumar Singh";
string[] arrName = inputName.Split(' ');
string outputName = "";// A.K.Singh
for(int i=0; i<arrName.Length-1;i++)
{
outputName = outputName + arrName[i].Substring(0, 1) + ".";
}
outputName = outputName + arrName[arrName.Length - 1];
Console.WriteLine(outputName);
Console.ReadLine();
}
Sir i am new in .net but after watching your vedio,its very easy for programming in .net
ReplyDeleteHi Venkat,
ReplyDeleteyou are superb. it is very easy for the new joiners who can learn .net very easily by looking at your blog.
class Program
ReplyDelete{
static void Main(string[] args)
{
byte a = 10, b = 20;
byte c = a + b; //error
short a1 = 10, b1 = 20;
short c1 = a1 + b1;//error
sbyte a2 = 10, b2 = 20;
sbyte c2 = a2 + b2;//error
ushort a3 = 10, b3 = 20;
ushort c3 = a3 + b3;//error
int x = 10, y = 20;
int z = x + y;//works fine
}
could you please explain..why can't we store the sum of two bytes in a byte variable..but we can store sum of two integers in an integer variable?
how to answer this question?Is it require any internal implementation to answer this question.
This is because, arithmetic expression on the right-hand side of the assignment operator evaluates to int by default.
Delete(Ref MSDN)
For more understanding refer the below links
http://msdn.microsoft.com/en-us/library/5bdb6693.aspx
http://msdn.microsoft.com/en-us/library/exx3b86w.aspx
hi sir..
ReplyDeleteas a fresher,i need to face C language objective type questions during the written test but m getting diferent o/p with different compilers. so m very much confused and not getting which o/p is to be considered as right one.
i would like to know which C-COMPILER IS RECOMMENDED.
though this que is not in this context...I hope i 'll get reply
thanks in advance
Some interview questions
ReplyDeleteHow to use transaction in Entity framework
What is difference between single(), singleOrDefault()
What are the advantages of WCF over normal web service