Thursday, May 30, 2019

C Sharp


Which of the following properties related to the network errors is generated by Webexception?
Answer
  • Get
  • Send
  • Response
  • Status
How can you code to display “This is XML” in XML?
Answer
  • <pages xmlns= “” “”>
    <TextBlock>
    This is XML
    </TextBlock>
    </Pages>
  • <page xmlns= “” “”>
    <Text>
    This is XML
    </Text>
    </Page>
  • <page xmlns= “” “”>
    <TextBlock>
    This is XML
    </TextBlock>
    </Page>
     
Which of the following is neccessary condition for implementing delegates?
Answer
  • class declaration
  • inheritance
  • run time polymorphism
  • exception
C# has support for strongly-typed function pointers via the keyword?
Answer
  • delegate
  • variable
  • class
  • methods
The expression of a lock statemenet must denote a value of a type known to be a?
Answer
  • reference type
  • value-type
  • None of the above
Which statement is correct about the C#. NET code snippet given below?
Stack st = new Stack();
st. Push(“Csharp”);
st.Push(7.3);
st.Push(8);
st.Push(‘b’);
st. push(true);
Answer
  • Unsimilar elements like “Csharp”, 7.3,8 cannot be stored in the same stack collection.
  • Boolean values can never be stored in Stack collection
  • Perfectly worable code
  • All of the mentioned
Which statemenet about a string is correct?
Answer
  • A String is created on the stack
  • Whether a String is created on the stack or the heap depends on the length of the string
  • A String is create on the heap
  • A String can be created by using the statemenet String s1 = new string
