Important Questions

BIT351 路 Exam intelligence

NET Centric Computing important questions

From 4 past TU papers: which questions keep coming back, how much they carry, and what is most likely to show up next. Every question links to a model answer.

Most likely in the next examStatistical

Ranked by how often a topic is asked, its marks weight, and whether it is due after skipping the 2081.1 paper. No guarantees; study the whole syllabus.

1asked 2xavg 5 marks 路 due (skipped 2081.1) 路 Object-Relational Mapping concepts

What us the purpose of object relational mapper? Describe. [5]

Answer

--- An Object Relational Mapper (ORM) is a programming technique and tool that acts as a bridge between an object-oriented programming language and a relational database. It allows developers to interact with a database using objects and classes instead of writing raw SQL queries. --- The main pu...

2asked 2xavg 8 marks 路 MVC pattern components

Describe the MVC pattern in ASP.NET. [5]

Answer

MVC (Model-View-Controller) is a software architectural design pattern that separates an application into three interconnected components, promoting organized code, separation of concerns, and easier maintainability. --- - Represents the data and business logic of the application - Responsible fo...

3asked 2xavg 5 marks 路 React form creation

How do you create form using React? Illustrate with an example. [5]

Answer

In React, forms are handled differently from regular HTML forms. React uses controlled components to manage form data, where form input values are controlled by the component's state. --- A controlled component is an input element whose value is driven by React state. Every state mutation has an ...

4asked 2xavg 5 marks 路 MSIL and CLR architecture

Explain about MSIL and CLR. [5]

Answer

MSIL and CLR

Note: The reference notes did not contain this topic. The following answer is based on standard .NET / C# curriculum content taught in BSc CSIT.


1. MSIL (Microsoft Intermediate Language)

