Create a console application in C# that manages a list of internships and associated data. The application should be able to perform ultra-complex queries on the list using LINQ (Language Integrated Query). The queries should filter, sort, and group internships based on multiple nested and related criteria.
Requirements
Data Model
Create classes with the following properties:
Internship
Id (int)
Name (string): Job title
Company (Company): Company offering the internship
Details (InternshipDetails): Additional details about the internship
Reviews (List): Reviews for the internship
Company
Name (string)
Location (string)
Industry (string)
InternshipDetails
Salary (int): Monthly salary
StartDate (DateTime): Start date of the internship
Skills (List): List of required skills
Duration (int): Duration in weeks
IsRemote (bool): Whether the internship is remote or not
Review
Rating (double): Rating out of 5
Comment (string): Review comment
Service Layer
Create a service class that performs the following operations using LINQ:
Filter internships based on Company.Location, Company.Industry, Details.Salary, Details.StartDate, Details.Skills, Details.Duration, Details.IsRemote, and average Reviews.Rating.
Sort the filtered list first by average Reviews.Rating in descending order, then by Details.Salary in descending order, followed by Details.Duration in ascending order, and finally by Company.Name in ascending order.
Group the sorted list by Name and then by Company.Industry.
Console Interface
Create a console interface to interact with the user. The user should be able to input filter criteria and see the grouped and sorted list of internships that match the criteria.
Example Output
Enter the location: New York
Enter the industry: Tech
Enter the minimum salary: 60000
Enter the start date (yyyy-mm-dd): 2023-01-01
Enter required skills (comma-separated): C#,SQL
Enter maximum duration in weeks: 12
Is remote? (yes/no): yes
Enter minimum average rating: 4.0
Results:
Group: Software Developer, Industry: Tech
- Company A, New York, $70000, 2023-01-15, Skills: [C#, SQL], Duration: 8 weeks, Remote: Yes, Avg Rating: 4.5
- Company B, New York, $65000, 2023-01-20, Skills: [C#, JavaScript], Duration: 12 weeks, Remote: Yes, Avg Rating: 4.2
Constraints
Use C# as the programming language.
Use LINQ for querying the list of internships.
The application should be a console application.
Do not use any external libraries or databases; everything should be done in-memory.
Evaluation Criteria
Correctness of the LINQ queries
Code quality and organization
Proper use of dependency injection
User interface simplicity and effectiveness
Bonus
Implement additional features like updating or deleting internships.
System.Linq Task
Table of Contents
Objective
Create a console application in C# that manages a list of internships and associated data. The application should be able to perform ultra-complex queries on the list using LINQ (Language Integrated Query). The queries should filter, sort, and group internships based on multiple nested and related criteria.
Requirements
Data Model
Create classes with the following properties:
Internship
Id
(int)Name
(string): Job titleCompany
(Company): Company offering the internshipDetails
(InternshipDetails): Additional details about the internshipReviews
(ListCompany
Name
(string)Location
(string)Industry
(string)InternshipDetails
Salary
(int): Monthly salaryStartDate
(DateTime): Start date of the internshipSkills
(ListDuration
(int): Duration in weeksIsRemote
(bool): Whether the internship is remote or notReview
Rating
(double): Rating out of 5Comment
(string): Review commentService Layer
Create a service class that performs the following operations using LINQ:
Company.Location
,Company.Industry
,Details.Salary
,Details.StartDate
,Details.Skills
,Details.Duration
,Details.IsRemote
, and averageReviews.Rating
.Reviews.Rating
in descending order, then byDetails.Salary
in descending order, followed byDetails.Duration
in ascending order, and finally byCompany.Name
in ascending order.Name
and then byCompany.Industry
.Console Interface
Create a console interface to interact with the user. The user should be able to input filter criteria and see the grouped and sorted list of internships that match the criteria.
Example Output
Constraints
Evaluation Criteria
Bonus