.NET & Angular - Test
Passage
•
Instructional Technology
•
Professional Development
•
Easy
Abhijeet Rathod
Used 2+ times
FREE Resource
9 questions
Show all answers
1.
OPEN ENDED QUESTION
10 mins • 1 pt
Implement logging and exception handling mechanism in .Net core, use well known concepts and design patterns.
Evaluate responses using AI:
OFF
2.
OPEN ENDED QUESTION
5 mins • 1 pt
Using Entity Framework Core in a .NET Core application, Consider the following scenario where you have two entities, Product and Category, with a many-to-many relationship. Each product can belong to multiple categories, and each category can have multiple products. The code below represents a simplified version:
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Category> Categories { get; set; }
}
public class Category
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Product> Products { get; set; }
}
public class AppDbContext : DbContext
{
public DbSet<Product> Products { get; set; }
public DbSet<Category> Categories { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Product>()
.HasMany(p => p.Categories)
.WithMany(c => c.Products)
.Map(pc =>
{
pc.MapLeftKey("ProductId");
pc.MapRightKey("CategoryId");
pc.ToTable("ProductCategory");
});
}
}
a. Identify potential issues in the provided code and explain them.
b. Propose improvements to address the identified issues and optimize the code.
Evaluate responses using AI:
OFF
3.
OPEN ENDED QUESTION
10 mins • 1 pt
Section 2: Angular
Create a custom attribute directive in Angular that changes the background color of an element when hovered over. Also, implement a button in a component that, when clicked, triggers a specific action (like hiding/showing an element) using event binding.
Evaluate responses using AI:
OFF
4.
OPEN ENDED QUESTION
5 mins • 1 pt
Given the code below, QA reports slowness in showing the user feed after deployment.
a. Explain the possible reasons for the slowness.
b. Introduce code improvements to improve performance.
public class FeedsBL : BaseBL
{
public DataContext DataContext { get; set; }
public FeedsBL(DataContext dataContext)
{
DataContext = dataContext;
}
public IEnumerable<FeedDto> GetUserFeed(int userId)
{
List<FeedDto> returnFeeds = new List<FeedDto>();
var posts = GetPosts();
var comments = GetComments();
var likes = GetLikes();
var userPosts = posts.Where(p => p.UserId == userId);
foreach (var post in userPosts)
{
var postComments = comments.Where(c => c.Postid == post.Id);
var postLikes = likes.Where(c => c.Postid == post.Id);
returnFeeds.Add(new FeedDto
{
UserId = userId,
Post = post,
Comments = postComments,
Likes = postLikes
});
return returnFeeds;
}
}
public IEnumerable<Post> GetPosts()
{
return DataContext.Posts().ToList();
}
public IEnumerable<Comment> GetComments()
{
return DataContext.Comments().ToList();
}
public IEnumerable<Like> GetLikes()
{
return DataContext.Likes().ToList();
}
}
Evaluate responses using AI:
OFF
5.
OPEN ENDED QUESTION
15 mins • 1 pt
Section 2: Angular
Develop an Angular service that performs HTTP requests to a public API (like a weather API or a public JSON placeholder API). Then, create a component that uses this service to fetch data and display it in a formatted way.
Evaluate responses using AI:
OFF
6.
OPEN ENDED QUESTION
15 mins • 1 pt
Section 2: Angular
Implement a simple Observable that emits values over time (like a counter). Then, create a component that subscribes to this Observable and displays its values in real-time. Additionally, include a way to unsubscribe from the Observable to demonstrate good practice in managing subscriptions.
Evaluate responses using AI:
OFF
7.
OPEN ENDED QUESTION
10 mins • 1 pt
Section 3: General Development
Write a function in (in any code) that finds the factorial of a given integer using recursion.
Evaluate responses using AI:
OFF
8.
OPEN ENDED QUESTION
15 mins • 1 pt
Evaluate responses using AI:
OFF
9.
OPEN ENDED QUESTION
5 mins • 1 pt
Write a SQL query to retrieve all unique customers who have made purchases in the last month from a "Customers" table and an "Orders" table.
Assume you have a "Customers" table with a unique "CustomerID" and an "Orders" table with a "CustomerID" and a "OrderDate" column
Evaluate responses using AI:
OFF
Similar Resources on Wayground
10 questions
Database ER Model
Quiz
•
Professional Development
12 questions
WILL VS GOING TO
Quiz
•
Professional Development
10 questions
Semana 1 JS
Quiz
•
Professional Development
15 questions
Cloud migration prerequisite
Quiz
•
University - Professi...
10 questions
TEST FORMACIÓN INICIAL N1
Quiz
•
Professional Development
14 questions
CNC quiz 5
Quiz
•
Professional Development
15 questions
Flutter Q_0
Quiz
•
Professional Development
10 questions
Fundamental Digital Marketing Sesi 6
Quiz
•
Professional Development
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Instructional Technology
10 questions
Halloween
Quiz
•
Professional Development
16 questions
Spooky Season Quiz
Quiz
•
Professional Development
5 questions
11.4.25 Student Engagement & Discourse
Lesson
•
Professional Development
50 questions
ASL Colors and Clothes
Quiz
•
KG - Professional Dev...
15 questions
Ohms Law
Quiz
•
Professional Development
10 questions
Halloween Trivia
Quiz
•
Professional Development
10 questions
Halloween Trivia
Quiz
•
Professional Development