What is the output when following code is executed?
static void Main(stirng[] args){
int[] array = new int[] {4, 8, 12, 16, 20};
for(int value = 0; value < array.length; value += 2){
array[value] = array[value] * array[value];
console.Write(array[value] + ” “);
Answer
  • 16 156 372
  • 32 172 420
  • 16 144 400
  • 46 256 432
Which statemenet is correct about an Exception?
Answer
  • It occurs during compilation
  • It occurs during linking
  • It occurs at run time
  • It occurs during Just-In-Time compilation
  • It occurs during loading of the program
Chosse the correct statemenets about the LINQ? (Check all that apply)
Note: There may be more than one right answer
Answer
  • The main concept behind the linq query
  • Linq makes use of for each loop to execute the query
  • It is not required that linq should make use of IEnumerable Interface
  • None of the mentioned
Chosse the method defined by MemberInfo:
Answer
  • GetCustomAttributes()
  • IsDefined()
  • GetCustomerAttributesData()
  • All of the above
Which of the following C# code snippets correctly copies the contents of one string into another?
Answer
  • String s1 = “Upwork”;
    String s2;
    s2 = s1;
  • String s1 = “Upwork” ;
    String s2;
    s2 = String.Concat(s1, s2);
  • String s1 = “Upwork”;
    String s2;
    s2 = String.Copy(s1);
  • String s1 = “Upwork”;
    String s2;
    s2 = s1.Replace();
  • String s1 = “Upwork”;
    String s2;
    s2 = s2.StringCopy(s1);
Which of the following benifits do we get on running managed code under CLR
1. Type safety of the code running under CLR is assured
2. It is ensured that an application would not access the memory that is not authorized to access
3. It launches seprate process for every application runing under it.
4. The resources are Garbage collected
Answer
  • Only 1 and 2
  • Only 2, 3 and 4
  • Only 1, 2 and 4
  • 4 Only
  • All of the above
Assume 2 column are named Product and Category. How can they be stored based on first by category and then by product name
Answer
  • var sortedProds = _db.Products.Orderby(c => c.Category)
  • var sortedProds = _db.Products.Orderby(c => c.Category + ThenBy(n => n.Name))
  • var sortedProds = _db.Products.Orderby(c => c.Category . ThenBy(n => n.Name))
  • All of the mentioned
Which of the following statements about delegate are UNTRUE?
Note: There may be more than one answer
Answer
  • Delegates are not type-safe
  • Delegate is a user-defined type
  • Only one method can be bound with one delegate object
  • Delegates can be used to implement callback notificattion
  • Delegates permit execution of a method on a secondary thread in an ansynchronous manner
The ‘ref’ keyword can be used as: (Check all that apply)
Note: There may be more than one right answer.
Answer
  • Static fucntion/subroutine
  • Static data
  • Instance fucntion/subroutine
  • Instance data
Which among the following is the odered collection class? (check all that apply)
Answer
  • BitArray
  • Queue
  • HashTable
  • Stack
String built using the String class are immutable, whereas those built using the StringBuilder class are mutable?
Answer
  • True
  • False
  • will depend on the content
Among the given collection which one is I/O index based? (Choose all that apply)
Note: There may be more than on right answer.
Answer
  • ArrayList
  • BitArray
  • Stack
  • Queue
Which of the following is not a relational operator in C#?
Answer
  • << 
  • <=
  • >=
  • < 
Which of the following keywards is used to declare an anonymous type in C#?
Answer
  • var
  • new
  • dynamic
  • None of the above
Which of the following is NOT a .NET Exception class?
Answer
  • Exception
  • StackMemoryException
  • DividedByZeroException
  • OutOfMemoryException
  • InvalidOperationException
Which of the following code snippets are correct way to convert a single into a string C#? (Chose all that apply.)
Note: There may be more than one right answer.
Answer
  • Single f = 7.5f;
    String s;
    s = (String) (f);
  • Single f = 7.5f;
    String s;
    s = Convert.ToString(f);

    !
  • Single f = 7.5f;
    String s;
    s = f.ToString();
  • Single f = 7.5f;
    String s;
    s = Clnt(f);
  • Single f = 7.5f;
    String s;
    s = CString(f);
Choose the class from which the namespace ‘System.Type’ is derived:
Answer
  • System.Reflection
  • System.Reflection.MemberInfo!
  • Both a & b
  • None of the mentioned
Which of the following are true about the following C#.NET code?
String s1, s2;
s1 = “UpWork”;
s2 = “UpWork”;
Note: There may be more than one right answer.
Answer
  • Cretaing String objects cannot be created without using new
  • Only one object will get created
  • s1 and s2 both will refer to the same object
  • Two objects will get created, one pointed to by s1 and another pointed to by s2
  • s1 and s2 are references to the same object
Which of the following keywords is used to manually throw an exception?
  • try
  • finally
  • throw
  • catch
Which String method is used to compare two string?
Answer
  • Compare_To
  • Compare()
  • Copy()
  • CoCat()
In C#.NET, if we do not catch the exception thrown at runtime then which of the following will catch it?
Answer
  • Compiler
  • CLR
  • Linker
  • Loader
  • Operating system
Choose the incorrect statement among the following about the delegate?
Answer
  • Delegates are reference types
  • Delegates are object oriented
  • Delegates are type-safe
  • None of the above
Which of the following statemenet are correct about delegate?
Note: There may be more than one right answer
Answer
  • Delegates are reference types
  • Delegates are object oriented
  • Delegates are type-safe
  • Delegates serve the same purpose as function pointers in C and pointers to member function operators in C++!
  • Only one method can be called using a delegate
  • Delegate are secure
Which of the following are not ordered collection classes? (choose all that apply.)
Note: There may more than one right answer
Answer
  • Map
  • Stack
  • Queue
  • BitArray
  • HashTable
What does the following code block define? check all that apply.
class Gen {
T ob;
}
Note: There may be more than one right answer.
Answer
  • Generics class decleration
  • Decleration of variable
  • Generic constructor decleration
  • All of the mentioned
Which of the following is correct way to convert a string to an int in C#?
Note: There may be more than one right answer.
Answer
  • String s = “456”;
    int i;
    i = (int)s;
  • String s = “456”;
    int i;
    i = int.Parse(s);
  • String s = “456”;
    int i;
    i = int32.Parse(s);
  • String s = “456”;
    int i;
    i = Convert.ToInt32(s);
  • String s = “456”;
    int i;
    i = CInt(s);
What is true about a sealed class in C#?
Answer
  • A sealed class cannot be inherited by any other class and sealed classes are primaily used to prevent derivation
  • The source code of sealed class cannot be decompiled from the assembly
  • A sealed class does not have any public methods and its operation are sealed
  • None of the above
Which of the following statement are correct about an ArrayList collection that implement the IEnumerable interface?
Answer
  • The ArrayList class contains an inner class that implements the IEnumerator interface
  • The inner class of ArrayList can access ArrayList class’s members
  • The access members of ArrayList from the inner class, it is necessary to pass ArrayList class’s reference to it
  • All of the above
Choose the correct statement about system.Type namespace.
Answer
  • Core of the reflection subsystem as it encapsulates a type
  • Consists of many methods and properties that can be used to obtain information about a type at runtime
  • Both a & b
  • None of the above
Which feature allows you to obtain information about the use and capabilities of type runtime?
Answer
  • Runtime type ID
  • Reflection
  • Attributes
  • None of the mentioned
verbatim string literal is better used for?
Answer
  • Convenience and better readability of string text consist of backlash characters
  • Used to initialize multi line strings
  • To embed a quotation mark by using double quotation marks inside a verbatim string
  • All of the above
Which of the following components of the .Net framework provide an extensible set of classes that can be used by any .Net compliant programing language?
Answer
  • NET class libraries
  • Common Language Runtime
  • Common Language Infrastructure
  • Component Object Model
  • Common Type System
Conside the following C# code. What would be the value of d?
int? a = 10;
int? b = 11;
int? c = 12;
a = null;
int? d = a ?? b ?? c;
Answer
  • 10
  • 11
  • 12
  • None of the above


English


Q: Arthur spent hours admiring the Gothic------------ of all those French cathedrals
a.       Architecture
b.      Arcitecture
c.       Architecvture
d.      arckitecture
Q: Choose the correct spelling of the word from the options below
a.       Carribean
b.      Caribbean
c.       Carribbean
d.      Caribeen
Q: Identity the misspelled word in the list below:
a.       Rhythmical
b.      Reminiscence
c.       Rheumatism
d.      Resevoir
Q: Complete the following sentence by choosing the correct spelling of the missing word
The purpose of your report should be to -------- the most relevant facts not to obscure them
a.       Illumenate
b.      Illuminate
c.       Illuminate
d.      elluminate
Q: Choose the correct spelling of the word from the options below:
a.       Excesive
b.      Exccesive
c.       Excessive
d.      Exceesive

Q: Choose the correct spelling of the word from the options below:
a.       Pronounciation
b.      Pronuciation
c.       Pronuncitation
d.      Pronunciation
Q: Complete the following sentence by choosing the correct spelling of the missing word
Clara, the cat, simply chose to ignore the ----------- of our dog
a.       Existence
b.      Existance
c.       Existense
d.      Existanse
Q: Identify the misspelled word in the list below
a.       Cachet
b.      Connoisseur
c.       Charateristic
d.      Catastrophe
Q: Complete the following sentence by choosing the correct spelling of the missing word
The judge granted the reluctant witness complete -------- from prosecution for his part in the crime
a.       Amnesty
b.      Amnasty
c.       Anmesty
d.      Emnesty

Q: Choose the correct spelling of the word from the options below:
a.       Ligitimate
b.      Legitimate
c.       Legetimate
d.      Legitemate

Q: Complete the following sentence by choosing the correct spelling of the missing word
Sam -------- a successful political campaign
a.       Orchestraited
b.      Orchestrated
c.       Orchestreated
d.      Orcestrated
Q: Choose the correct spelling of the word from the options below:
a.       Synonymous
b.      Synonymus
c.       Synonimous
d.      Sinonymus

Q: Choose the correct spelling of the word from the options below:
a.       Neccesary
b.      Necessary
c.       Neccessary
d.      Necesary

Q: Complete the following sentence by choosing the correct spelling of the missing word
The professor made it clear that ------ would not be tolerated
a.       Plagiarism
b.      Plagiarizm
c.       Plagerism
d.      Plagirism
Q: Choose the correct spelling of the word from the options below:
a.       Efficency
b.      Efficentsy
c.       Efficiensy
d.      Efficiency

Q: Complete the following sentence by choosing the correct spelling of the missing word
Their relationship was plagued by --------- problems
a.       Perpetual
b.      Perpechual
c.       Purpetual
d.      Perptual
Q: Identify the misspelled word in the list below
a.       Hemorrhage
b.      Harass
c.       Hankerchief
d.      Hypocrisy
Q: Identify the misspelled word in the list below
a.       Fluorescent
b.      Fullfil
c.       Facsimile
d.      Fictitious
Q: Identify the misspelled word in the list below
a.       Mischeivous
b.      Misanthrope
c.       Mussel
d.      Malicious
Q: Complete the following sentence by choosing the correct spelling of the missing word
The protesters hurled ----------------- insults at us as we walked by
a.       Vicous
b.      Vicious
c.       Vicouis
d.      Vicius
Q: Choose the correct spelling of the word from the options below:
a.       Reminiscience
b.      Reminiscence
c.       Reminescence
d.      Reminisense
Q: Identify the misspelled word in the list below
a.       Yacht
b.      Youthful
c.       Yeilding
d.      Yesterday
Q: Complete the following sentence by choosing the correct spelling of the missing word
a.       Nocternal
b.      Nocturnal
c.       Noctarnal
d.      Nacturnal

Q: Complete the following sentence by choosing the correct spelling of the missing word
Emma has always been fascinated by the way the mind works, so she’s decided to get degree in ----
a.       Pshycology
b.      Psycology
c.       Psyhcology
d.      Psychology
Q: Complete the following sentence by choosing the correct spelling of the missing word
The waitress bought me a plate of squid even though I -------------- asked for clams
a.       Specificaly
b.      Specifically
c.       Specifycally
d.      Specificly
Q: Choose the correct spelling of the word from the options below:
a.       Vacuum
b.      Vaccuum
c.       Vacumm
d.      Vaccum
Q: Complete the following sentence by choosing the correct spelling of the missing word
The annual ----------- was ruined when a family of bears stole all hot dogs
a.       Barbecue
b.      Barbequeue
c.       Barbycue
d.      Barbcue
Q: Choose the correct spelling of the word from the options below:
a.       Vengeance
b.      Vengance
c.       Vengents
d.      Vengence
Q: Choose the correct spelling of the word from the options below:
a.       Exhillrate
b.      Exhilarate
c.       Exhillreat
d.      Exhilrate
Q: Complete the following sentence by choosing the correct spelling of the missing word
My father does not believe in ---- but my mother does.
a.       Reincanation
b.      Reincarenation
c.       Reincarnation
d.      Reincantation
Q: Identify the misspelled word in the list below:
a.       Enhancement
b.      Elicit
c.       Enegma
d.      Ecstasy
Q: Complete the following sentence by choosing the correct spelling of the missing word
Sally’s ---- who was unable to handle his nervousness, left her standing at the altar
a.       FiancĂ©
b.      Finance
c.       FeancĂ©
d.      Fience
Q: Identify the misspelled word in the list below:
a.       Dexterity
b.      Dyeing
c.       Dessecrate
Q: Choose the correct spelling of the word from the options below:
a.       Idiosyncracy
b.      Idiosincrasy
c.       Idiosyncrasy
d.      Ideosyncracy
Q: Complete the following sentence by choosing the correct spelling of the missing word
The clown’s performance was ---- to say the least
a.       Dissappointing
b.      Dissappointing
c.       Disapointing
d.      Disappointing
Q: Choose the correct spelling of the word from the options below:
a.       Bureaucrasy
b.      Buroucracy
c.       Bureaucracy
d.      Beuraucracy
Q: Identify the misspelled word in the list below:
a.       Stationery
b.      Statutory
c.       Sincerely
d.      Sanctuery
Q: Identify the misspelled word in the list below:
a.       Occasion
b.      Occurrence
c.       Orangutan
d.      Opponant
Q: Complete the following sentence by choosing the correct spelling of the missing word
On the ---- day of Christmas, Lucy was annoyed to find her yardfull of noisy drummers drumming
a.       Twelvth
b.      Twelfth
c.       Twelfeth
d.      Twelth
Q: Choose the correct spelling of the word from the options below:
a.       Priveledge
b.      Privilage
c.       Privilege
d.      Privelege
Q: Choose the correct spelling of the word from the options below:
a.       Goverment
b.      Governmant
c.       Government
d.      Govermant
Q: Complete the following sentence by choosing the correct spelling of the missing word
No one knew what devious experiments the scientist conducted in his-----
a.       Labretory
b.      Laboratary
c.       Laboratory
d.      Labratory
Q: Complete the following sentence by choosing the correct spelling of the missing word
The church members accused the cult of ----- practices.
a.       Sacreligious
b.      Sacrelegious
c.       Sacrilegious
d.      Sacrilgious
Q: Choose the correct spelling of the word from the options below:
a.       Gauge
b.      Gaje
c.       Guage
d.      Gaige
Q: Complete the following sentence by choosing the correct spelling of the missing word
Helen was surprised by the ----- stature of her blind date
a.       Diminutive
b.      Diminuative
c.       Deminutive
d.      Dimminutive
Q: Choose the correct spelling of the word from the options below:
a.       Definitly
b.      Definately
c.       Defenitely
d.      Definitely
Q: Identify the misspelled word in the list below:
a.       Indivisible
b.      Irresistable
c.       Indispensable
d.      Irresponsible

Q: Complete the following sentence by choosing the correct spelling of the missing word
Peter always makes such a ------- of himself
a.       Nuisance
b.      Nuisents
c.       Newsanse
d.      Nuisince
Q: Identify the misspelled word in the list below:
a.       Pageant
b.      Poignant
c.       Plummage
d.      Priggish
Q: Complete the following sentence by choosing the correct spelling of the missing word
Mrs Baker took her ----- class on a field trip to the zoo
a.       Kindergarden
b.      Kindegarten
c.       Kindergarten
d.      Kindergarden
Q: Choose the correct spelling of the word from the options below:
a.       Leiutenant
b.      Luietenant
c.       Lieutanent
d.      Lieutenant

Q: Choose the correct spelling of the word from the options below:
a.       Temperamental
b.      Tempermental
c.       Temperamentle
d.      Temparamental
Q: Complete the following sentence by choosing the correct spelling of the missing word
Be sure to leave your travel ----- with the secretary so he’ll know how to reach you while you are away.
a.       Itenreray
b.      Itinerary
c.       Iteneray
d.      Itiniry
Q: Choose the correct spelling of the word from the options below:
a.       Conscentius
b.      Consentious
c.       Conscientous
d.      Conscientious
Q: Choose the correct spelling of the word from the options below:
a.       Adress
b.      Addrress
c.       Addres
d.      Address
Q: Identify the misspelled word in the list below
a.       Wierd
b.      Wired
c.       Whined
d.      Willful
Q: Choose the correct spelling of the word from the options below:
a.       Unanimus
b.      Unanemous
c.       Unanimess
d.      Unanimous
Q: Choose the correct spelling of the word from the options below:
a.       Embarassment
b.      Embrassment
c.       Embarrasment
d.      Embarrassment
Q: Identify the misspelled word in the list below
a.       Councelor
b.      Condescend
c.       Camouflage
d.      Criticize
Q: Complete the following sentence by choosing the correct spelling of the missing word
After my grandfather was diagnosed with chronic ----- he moved to Arizona
a.       Neumonia
b.      Penumonia
c.       Pneumonia
d.      Pnuemonia
Q: Complete the following sentence by choosing the correct spelling of the missing word
---------- Animals feed almost exclusively on meat
a.       Carnivorus
b.      Carnivorous
c.       Carnivoroues
d.      Carnivoreus
Q:
Manoeuver
Q: Identify the misspelled word in the list below
a.       Accomodate
b.      Analyze
c.       Acknowledgement
d.      Asterisk
Q: Identify the misspelled word in the list below
a.       Managable
b.      Millennium
c.       Minuscule
d.      Miscellaneous
Q: Complete the following sentence by choosing the correct spelling of the missing word
Many would-be travelers were------- by the price of gas last summer
a.       Flabergasted
b.      Flabberghasted
c.       Flabbergasted
d.      Flabbergashted
Q: Complete the following sentence by choosing the correct spelling of the missing word
He wrote ----- on every topic from shoestrings to string theory
a.       Prollifically
b.      Prolificaly
c.       Prollificaly
d.      Prolifically
Q: Complete the following sentence by choosing the correct spelling of the missing word
He ---------- a summer house, an exercise bike and a hamster in the divorce settlement
a.       Accquired
b.      Ecquired
c.       Acquired
d.      Akquired
Q: Which of the following options means, “the owner or manager of a restaurant”?
a.       Restaureter
b.      Restaurater
c.       Restaurateur
d.      Restourateur
Q: Complete the following sentence by choosing the correct spelling of the missing word
Let me tie your mittens to your sleeves so you don’t ----- them.
a.       Loose
b.      Looze
c.       Lose
d.      Louse
Q: Complete the following sentence by choosing the correct spelling of the missing word
The savvy dancer acted as a -------- between the detective and the cabaret owner.
a.       Liasion
b.      Liaison
c.       Liasone
d.      Leason