gauravk.18
BAN USER- 0of 0 votes
AnswersLets say A is a friend of B and B is a friend of C then A and C are two degree friends. So we have to implement a function that takes two friends and return true if they are 2 degree friends. How will you implement this function efficiently.
- gauravk.18| Report Duplicate | Flag | PURGE
Hi5 Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWhat is stack. How do you implement it. Now lets say we want to add a new function called min which return the min element on the stack along with push and pop. Like push and pop this min function should also be a constant time operation how will u do it.
- gauravk.18| Report Duplicate | Flag | PURGE
Hi5 Software Engineer / Developer Algorithm - 1of 0 votes
AnswersBackground:
- gauravk.18
For any perimeter of a rectangle, there may be multiple different dimensions that result in that specific
perimeter. When there are multiple dimensions for the same perimeter, there may also be multiple areas. In other words, any one perimeter can result in different areas depending on the possible combinations of dimensions that can make that perimeter.
Definition:
A dimension or instance of dimensions for a rectangle is a pair of length and width values. A dimension with length 5 and width 4 is considered the same as a dimension with length 4 and width 5. The area of a rectangle is the length multiplied by the width. The perimeter of a rectangle is equal to the sum of the lengths of all 4 sides or the sum of 2 multiplied by the width and 2 multiplied by the length.
Requirement:
A finite set of possible perimeters of a rectangle exist given a maximum perimeter, minimum length of any side, and the constraint that all sides are whole numbers; we will call this set U. Find the subset of perimeters in set U where all of the possible dimensions for a perimeter in the subset have areas common with the areas of one or more other perimeters in set U. Your program should take the minimum length of any side and the maximum perimeter, respectively, as command line arguments and output a comma separated list of the perimeters that meet the criteria explained above, sorted from lowest to highest. The program should be submitted in a single Java class with an implemented main function that provides the correct output given the two input arguments.
Example:
javac YourClass.java
java YourClass 1 64
10,14,18,20,22,26,30,34
Please make sure your program can be run with the exact syntax above. You can name the class anything you like, but the class name will be passed to a program that will compile it and then run a set of tests on the resulting program. It is important that your class will compile and run from within a local directory, not a package directory.| Report Duplicate | Flag | PURGE
Hi5 Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersImplement Run Length Encoding.
- gauravk.18| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswerGiven n cities with their populations, suggest an algorithm to pick up one of the cities randomly such that more the population of city is more chance it stands to be picked. Assume you can use an inbuilt random generator function from the language library.
- gauravk.18| Report Duplicate | Flag | PURGE
Hi5 Software Engineer / Developer Algorithm - 0of 0 votes
AnswersImplement Strtok function.
- gauravk.18| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding
Code for checking if two strings are anagrams...
#include<stdio.h>
#include<stdlib.h>
void main()
{
char str1[1000], str2[1000], len1 = 0, len2 =0, a[256];
int flag = true;
printf("Enter the first string\n");
gets(str1);
printf("Enter the second striing\n");
gets(str2);
for(int i =0;i<256;i++)
a[i] = 0;
while(str1[len1] != '\0')
{
a[str1[len1]] = a[str1[len1]] + 1;
len1++;
}
while(str2[len2] != '\0')
{
a[str2[len2]] = a[str2[len2]] - 1;
len2++;
}
if((len1 != len2) || str1 == 0 || str2 == 0)
{
printf("Not an Anagram\n");
exit(0);
}
for(int i =0;i<256;i++)
if(a[i] != 0)
{
printf("Not an Anagram\n");
flag = false;
break;
}
if(flag)
printf("The two strings form an Anagram\n");
}
1. Start with opening the application depending on if its a web based application or a desktop based application.
2. Start several instances to see the effect.
3. Aesthetic should be according to the design doc
4. Test all the functionality available on the UI one by one and then in various combinations.
4. See if all the controls on the UI are working fine.
5. Close it and restart it to make sure on closing all the resources are released.
6. Try to hang the UI by pressing some control repeateadly.
You should also check if the function pointer passed should not be NULL or is not a correct pointer.
- gauravk.18 February 17, 2008Just find out the slope of the two equations(y = mx+c then slope is m). if they are equal, then lines are parallel.
- gauravk.18 February 17, 2008#include<stdio.h>
void main()
{
int n, no = 0, x = 5, i =1;
printf("Enter the number\n");
scanf("%d", &n);
while(n/x != 0)
{
no = no + n/(5*i);
i = i+5;
x = x *5;
}
printf("The total no. of trailing zeros in the number is %d \n", no);
}
/*write a function to remove the spaces from a string inplace,*/
#include<stdio.h>
void main()
{
char s[50];
char *p;
int temp = 0;
int i=0;
printf("Please Enter a string ");
p = gets(s);
while(p[i]!='\0')
{
//printf("In Loop");
if(p[i]!=' ')
{
s[temp++] = p[i++];
continue;
}
else
{
//temp = i;
while(p[i] == ' ')
i++;
s[temp++] = p[i];
}
i++;
}
s[temp] = '\0';
printf("The final string is %s \n", s);
}
#include <stdio.h>
void reverse(char *);
void main()
{
char buf[50];
char * str;
str = buf;
printf("Please enter the string \n");
str = gets(buf);
reverse(str);
printf("The reversed string is %s \n", str);
}
void reverse(char * str)
{
int len = 0;
char temp;
while(str[len] != '\0')
len++;
for(int i=0; i<len/2; i++)
{
temp = str[len-i-1];
str[len-i-1] = str[i];
str[i] = temp;
}
}
1. Test its URL
- gauravk.18 February 17, 20082. Open Multiple instances of the same application
3. Perform a Load Test using tools like Load runner
4. Check for load balancing
5. Check compatibilty with different browsers like IE, Mozilla, Netscape etc.
6. Try opening a page from the application without logging in for e.g. try opening //yourapplication.com/report.asp directly. This should ideally bring you to the login page as you are not logged in.
7. Check if same user can open multiple sessions with his login ID.
8. Check for asthetics of each page. Images should have a text explaining what the image is all about. Check for alignments and all.
9. See if the minimize, maximize and close buttons are working fine.
10. Check what happens if the Back/forward button is pressed. The outcome should depend on the design doc.
11. Timeout feature for security.
12. Check for users reoles and priveleges. Normal User should not be able to perform/see features of an Admin user.
13. Check if the page takes too long to load.