MCQOPTIONS
Saved Bookmarks
This section includes 43 Mcqs, each offering curated multiple-choice questions to sharpen your Akamai knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
C#.NET structures are always value types. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 2. |
Which of the following will be the correct output for the C#.NET program given below? namespace IndiabixConsoleApplication { struct Sample { public int i; } class MyProgram { static void Main() { Sample x = new Sample(); x.i = 10; fun(x); Console.Write(x.i + " "); } static void fun(Sample y) { y.i = 20; Console.Write(y.i + " "); } } } |
| A. | 10 20 |
| B. | 10 10 |
| C. | 20 10 |
| D. | 20 20 |
| Answer» D. 20 20 | |
| 3. |
The space required for structure variables is allocated on stack. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 4. |
Which of the following statements are correct about Structures used in C#.NET? A Structure can be declared within a procedure. Structs can implement an interface but they cannot inherit from another struct. struct members cannot be declared as protected. A Structure can be empty. It is an error to initialize an instance field in a struct. |
| A. | 1, 2, 4 |
| B. | 2, 3, 5 |
| C. | 2, 4 |
| D. | 1, 3 |
| Answer» C. 2, 4 | |
| 5. |
Which of the following are true about classes and struct? A class is a reference type, whereas a struct is a value type. Objects are created using new, whereas structure variables can be created either using new or without using new. A structure variable will always be created slower than an object. A structure variable will die when it goes out of scope. An object will die when it goes out of scope. |
| A. | 1, 2, 4 |
| B. | 3, 5 |
| C. | 2, 4 |
| D. | 3, 4, 5 |
| Answer» B. 3, 5 | |
| 6. |
Which of the following statements is correct about the C#.NET code snippet given below? struct Book { private String name; private int noofpages; private Single price; } Book b = new Book(); |
| A. | The structure variable b will be created on the heap. |
| B. | We can add a zero-argument constructor to the above structure. |
| C. | When the program terminates, variable b will get garbage collected. |
| D. | The structure variable b will be created on the stack. |
| Answer» E. | |
| 7. |
When would a structure variable get destroyed? |
| A. | When no reference refers to it, it will get garbage collected. |
| B. | Depends upon whether it is created using new or without using new. |
| C. | When it goes out of scope. |
| D. | Depends upon the Project Settings made in Visual Studio.NET. |
| Answer» D. Depends upon the Project Settings made in Visual Studio.NET. | |
| 8. |
Which of the following statements are correct? A struct can contain properties. A struct can contain constructors. A struct can contain protected data members. A struct cannot contain methods. A struct cannot contain constants. |
| A. | 1, 2 |
| B. | 3, 4 |
| C. | 1, 2, 4 |
| D. | 3, 5 |
| Answer» B. 3, 4 | |
| 9. |
Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below? struct Address { private int plotno; private String city; } Address a = new Address(); Address b; b = a; |
| A. | All elements of a will get copied into corresponding elements of b. |
| B. | Address stored in a will get copied into b. |
| C. | Once assignment is over a will get garbage collected. |
| D. | Once assignment is over a will go out of scope, hence will die. |
| Answer» B. Address stored in a will get copied into b. | |
| 10. |
How many bytes will the structure variable samp occupy in memory if it is defined as shown below? class Trial { int i; Decimal d; } struct Sample { private int x; private Single y; private Trial z; } Sample samp = new Sample(); |
| A. | 20 bytes |
| B. | 12 bytes |
| C. | 8 bytes |
| D. | 16 bytes |
| Answer» C. 8 bytes | |
| 11. |
Which of the following statements is correct about the C#.NET code snippet given below? class Trial { int i; Decimal d; } struct Sample { private int x; private Single y; private Trial z; } Sample ss = new Sample(); |
| A. | ss will be created on the heap. |
| B. | Trial object referred by z will be created on the stack. |
| C. | z will be created on the heap. |
| D. | ss will be created on the stack. |
| Answer» E. | |
| 12. |
Which of the following is the correct way to define a variable of the type struct Emp declared below? struct Emp { private String name; private int age; private Single sal; } Emp e(); e = new Emp(); Emp e = new Emp; Emp e; e = new Emp; Emp e = new Emp(); Emp e; |
| A. | 1, 3 |
| B. | 2, 5 |
| C. | 4, 5 |
| D. | 1, 2, 4 |
| Answer» D. 1, 2, 4 | |
| 13. |
Creating empty structures is allowed in C#.NET. |
| A. | True |
| B. | False |
| Answer» C. | |
| 14. |
The space required for structure variables is allocated on stack |
| A. | True |
| B. | False |
| Answer» B. False | |
| 15. |
Attributes can be applied to Method Class Assembly Namespace Enum |
| A. | 1 and 2 only |
| B. | 1, 2 and 3 |
| C. | 4 and 5 only |
| D. | All of the above |
| Answer» C. 4 and 5 only | |
| 16. |
Which of the following is the correct way of applying the custom attribute called Tested which receives two-arguments - name of the tester and the testgrade? Custom attribute cannot be applied to an assembly. [assembly: Tested("Sachin", testgrade.Good)] [Tested("Virat", testgrade.Excellent)] class customer { /* .... */ } Custom attribute cannot be applied to a method. Custom attribute cannot be applied to a class. |
| A. | 1 only |
| B. | 1, 5 |
| C. | 2, 3 |
| D. | 4, 5 |
| Answer» D. 4, 5 | |
| 17. |
Which of the following is the correct way to apply an attribute to an Assembly? |
| A. | [ AssemblyDescription("DCube Component Library") ] |
| B. | [ assembly : AssemblyDescription("DCube Component Library") ] |
| C. | [ Assemblylnfo : AssemblyDescription("DCube Component Library") ] |
| D. | < Assembly: AssemblyDescription("DCube Component Library") > |
| Answer» C. [ Assemblylnfo : AssemblyDescription("DCube Component Library") ] | |
| 18. |
Once applied which of the following CANNOT inspect the applied attribute? |
| A. | CLR |
| B. | Linker |
| C. | ASP.NET Runtime |
| D. | Visual Studio.NET |
| Answer» C. ASP.NET Runtime | |
| 19. |
Which of the following CANNOT be a target for a custom attribute? |
| A. | Enum |
| B. | Event |
| C. | Delegate |
| D. | Namespace |
| Answer» E. | |
| 20. |
Which of the following statements are correct about Attributes used in C#.NET? |
| A. | If there is a custom attribute BugFixAttribute then the compiler will look ONLY for the BugFix attribute in the code that uses this attribute. |
| B. | To create a custom attribute we need to create a custom attribute structure and derive it from System.Attribute. |
| C. | To create a custom attribute we need to create a class and implement IAttribute interface in it. |
| D. | The CLR can change the behaviour of the code depending upon the attributes applied to it. |
| Answer» E. | |
| 21. |
Which of the following statements are correct about inspecting an attribute in C#.NET? An attribute can be inspected at link-time. An attribute can be inspected at compile-time. An attribute can be inspected at run-time. An attribute can be inspected at design-time. |
| A. | 1, 2 |
| B. | 3, 4 |
| C. | 1, 3, 4 |
| D. | All of the above |
| Answer» B. 3, 4 | |
| 22. |
Which of the following are correct ways to pass a parameter to an attribute? By value By reference By address By position By name |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 4, 5 |
| D. | All of the above |
| Answer» D. All of the above | |
| 23. |
Which of the following are correct ways to specify the targets for a custom attribute? |
| A. | By applying AttributeUsage to the custom attributes class definition. |
| B. | By applying UsageAttribute to the custom attributes class definition. |
| C. | Once an attribute is declared it applies to all the targets. |
| D. | By applying AttributeUsageAttribute to the custom attributes class definition. |
| Answer» E. | |
| 24. |
The [Serializable()] attribute gets inspected at |
| A. | Compile-time |
| B. | Run-time |
| C. | Design-time |
| D. | Linking-time |
| Answer» C. Design-time | |
| 25. |
Which of the following are necessary for Run-time Polymorphism? The overridden base method must be virtual, abstract or override. Both the override method and the virtual method must have the same access level modifier. An override declaration can change the accessibility of the virtual method. An abstract inherited property cannot be overridden in a derived class. An abstract method is implicitly a virtual method. |
| A. | 1, 3 |
| B. | 1, 2, 5 |
| C. | 2, 3, 4 |
| D. | 4 only |
| Answer» C. 2, 3, 4 | |
| 26. |
Which of the following can be declared as a virtual in a class? Methods Properties Events Fields Static fields |
| A. | 1, 2, 3 |
| B. | 3, 5 |
| C. | 2, 4 |
| D. | 2, 3, 5 |
| Answer» B. 3, 5 | |
| 27. |
In order for an instance of a derived class to completely take over a class member from a base class, the base class has to declare that member as |
| A. | new |
| B. | base |
| C. | virtual |
| D. | overrides |
| Answer» D. overrides | |
| 28. |
Which of the following modifier is used when a virtual method is redefined by a derived class? |
| A. | overloads |
| B. | override |
| C. | overridable |
| D. | virtual |
| Answer» C. overridable | |
| 29. |
Which of the following operators cannot be overloaded? true false new ~ sizeof |
| A. | 1, 3 |
| B. | 2, 4 |
| C. | 3, 5 |
| D. | All of the above |
| Answer» D. All of the above | |
| 30. |
Which of the following statement is correct about the C#.NET code snippet given below? public class Sample { public int x; public virtual void fun() { } } public class DerivedSample : Sample { new public void fun() { } } |
| A. | DerivedSample class hides the fun() method of base class. |
| B. | The DerivedSample class version of fun() method gets called using Sample class reference which holds DerivedSample class object. |
| C. | The code replaces the DerivedSample class version of fun() method with its Sample class version. |
| D. | It is not possible to hide Sample class version of fun() method without use of new in DerivedSample class. |
| Answer» B. The DerivedSample class version of fun() method gets called using Sample class reference which holds DerivedSample class object. | |
| 31. |
Which of the following statements are correct? All operators in C#.NET can be overloaded. We can use the new modifier to modify a nested type if the nested type is hiding another type. In case of operator overloading all parameters must be of the different type than the class or struct that declares the operator. Method overloading is used to create several methods with the same name that performs similar tasks on similar data types. Operator overloading permits the use of symbols to represent computations for a type. |
| A. | 1, 3 |
| B. | 2, 4 |
| C. | 2, 5 |
| D. | 3, 4 |
| Answer» D. 3, 4 | |
| 32. |
Which of the following statements is correct? |
| A. | Static methods can be a virtual method. |
| B. | Abstract methods can be a virtual method |
| C. | It is necessary to override a virtual method. |
| D. | When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overriden. |
| Answer» E. | |
| 33. |
A derived class can stop virtual inheritance by declaring an override as |
| A. | inherits |
| B. | extends |
| C. | inheritable |
| D. | sealed |
| Answer» E. | |
| 34. |
Which of the following unary operators can be overloaded? true false + new is |
| A. | 1, 2, 3 |
| B. | 3, 4, 5 |
| C. | 3 only |
| D. | 5 only |
| Answer» B. 3, 4, 5 | |
| 35. |
In the cement the compound quickest to react with water, is |
| A. | Tricalcium aluminate |
| B. | Tetra-calcium alumino-ferrite |
| C. | Tricalcium silicate |
| D. | Dicalcium silicate. |
| Answer» B. Tetra-calcium alumino-ferrite | |
| 36. |
In the method of condensation polymerization, |
| A. | low-molecular substances are removed from the high molecular substance |
| B. | the reaction proceeds with an evolution of ammonia |
| C. | the reaction proceeds with an evolution of hydrogen chloride |
| D. | all the above. |
| Answer» E. | |
| 37. |
Bitumen felt |
| A. | is used as water proofing material |
| B. | is used as damp proofing material |
| C. | is made from bitumen and hessian fibres |
| D. | all the above. |
| Answer» E. | |
| 38. |
Elastomers can extend upto |
| A. | five times their original dimensions |
| B. | seven times their original dimensions |
| C. | ten times their original dimensions |
| D. | three times their original dimensions. |
| Answer» D. three times their original dimensions. | |
| 39. |
Ultimate strength to cement is provided by |
| A. | Tricalcium silicate |
| B. | Di-calcium silicate |
| C. | Tri-calcium aluminate |
| D. | Tetra calcium alumino ferrite. |
| Answer» C. Tri-calcium aluminate | |
| 40. |
Pick up the correct statement from the following: |
| A. | For thin structures subjected to wetting and drying, the water cement ratio should be 0.45 |
| B. | For mass concrete structures subjected to wetting and drying, the water ratio should be 0.55 |
| C. | For thin structures which remain continuously under water, the water-cement ratio by weight should be 0.55 |
| D. | All the above. |
| Answer» E. | |
| 41. |
Pick up the polymineralic rock from the following: |
| A. | Quartz sand |
| B. | Pure gypsum |
| C. | Magnesite |
| D. | Granite |
| Answer» E. | |
| 42. |
Wrought iron contains carbon upto |
| A. | 0.25% |
| B. | 1.0% |
| C. | 1.5% |
| D. | 2%. |
| Answer» B. 1.0% | |
| 43. |
In a mortar, the binding material is |
| A. | cement |
| B. | sand |
| C. | surkhi |
| D. | cinder. |
| Answer» B. sand | |