ACTUAL Exam Questions and CORRECT
Answers
What a Model? - CORRECT ANSWER - A model is a package of data.
What is the .Net Framework? - CORRECT ANSWER - The .NET Framework is Microsoft's
programming model for building applications that have user experiences, seamless and secure
communication, and the ability to model a range of business processes.
In C#, everything is an instance of a class or structure. What is the difference between a structure
and a class? - CORRECT ANSWER - In C#, a structure is a value type (primitive type in JS).
var v1 = 5;
var v2 = v1; // v2 is a copy of v1. changing v2 does not change v1.
In C#, a class is a reference type
var obj1 = new Obj();
var obj2 = obj1 // obj2 references obj1. changing obj2 changes obj1 because they both point to
the same space in memory.
What are some common Structure types in C#? - CORRECT ANSWER - Numeric and logical
built-in types (value types): *decimals, integers, floating-point values, booleans.*
What is the major difference between the *While* loop and the *Do* loop? - CORRECT
ANSWER - The condition of the *While* loop is evaluated before it enters the code block.
The *Do* loop evaluates the condition after the loop has executed, which makes sure that the
code block is always executed at least once.
Passing Data from the Controller to the View - CORRECT ANSWER - Before we go to a
database and talk about models, though, let's first talk about passing information from the
controller to a view. Controller classes are invoked in response to an incoming URL request. A
,controller class is where you write the code that handles the incoming browser requests, retrieves
data from a database, and ultimately decides what type of response to send back to the browser.
View templates can then be used from a controller to generate and format an HTML response to
the browser.
Controllers are responsible for providing whatever data or objects are required in order for a
view template to render a response to the browser. A best practice: A view template should never
perform business logic or interact with a database directly. Instead, a view template should work
only with the data that's provided to it by the controller. Maintaining this "separation of
concerns" helps keep your code clean, testable and more maintainable.
What is an Interface? - CORRECT ANSWER - An interface is a contract and defines the
requisite behavior of generalization of types.
For example, vehicle behavior includes ignition on, ignition off, turn left, turn right, accelerate,
and decelerate. A car, truck, bus, and motorcycle are included in the vehicle category. As such,
they must encapsulate baseline behavior representative of all vehicles. The vehicle interface
defines that baseline. Specific vehicle types implement that baseline behavior differently than
others. A car accelerates differently from a motorcycle. A motorcycle turns differently from a
bus. An interface mandates a set of behaviors, but not the implementation. The derived type is
free to implement the interface in an appropriate manner.
Interfaces must be inherited. An interface has no implementation; it only has the signature or, in
other words, just the definition of the methods without the body.
Since C# doesn't support multiple inheritance, interfaces are used to implement multiple
inheritance.
You cannot create an instance of an interface.
As one of the similarities to Abstract class, it is a contract that is used to define hierarchies for all
subclasses or it defines specific set of methods and their arguments. The main difference between
them is that a class can implement more than one interface but can only inherit from one abstract
class.
,What is an Abstract Class? - CORRECT ANSWER - An Abstract Class is a special kind of
class that cannot be instantiated. So the question is why do we need a class that cannot be
instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only
allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces
certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all
the subclasses to carry on the same hierarchies or standards.
Comparison between Abstract class and Interface - CORRECT ANSWER -
http://www.codeproject.com/Articles/11155/Abstract-Class-versus-Interface
What are the benefits of bundling code into individual software objects? - CORRECT
ANSWER - Modularity: The source code for an object can be written and maintained
independently of the source code for other objects. Once created, an object can be easily passed
around inside the system.
Information-hiding (Encapsulation): By interacting only with an object's methods, the details of
its internal implementation remain hidden from the outside world.
Code re-use: If an object already exists (perhaps written by another software developer), you can
use that object in your program. This allows specialists to implement/test/debug complex, task-
specific objects, which you can then trust to run in your own code.
Pluggability and debugging ease: If a particular object turns out to be problematic, you can
simply remove it from your application and plug in a different object as its replacement. This is
analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace it, not
the entire machine.
What is Object-Oriented Programming (OOP)? - CORRECT ANSWER - It is a type of
programming in which programmers define not only the data type of a data structure, but also the
types of operations (functions) that can be applied to the data structure. In this way, the data
structure becomes an object that includes both data and functions. In addition, programmers can
create relationships between one object and another. For example, objects can inherit
characteristics from other objects.
, One of the principal advantages of object-oriented programming techniques over procedural
programming techniques is that they enable programmers to create modules that do not need to
be changed when a new type of object is added. A programmer can simply create a new object
that inherits many of its features from existing objects. This makes object-oriented programs
easier to modify.
What is ASP.NET? - CORRECT ANSWER - ASP.NET is a development framework for
building web pages and web sites with HTML, CSS, JavaScript and server scripting.
What is the MVC Design Pattern? - CORRECT ANSWER - The Model-View-Controller
(MVC) pattern separates the modeling of the domain, the presentation, and the actions based on
user input into three separate classes.
MVC separates web applications into 3 separate classes:
Models for data
Views for display
Controllers for input
Models:
Classes that represent the data of the application and that use validation logic to enforce business
rules for that data.
The model manages the behavior and data of the application domain, responds to requests for
information about its state (usually from the view), and responds to instructions to change state
(usually from the controller).
Views:
The view manages the display of information.
Template files that your application uses to dynamically generate HTML responses.