Friday, 9 January 2015

Interview question

  • Hot Favourite Interview Questions : Programming Test

    Part-1

    1. Check Prime number
    2. Find factorial of given number
    3. Fibonacci series
    4. Palindrome check for string (input is string)
    5. Palindrome check for number (input is 'int' number)
    6. Reversing a number (input is 'int' number)
    7. Patterns printing
    -> Output
    a
    ab
    abc
    abcd
    -> Output 
    1
    12
    123
    1234
    -> Output
    54321
    5432
    543
    54
    5
    ->Output
    1
    22
    333
    4444
    55555
    ->Output
    1
    12
    123
    1234
    123
    12
    1
    ->Output
        1
      2 2
    3 3 3
    ->Output (diamond)
            *
          *  *
        *  *   *
     *   *   *   *
       *   *   *  
         *   *
           *

    8. Anagrams program( Defn.  Two strings can be said as anagrams if they have same number of occurrences of each individual characters in any order of arrangement)

    ex. shyam have angrams yashm ysham etc...

    Part 2 : 


    1. Sum upto n numbers using for or do-while or while loop

    2. Matrix operations : Addition, Multiplication for 3x3 Matrix

    3. Implement sorting : ascending descending.

    4. IMplement Binary search

    5. In an array from a given range (say 1 - 100) numbers are stored in random order. Find the missing number. example : 
    give range : 1 - 10
    Enter numbers in array : 7 5 3 4 2 1 8 9 10
    ans : 6 is missing

    6. Reversing a singly inked-list

    7. Find the third last element from linked-list in a single pass

    8. Middle element of the linked list in a single pass

    9. Amstrong number

    10. Find all prime number upto a given number