Saturday, January 23, 2010

HCL Dot net Written Test

HCL Dot net Written Test Interview Questions
Hyderabad for 2-6 yrs of experince on 09-01-2010 

1.When and Where the Object.Finalize is used?
2.Difference between Constants, Read only, Static?
3.What is meant by Value type variable and Reference type Variable in Terms of  Garbage collector?
4.Can we assign the Null value to the Struct variable ? Justify your Answer
5.Write a Program to get Output
Given I/P :"Subhash is a nice guy"; 
 O/P :"guy nice a is subhash";
6.Two Table given like Emp and Dept,FK id dept Id then find the Most recently hired employee in each department?


 table a: EMP_table
emp_id
dept_id
emp_name
emp_hiredate
emp_reportingto

table b: dept_table
dept_id
dept_name

For Technical Interview Go Through This  Click Here

Please Send Ur  Interview Experiences To My Mail Id : nsubhash007@gmail.com 

7 comments :

  1. Please post answers for this...

    ReplyDelete
  2. The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it:

    -- in the variable declaration (through a variable initializer).

    -- in the static constructor (instance constructors if it's not static).

    ReplyDelete
  3. Can we assign the Null value to the Struct variable



    If you wanna do so-you can use Nullable.

    ReplyDelete
  4. 4.Can we assign the Null value to the Struct variable ? Justify your Answer

    Struct is always value type:
    If you wanna do so you can use Nullable

    ReplyDelete
  5. 5.Write a Program to get Output
    Given I/P :"Subhash is a nice guy";
    O/P :"guy nice a is subhash";



    using System;
    namespace ReverseWords
    {
    class Program
    {
    static void Main(string[] args)
    {
    string original =
    “But, in a larger sense, we can not dedicate--we can
    ➥not consecrate--we can not hallow--this ground.”;
    Console.WriteLine(“Original: “ + original);
    Console.WriteLine(“Reversed: “ + ReverseWords(original));
    Console.ReadKey();
    }
    static string ReverseWords(string original)
    {
    //first convert the string to a character array since
    //we’ll be needing to modify it extensively.
    char[] chars = original.ToCharArray();
    ReverseCharArray(chars, 0, chars.Length - 1);
    //now find consecutive characters and
    //reverse each group individually
    int wordStart = 0;
    while (wordStart < chars.Length)
    {
    //skip past non-letters
    while (wordStart < chars.Length-1 &&
    !char.IsLetter(chars[wordStart]))
    wordStart++;
    //find end of letters
    int wordEnd = wordStart;
    while (wordEnd < chars.Length-1 &&
    char.IsLetter(chars[wordEnd+1]))
    wordEnd++;
    //reverse this range
    if (wordEnd > wordStart)
    {
    ReverseCharArray(chars, wordStart, wordEnd);
    }
    wordStart = wordEnd + 1;
    }
    return new string(chars);
    }
    static void ReverseCharArray(char[] chars, int left, int right)
    {
    int l = left, r = right;
    while (l < r)
    {
    char temp = chars[l];
    chars[l] = chars[r];
    chars[r] = temp;
    l++;
    r--;
    }
    }
    }
    }


    Source-C# 4.0 How to

    ReplyDelete
  6. Write a Program to get Output
    Given I/P :"Subhash is a nice guy";
    O/P :"guy nice a is subhash";


    Here we go:

    public static string ReverseWords(string sentence)
    {
    string[] words = sentence.Split(' ');
    Array.Reverse(words);
    return string.Join(" ", words);
    }

    ReplyDelete
  7. how about this:

    string s = "apple boll cat dog elephant";
    string[] ss = s.Split(' '); s = ss[ss.Length-1].ToString();
    for (int i = 1; i <= ss.Length-2; i++)
    {
    s = s + " "+ ss[i].ToString();
    }
    s = s + " "+ss[0].ToString();
    Console.WriteLine(s);
    Console.ReadLine();

    ReplyDelete