Tech M - Sample .NET QB For Trained Freshers
Tech M - Sample .NET QB For Trained Freshers
NET Track
MCQ:
Topic: OOPS
DESCRIPTION
Reusability
Option 2:
Better organization of code
Option 3:
Make application code more flexible to change
Option 4:
Data hiding
Option 5:
Minimize the amount of duplicate code in an application
Topic: C# 5 .0 Features
DESCRIPTION
Eva is working with c# 5.0. She wants to set information about the caller source code file and
the caller member's name. Which of the following functions she should use to achieve the
same?
CallerFile
CallerMemberName
Option 2:
CallerFilePath
CallerMemberName
Option 3:
CallerFile
CallerMember
Option 4:
None of the Above
Topic: DML
DESCRIPTION
For the data below, write a query to get all the users whose name starts with the
letter 'C'.
Option 1: SELECT * FROM users WHERE name LIKE 'C%'; (Correct Answer)
DESCRIPTION
Which of the following is the correct way to define a constructor that accepts a
parameter in an ASP.NET MVC controller?
DESCRIPTION
Which of the following is a recommended best practice for using pull requests in Azure
DevOps?
Option 1: Merge pull requests as soon as possible to avoid conflicts with other changes.
Option 2: Do not use pull requests for small changes, as they are unnecessary.
Option 3: Assign reviewers to the pull request and incorporate their feedback before merging
the changes into the main branch.(Correct Answer)
Option 4: Use pull requests only for changes that have already been extensively tested and
validated.
Coding:
DESCRIPTION
Employee Operation:
This problem is related to handling exceptions when the objects are not
initialized.
Specifications:
class definition:
class Employee:
visibility : default
member property : Id
return type : int
visibility : public
member property : Name
return type : string
visibility : public
member property : Department
return type : string
visibility : public
member property : CTC
return type : double
visibility : public
class Operation:
visibility : default
member variable : EmployeeList
return type : IList<Employee>
visibility : public
member definition : AddEmployee(Employee employee)
return type : void
visibility : public
member definition : GetHighestPaidEmployee()
return type : Employee
visibility : public
Task:
class Employee:
class Operation:
Sample output:
Note:
● You can make suitable function calls and use the RUN CODE button to
check your main() method output.
Debugging Coding:
DESCRIPTION
Problem Statement
You are given a C# program that generates and prints the Fibonacci sequence up
to a given number n. However, there is a bug in the code that needs to be
identified and fixed.
The Fibonacci function is responsible for calculating the Fibonacci numbers, but
a subtle mistake has been introduced. Your task is to debug the code and correct
the error in the Fibonacci function so that it produces the correct Fibonacci
sequence.
Instructions:
1. Ensure the program prints the correct Fibonacci sequence up to the input
n.
2. Test the program with different values of n to verify its correctness.
Ensure to maintain the Fibonacci function's recursive nature while fixing the bug.
Sample Input
5
Sample Output
01123
TASK:
● A code stub containing buggy code will be loaded by default.
● You have to debug the solution code so that all test cases pass.
● You can click on the Run Code button to check for compilation errors.
● You can click on the Verify button to check for run-time errors (against
sample test cases).
● You can click on the Submit button to check for run-time errors (against
actual test cases).
Full Satck
DESCRIPTION
Problem Statement
The Project class represents a project entity with the below properties:
"projectId": 1,
},
"projectId": 2,
]
You are provided with the implementation of the models required for all the APIs.
Your task is to implement a set of REST services that exposes the endpoints,
allows for listing all the projects, and also retrieves the details of a specific
project based on the Id.
Complete the given project so that it passes all the test cases when running the
provided unit tests. Files in which you need to write the code:
1.) ProjectApp.WebAPI/Controllers/ProjectController.cs
2.) ProjectApp.WebAPI/Services/ProjectServices.cs
"projects": [
"projectId": 1,
},
"projectId": 2,
"project": {
"projectId": 1,
}
}
Note:
Please use the following commands from the terminal in the IDE to access it,
Once the application is built, it will create the projectDB database and the Project
table. To access the tables, run the following command.
Time: 0.452s
+---------+
| name |
|---------|
| Project |
+---------+
(1 row affected)
projectDB;>
You can use the Sqlite shell to view the data and query the tables.