C# Interview Questions & Answers. What is C#? Explain types of comment in C# with examples, All quizzes on Programming C# Sharp have answers available with pdf.
Here list of important 30 C# interview questions and answers for C# developers who plan to attend the C# and .NET interviews.
Return to Programming Language Quiz List
Question 1: The Execution of the program begins with ________.
(A) main()
(B) get()
(C) class()
(D) display()
Question 2: In c#, ‘using’ is a _________ .
(A) class
(B) directive
(C) function
(D) keyword
Question 3: C# does not support __________ statement.
(A) go
(B) goto
(C) break
(D) continue
Question 4: “new” is used for __________ the objects.
(A) modifying
(B) creating
(C) allocating memory for
(D) deallocate memory of
Question 5: C# supports ______________.
(A) for statement only
(B) for each statement only
(C) both for and for each statements
(D) neither for nor for each statement
Question 6: Which of the following is correct about variable naming conventions in C#?
(A) It should not be a C# keyword.
(B) It must not contain any embedded space or symbol such as? – + ! @ # % ^ & * ( ) [ ] { }
(C) Both of the above.
(D) None of the above.
Question 7: Which of the following converts a type to a byte value in C#?
(A) ToByte
(B) ToChar
(C) ToSingle
(D) ToDateTime
Question 8: Which of the following preprocessor directive allows to create a compound conditional directive, along with #if in C#?
(A) elif
(B) else
(C) define
(D) if
Question 9: The ____ language allows more than one method in a single class.
(A) J#
(B) C#
(C) C++
(D) C
Question 10: In C#, a subroutine is called a _________.
(A) Metadata
(B) Function
(C) Managed code
(D) Method
Question 11: The character pair ?: is a __________ available in C#.
(A) Decision operator
(B) Unary operator
(C) Ternary operator
(D) Functional operator
Question 12: C# all binary operators are ___________.
(A) Left-associative
(B) Top-associative
(C) Right-associative
(D) Center-associative
Question 13: A _____ is any valid C# variable ending with a colon.
(A) Bitwise
(B) goto
(C) Label
(D) Logical
Question 14: C# has _______ operator, useful for making two way decisions.
(A) Looping
(B) Conditional
(C) Functional
(D) Exponential
Question 15: Which property among the following represents the current position of the stream?
(A) long Position
(B) long Length
(C) int Length
(D) All of the mentioned
Question 16: Which keyword is used to refer baseclass constructor to subclass constructor in C#?
(A) static
(B) this
(C) extend
(D) base
Question 17: Which keyword is used for correct implementation of an interface in C#.NET?
(A) intf
(B) interface
(C) init
(D) iostream
Question 18: Select the correct statement about Attributes used in C#.NET?
(A) If a BugFixAttribute is to receive three parameters, then the BugFixAttribute class should implement a zero argument constructor
(B) The CLR can change the behavior of the code depending on attributes applied to it
(C) To create a custom attribute we need to create a custom attribute structure and derive it from System Attribute
(D) None of the above
Question 19: The [serializable()] attributes gets inspected at _________ time.
(A) run time
(B) compile time
(C) linking time
(D) design time
Question 20: Which of the given stream methods provide access to the output console by default in C#.NET?
(A) Console.Out
(B) Console.In
(C) Console.Error
(D) All of the above
Question 21: The number of input methods defined by the stream method Console.In in C#.NET is?
(A) 4
(B) 3
(C) 2
(D) 1
Question 22: The C# provides special methods known as _____ to provide access to data members.
(A) Methods method
(B) Loop method
(C) Accessor method
(D) Functions method
Question 23: Which method used to read byte streams from the file?
(A) Readkey()
(B) Read()
(C) ReadMore()
(D) ReadByte()
Question 24: Select the method used to write single byte to a file?
(A) Wrteline()
(B) Write()
(C) WriteByte()
(D) None
Question 25: Which of these is a method used to clear all the data present in output buffers?
(A) flush()
(B) close()
(C) clear()
(D) fflush()
Question 26: We can create empty structures in C#.NET.
(A) False
(B) True
(C) Maybe
(D) Can’t say
Question 27: Which of the following statements is correct about the using statement used in C#.NET?
(A) It is permitted to define a member at namespace level as a using alias.
(B) using statement can be placed anywhere in the C#.NET source code file.
(C) By using using statement it is possible to create an alias for the namespace but not for the namespace element.
(D) C#.NET source code file can contain any number of using statement.
Question 28: Which of the following can not belong to a C#.NET Namespace?
(A) class
(B) enum
(C) struct
(D) data
Question 29: Choose the symbol which begins a preprocessor directive in C#.NET?
(A) #
(B) **
(C) *
(D) &
Question 30: In which of the following collections is the I/O based on a key?
(A) SortedList
(B) BitArray
(C) Stack
(D) Queue