2079

CSC378 · TU past paper

NET Centric Computing 2079 question paper

The complete TU 2079 exam paper for NET Centric Computing (CSC378), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 110 marksCommon VulnerabilitiesAnswer

    Explain the uses of cookies. What types of vulnerabilities can occur in web application? Show the case of Cross-site Scripting attack.[10]

    --- A cookie is a small piece of data stored on the client's browser by the web server. Cookies are used to maintain state information between the client and server across multiple HTTP requests (since HTTP is stateless). Use Description...

  2. 210 marksCollectionsAnswer

    What is the purpose of web form? Write a program to demonstrate the concept of collection and generics.[10]

    A Web Form in ASP.NET is a page that allows users to interact with a web application by entering and submitting data through HTML form elements such as text boxes, dropdowns, checkboxes, and buttons. Purpose Description ------ Data Colle...

  3. 310 marksApp Servers and Hosting modelsAnswer

    Describe any two hosting models for core application. Design a client side validation application using jquery for taking input data from student in Library Management System, assume your own assumptions.[10]

    --- ASP.NET Core supports multiple hosting models that define how the application is hosted and served. Two important hosting models are described below: --- In the In-Process hosting model, the ASP.NET Core application runs inside the I...

  4. 45 marksSingle Page ApplicationAnswer

    What does single page application means? Discuss about server side strategies. [5]

    A Single Page Application (SPA) is a web application that loads a single HTML page and dynamically updates the content as the user interacts with the application, without refreshing or reloading the entire page. Key characteristics: - De...

  5. 55 marksDependency Injection and IOC containersAnswer

    What does dependency injection and IOC container means? Explain. [5]

    Dependency Injection is a design pattern used to achieve loose coupling between classes and their dependencies. Instead of a class creating its own dependencies (objects it needs), those dependencies are provided (injected) from outside ...

  6. 65 marksUnderstanding Tag HelpersAnswer

    What is tag helper? Discuss about razor syntax with an example. [5]

    Definition: Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files. They are similar to HTML Helpers but follow a more natural HTML-like syntax. Key Points (from notes): - Tag Helpers ar...

  7. 75 marksMVC PatternAnswer

    Define HTTP. Explain the MVC pattern. [5]

    HTTP and MVC Pattern


    Part 1: HTTP (HyperText Transfer Protocol)

    HTTP stands for HyperText Transfer Protocol. It is the foundation protocol of data communication on the World Wide Web. HTTP defines how messages are formatted and transmitted between a client (such as a web browser) and a server, and what actions web servers and browsers should take in response to various commands.

    Key characteristics of HTTP:

    • It is a request-response protocol: the client sends an HTTP request and the server returns an HTTP response.
    • It is stateless: each request is independent and the server does not retain session information between requests.
    • It operates over TCP/IP and commonly uses port 80 (HTTP) or port 443 (HTTPS).
    • Common HTTP methods include: GET, POST, PUT, DELETE, PATCH.

    ASP.NET Web API is "a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices", confirming HTTP as the core communication protocol for web-based services.


    Part 2: MVC Pattern

    MVC stands for Model, View, and Controller. It is an architectural/design pattern that separates an application into three main components, making the application easier to develop, test, and maintain.


    Components of MVC

    1. Model

    • Represents the shape of the data.
    • A class in C# is used to describe a model.
    • Model objects store data retrieved from the database.
    • In short: Model represents the data.
    public class Student
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
    

    2. View

    • A View in MVC is the user interface (UI).
    • It displays model data to the user and also enables them to modify it.
    • In ASP.NET MVC, View is written using HTML, CSS, and special Razor syntax that makes it easy to communicate with the Model and Controller.

    3. Controller

    • The Controller handles the user request.
    • Typically, the user interacts with the View, which raises an HTTP request.
    • The Controller acts as the request handler -- it processes the request, manipulates the Model, and returns the appropriate response/View.

    MVC Flow Diagram

    User
      |
      v
    [View] ---Send Request---> [Controller] ---Manipulate---> [Model]
      ^                              |                            |
      |                              |                            |
      +--------Renders/Display<------+----------------------------+
    

    Step-by-step flow:

    1. The user sends a request through the View (browser).
    2. The Controller receives and processes the HTTP request.
    3. The Controller interacts with the Model to retrieve or update data.
    4. The updated Model data is passed back to the View.
    5. The View renders and displays the result to the user.

    Advantages of MVC Pattern

    FeatureBenefit
    Separation of ConcernsEach component has a distinct responsibility
    TestabilityComponents can be tested independently
    MaintainabilityEasy to modify one component without affecting others
    ReusabilityModels and Views can be reused

    As stated in the notes: "ASP.NET MVC gives us a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives us full control over markup for enjoyable, agile development."

  8. 85 marksAuthorizationAnswer

    How do you assign roles, claims and policies? Explain with an example. [5]

    Authorization in ASP.NET Core is handled through three main mechanisms: Roles, Claims, and Policies. --- A role is a label assigned to a user that defines what group they belong to (e.g., Admin, User, Manager). Role-based authorization c...

  9. 95 marksCommon VulnerabilitiesAnswer

    What types of problems lead to SQL injection attack? Discuss any two types of ASP.Net host models. [5]

    --- SQL Injection (SQLi) is a common attack vector that uses malicious SQL code for backend database manipulation to access information that was not intended to be displayed. This information may include sensitive data, user lists, or pr...

  10. 105 marksNumericalADO.NET basicsAnswer

    Write an ADO. Net application to read the data from the existing table MOVIE(id, name, genre), where genre is 'comedy'. [5]

    • Table: MOVIE(id, name, genre) - Filter condition: genre = 'comedy' - Task: Read (SELECT) matching rows using ADO.NET This is a programming/theory question, so there are no numeric inputs to extract. All required information is present....
  11. 115 marks.NET and ASP.NET frameworksAnswer

    Differentiate between .NET and ASP.NET frameworks. How do you test the .NET core applications? [5]

    --- Feature .NET Framework ASP.NET --------- Definition A general-purpose development platform maintained by Microsoft that provides runtime, libraries, and tools for building all types of applications A web development framework built o...

  12. 1215 marksLINQAnswer

    Write short notes on: (any two) 1. Lambda Expression 2. Containerization using Docker 3. Delegates and Events [5+5+5]

    --- A lambda expression is a convenient way of defining an anonymous (unnamed) function that can be passed around as a variable or as a parameter to a method call. Lambda expressions are closely associated with LINQ (Language Integrated ...