What will be the output of

var input = new string[] { "Apple", "Banana", "Mango", "Apple", "Orange", "Mango", "Strawberry", "Apple" };

input = (from a in input
group a by a into g
where g.Count() >= 2
select g.Key + " ( " + g.Count() + " )").ToArray();

 Posted by Niladri.Biswas on 6/9/2013 | Category: LINQ Interview questions | Views: 11491 | Points: 40
Select from following answers:
  1. Apple ( 3 ), Mango ( 2 )
  2. Apple ( 2 ), Mango ( 2 )
  3. Apple ( 3 ),Mango ( 2 ),Orange( 1 ), Strawberry( 1 )
  4. Orange( 1 ),Strawberry( 1 )
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response