MSIL (also called CIL - Common Intermediate Language) is a low-level, platform-independent instruction set into which all .NET-compatible languages (C#, VB.NET, F#, etc.) are compiled before being converted to native machine code.

Key Points:

  • When a programmer writes code in C# (or any .NET language) and compiles it, the compiler does not produce native machine code directly.
  • Instead, it produces MSIL code stored inside an assembly (.exe or .dll file).
  • MSIL is CPU-independent - it is not tied to any specific processor or operating system.
  • MSIL contains instructions for loading, storing, calling methods, arithmetic operations, etc., in a generalized form.
  • It also contains metadata - information about types, methods, and references used in the program.

Compilation Flow:

Source Code (.cs)
      |
   [C# Compiler]
      |
   MSIL Code + Metadata  (stored in Assembly)
      |
   [CLR / JIT Compiler]
      |
   Native Machine Code  (executed by CPU)

2. CLR (Common Language Runtime)

CLR is the execution engine (runtime environment) of the .NET Framework. It is responsible for loading, executing, and managing .NET programs.

Key Responsibilities of CLR:

FunctionDescription
JIT CompilationConverts MSIL into native machine code at runtime using the Just-In-Time (JIT) compiler
Memory ManagementAutomatically allocates and deallocates memory
Garbage Collection (GC)Automatically reclaims unused objects from the heap
Type SafetyEnsures that code accesses only the memory it is authorized to access
Exception HandlingProvides a structured mechanism to handle runtime errors
SecurityEnforces code access security and role-based security
Thread ManagementManages multithreading and synchronization
InteroperabilityAllows .NET code to interact with unmanaged (native) code

How CLR Works:

  1. The CLR loads the assembly (containing MSIL).
  2. The JIT compiler inside CLR converts MSIL to native machine code specific to the current CPU.
  3. The native code is then executed by the operating system.
  4. CLR continuously manages the running program (GC, exceptions, security, etc.).

Relationship Between MSIL and CLR

MSILCLR
Intermediate code produced by compilerRuntime that executes the intermediate code
Platform-independentPlatform-specific (different CLR for different OS)
Stored in assembly filesInstalled as part of .NET Framework
Input to CLRProcesses and runs MSIL

Summary

MSIL is the intermediate, platform-independent bytecode that .NET compilers produce. CLR is the runtime environment that takes this MSIL, compiles it to native code via JIT, and manages its execution including memory, security, and exception handling. Together, they form the foundation of the .NET execution model.

5asked 2xavg 5 marks 路 Cookies definition and uses

Define cookies. What are the uses of hidden fields? [5]

Answer

Cookies and Hidden Fields


Cookies (Definition)

A cookie is a small piece of text data that a web server sends to a client's browser, which the browser stores locally on the user's machine. When the browser makes subsequent requests to the same server, it automatically sends the stored cookie back, allowing the server to identify and remember the user across multiple requests.

Key characteristics of cookies:

  • Stored on the client side (user's browser/machine)
  • Have an expiry date/time (session cookies expire when browser closes; persistent cookies have a set expiry)
  • Associated with a specific domain and path
  • Set using the Set-Cookie HTTP response header
  • Sent back to the server via the Cookie HTTP request header

Example:

Set-Cookie: username=JohnDoe; expires=Fri, 31 Dec 2025 12:00:00 GMT; path=/

Common uses of cookies:

  • User authentication and session management
  • Storing user preferences
  • Tracking user behavior
  • Shopping cart persistence

Hidden Fields

A hidden field is an HTML form element (<input type="hidden">) that stores data within a web form but is not visible to the user on the browser screen. The data is submitted to the server when the form is submitted.

Syntax:

<input type="hidden" name="userID" value="1023">

Uses of Hidden Fields

UseDescription
State ManagementMaintain state information (e.g., user ID, session token) across multiple page requests without cookies
Passing Data Between PagesTransfer data from one page to another through form submission without displaying it to the user
Security Tokens (CSRF Protection)Store anti-CSRF tokens to validate that form submissions are legitimate
Tracking Form ProgressIn multi-step forms (wizards), carry forward data collected in previous steps
Storing Record IDsPass database record IDs (e.g., product ID, order ID) back to the server during form submission
Preserving Original ValuesStore original field values to detect changes made by the user before update

Key Difference

FeatureCookiesHidden Fields
StorageClient's browser/diskInside HTML form
VisibilityNot visible in pageNot visible on screen but visible in page source
PersistenceCan persist across sessionsOnly available during form submission
Sent to serverWith every HTTP requestOnly on form submission

Most repeated questions

Topics asked at least twice, most-asked first.

asked 2xavg 5 marks 路 2080, 0

What us the purpose of object relational mapper? Describe. [5]

Answer

--- An Object Relational Mapper (ORM) is a programming technique and tool that acts as a bridge between an object-oriented programming language and a relational database. It allows developers to interact with a database using objects and classes instead of writing raw SQL queries. --- The main pu...

asked 2xavg 8 marks 路 2081.1, 2081

Describe the MVC pattern in ASP.NET. [5]

Answer

MVC (Model-View-Controller) is a software architectural design pattern that separates an application into three interconnected components, promoting organized code, separation of concerns, and easier maintainability. --- - Represents the data and business logic of the application - Responsible fo...

asked 2xavg 5 marks 路 2081.1, 2081

How do you create form using React? Illustrate with an example. [5]

Answer

In React, forms are handled differently from regular HTML forms. React uses controlled components to manage form data, where form input values are controlled by the component's state. --- A controlled component is an input element whose value is driven by React state. Every state mutation has an ...

asked 2xavg 5 marks 路 2081.1, 2080

Explain about MSIL and CLR. [5]

Answer

MSIL and CLR

Note: The reference notes did not contain this topic. The following answer is based on standard .NET / C# curriculum content taught in BSc CSIT.


1. MSIL (Microsoft Intermediate Language)

MSIL (also called CIL - Common Intermediate Language) is a low-level, platform-independent instruction set into which all .NET-compatible languages (C#, VB.NET, F#, etc.) are compiled before being converted to native machine code.

Key Points:

  • When a programmer writes code in C# (or any .NET language) and compiles it, the compiler does not produce native machine code directly.
  • Instead, it produces MSIL code stored inside an assembly (.exe or .dll file).
  • MSIL is CPU-independent - it is not tied to any specific processor or operating system.
  • MSIL contains instructions for loading, storing, calling methods, arithmetic operations, etc., in a generalized form.
  • It also contains metadata - information about types, methods, and references used in the program.

Compilation Flow:

Source Code (.cs)
      |
   [C# Compiler]
      |
   MSIL Code + Metadata  (stored in Assembly)
      |
   [CLR / JIT Compiler]
      |
   Native Machine Code  (executed by CPU)

2. CLR (Common Language Runtime)

CLR is the execution engine (runtime environment) of the .NET Framework. It is responsible for loading, executing, and managing .NET programs.

Key Responsibilities of CLR:

FunctionDescription
JIT CompilationConverts MSIL into native machine code at runtime using the Just-In-Time (JIT) compiler
Memory ManagementAutomatically allocates and deallocates memory
Garbage Collection (GC)Automatically reclaims unused objects from the heap
Type SafetyEnsures that code accesses only the memory it is authorized to access
Exception HandlingProvides a structured mechanism to handle runtime errors
SecurityEnforces code access security and role-based security
Thread ManagementManages multithreading and synchronization
InteroperabilityAllows .NET code to interact with unmanaged (native) code

How CLR Works:

  1. The CLR loads the assembly (containing MSIL).
  2. The JIT compiler inside CLR converts MSIL to native machine code specific to the current CPU.
  3. The native code is then executed by the operating system.
  4. CLR continuously manages the running program (GC, exceptions, security, etc.).

Relationship Between MSIL and CLR

MSILCLR
Intermediate code produced by compilerRuntime that executes the intermediate code
Platform-independentPlatform-specific (different CLR for different OS)
Stored in assembly filesInstalled as part of .NET Framework
Input to CLRProcesses and runs MSIL

Summary

MSIL is the intermediate, platform-independent bytecode that .NET compilers produce. CLR is the runtime environment that takes this MSIL, compiles it to native code via JIT, and manages its execution including memory, security, and exception handling. Together, they form the foundation of the .NET execution model.

asked 2xavg 5 marks 路 2081.1, 0

Define cookies. What are the uses of hidden fields? [5]

Answer

Cookies and Hidden Fields


Cookies (Definition)

A cookie is a small piece of text data that a web server sends to a client's browser, which the browser stores locally on the user's machine. When the browser makes subsequent requests to the same server, it automatically sends the stored cookie back, allowing the server to identify and remember the user across multiple requests.

Key characteristics of cookies:

  • Stored on the client side (user's browser/machine)
  • Have an expiry date/time (session cookies expire when browser closes; persistent cookies have a set expiry)
  • Associated with a specific domain and path
  • Set using the Set-Cookie HTTP response header
  • Sent back to the server via the Cookie HTTP request header

Example:

Set-Cookie: username=JohnDoe; expires=Fri, 31 Dec 2025 12:00:00 GMT; path=/

Common uses of cookies:

  • User authentication and session management
  • Storing user preferences
  • Tracking user behavior
  • Shopping cart persistence

Hidden Fields

A hidden field is an HTML form element (<input type="hidden">) that stores data within a web form but is not visible to the user on the browser screen. The data is submitted to the server when the form is submitted.

Syntax:

<input type="hidden" name="userID" value="1023">

Uses of Hidden Fields

UseDescription
State ManagementMaintain state information (e.g., user ID, session token) across multiple page requests without cookies
Passing Data Between PagesTransfer data from one page to another through form submission without displaying it to the user
Security Tokens (CSRF Protection)Store anti-CSRF tokens to validate that form submissions are legitimate
Tracking Form ProgressIn multi-step forms (wizards), carry forward data collected in previous steps
Storing Record IDsPass database record IDs (e.g., product ID, order ID) back to the server during form submission
Preserving Original ValuesStore original field values to detect changes made by the user before update

Key Difference

FeatureCookiesHidden Fields
StorageClient's browser/diskInside HTML form
VisibilityNot visible in pageNot visible on screen but visible in page source
PersistenceCan persist across sessionsOnly available during form submission
Sent to serverWith every HTTP requestOnly on form submission

Keep studying

Study every one of these with model answers, flashcards, and MCQs.

Open BIT351 study modes