Thursday, February 25, 2010

Showing less than "<" symbol in blogger post

For my last post on an interview test , i came accross a situation to show a less than symbol near character 'b' like < b (without spaces).But blogger misinterpret me and the post was made bold.Then i tried giving the standard HTML symbol for less-than < , but of no use. So from a google search i found this solution. You can give & # 60 (without spaces.I gave spaces to show you ). That works ..

Microsoft Internship Test Questions

Today i attended the Microsoft's Internship test . Here i am posting the questions so it will be useful to you too..
It was a one hour long descriptive test with six questions. The first four carries 5 marks each and remaining two carries 10 marks each.

  1. You are given a character string . Write the algo to print the character with maximum occurence and print that number of occurence too.
    Eg: i am an hacker --> output should be 'a' 3 times
  2. Give the output of the following code:
    #include<iostream>
    using namespace std;
    
    int main()
    {
    int a=10,b=2;
    b=a+++a;
    cout<<b<<" "<<a"\n";
    return 0;
    }
    
  3. Give the pseudocode for finding the factorial of a given integer.Make sure that the number should be of atmost two digits.
  4. What is Early binding and Late binding.
  5. You are given with a tree. Write the algo to make sure that it is a binary tree.
  6. You are given with a software application to send an email. write the testcases to check the working of the software.
  7. (There was a picture here ..showing the working of email sender application.i cant waste time by drawing it.)

Tuesday, February 23, 2010

Amazon Interview questions

I recently had an interview for internship by Amazon . Here i'm posting the questions asked during that . There were about four questions , out of which one was coding .

1) Consider you have a list of 2n+1 elements. n elements in the list have one duplicate. Give the algo to find the remaining unique element(the element without duplicate) ? { Eg: array 5 2 4 4 2 1 5 : here 1 is the unique element }

Modify the algo , if we have many elements without duplicate ? { Eg: array 5 2 4 4 1 7 2 3 5 here 1 7 and 3 are unique ie without duplicates }

2) Consider a singly linked (non circular ) list . Give the algo to find the pointer to the k'th element from the last , in a single iteration through the list .

3) Consider you have an array . the elements are arranged as in increasing order till a peak element , and from this element onwards it decreases..Give the algo to find this peak element .{ Eg: array : 2 3 4 5 6 3 2 1 : here 6 is the peak element. }
Modify your algo to take care of multiple peak elements . { Eg: array 2 3 4 5 6 3 2 1 5 8 9 2 1 here we peak elements are 6 9

Coding :
Write a definiton for the function with prototype given below:
Reversal(pointer to head of list, an integer k )
This function takes a list and an integer k, and reverses the first k elements of list and return a pointer to the head of new reversed list .

Thursday, February 04, 2010

Open Office Recovery problem

Yesterday when i was creating my assignment document in open office, some how it crashed .so i gave a force quit.Then when i restarted open office , it shows a window saying " openOffice.org Document recovery ", and the problem was that , it neither recovering my document nor allowing me to open a new one .screen shot added here:



WTH. So i think this post will help those having the same problem .

To solve this problem , just goto your home folder. Press ctrl + H to show hidden files. Get into the folder as shown : ".openoffice.org" -> 3 -> user -> registry -> data -> org -> openoffice ->Office . Delete that "Recovery.xcu" ( DONE ). Now just restart your open office..It will work without any problem ..