Go Back

C# - Sample Interview Question (Senior Level)

What is true regarding the following approaches?

Approach A:

list.ForEach( item =>
{
item.Foo();
} );

Approach B:

foreach(Item item inlist)
{
item.Foo();
}

  1. Approach A is clearer and easier to read
  2. Type checking with approach B is done at runtime, while approach A is doing type checking at compile time
  3. Approach B could be chained
  4. None of the above.
Tests in C# for Seniors

Test Name Difficulty Time (minutes) No. of Questions
C# Senior 60 30

More Specific Tests in C# for Seniors

Test Name Difficulty Time (Minutes) No. of Questions
C Sharp - Arrays and Collections Senior 20 10
C Sharp - Language Fundamentals Senior 20 10
C Sharp - Threading Senior 20 10
C Sharp - Files and Streams Senior 20 10
C Sharp - LINQ Query Expressions Senior 20 10