Recycling Bin
.NET
Language features
LINQ
Public
New
.NET
The .NET framework, developed by Microsoft, provides a large class library and language interoperability. This makes it an essential skill for a programmer working with a Microsoft stack.
Language features
Knowing the most important features of a programming language is necessary for the effective use of many parts of the framework as well as keeping the code readable.
LINQ
LINQ provides a compile functional interface for querying datasets. A good .NET developer should be able to take full advantage of this.
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
New
This is a part of latest question addition to our question library.
Consider the following code:
C#
public class RecyclingBin
{
protected List<string> recyclables = new List<string>();
public void Add(string recyclable)
{
if (recyclable.Split(' ').Length > 1)
{
recyclables.Add(recyclable);
}
}
public List<IGrouping<string, string>> SortRecyclables()
{
return recyclables.GroupBy(recyclable => recyclable.Split(' ').First()).ToList();
}
}
VB.NET
Public Class RecyclingBin
Protected recyclables As List(Of String) = New List(Of String)
Public Sub Add(recyclable As String)
If recyclable.Split(" ").Length > 1
recyclables.Add(recyclable)
End If
End Sub
Public Function SortRecyclables()
Return recyclables.GroupBy(Function(recyclable) recyclable.Split(" ").First()).ToList()
End Function
End Class
Select all statements that are true if a new RecyclingBin is instantiated and the Add method is called with the following recyclable parameters: "metal pipe", "plastic toy", "metal bar", "copper wire", and "plastic button".
(multiple correct answers possible)