Coding Interview Questions
0of 0 votesAt a geeks goodies store.. every thing is either one dollar or less. and they accept only 10 dollars or less than 10 as denominations.So make a function that takes in the cost and payment as input and that out puts the change.
The denominations are namely 1c,5c,10c,25c,$1,$5,$10
0of 0 votesTake string as an input from the user.After taking. consider A ,a ,e,E,i,I,o,O,u,U, -- if these letters appear in the string.. then replace them with A^ ,a^,e^,E^,i^,I^,o^,O^,u^,U^. leave the first three eligible letters from the starting of the string.---
example --- greateribblizing.
converts to greateri^bbli^zi^ng.
0of 0 votesTake the user gives a set of numbers as input.Stop taking the input when he enters 0. Display the maximum odd integer and minimum even integer.See that the user inputs correct values as input.
0of 0 votesbarring the first 3 vowels in a string , convert all vowels to a e i o u ( with a caveat , something like special vowels in french and other european languages) . at the same time not more than 4 vowels from the last shud be changed.
0of 0 votesYou have a stream of numbers of unknown length. When you hit a zero, the stream is terminated. Return the largest even number and the largest odd number.
0of 0 votesYou are supposed to write a code for a cashier such that , given the money paid by the customer and the cost of the product , if would display the number of 10 dollar notes, 5 dollar notes, 1 dollar notes...quarters ,dimes .. in decreasing order ( something like applying greedy approach).
0of 0 votesGiven N Points in a Plane find the sets of Collinear Points.Collinear points are 3 or more points on the same line.(2 points are trivially collinear).
0of 0 votesWrite a program to which takes an array of digits and prints the histogram of the distribution of digits in horizontal manner. (Vertical histogram and cap on the max value for bonus points)
0of 0 votesgiven an array of numbers where each number has a duplicate in the array except one number, write a program to return the lone number.
For eg: if the array is 1,8,5,8,1,3,5 then your program should return 3.
0of 0 votesgiven an array of numbers, write a program to return the k largest numbers.
For eg: if the array of numbers is 2,9,6,4,3,8,56,39,5 and k=3 then return 56,39,9.
0of 0 votesgiven a string, write a program to find if it is a palindrome or not.
0of 0 votesGiven a string.Replace the words whose lengt>=4 and is even,with a space between the two equal halves of the word.consider only alphabets for finding the eveness of the word
I/P "A person can't walk in this street"
O/P "A per son ca n't wa lk in th is stre et"
0of 0 votesAsked me to write a C program which would accept some input strings on command line and then print those strings which are aligned to 80 chars a line..
This was the ONLY sensible question in the entire interview I would say.. Amazon sucks ,,|,,
0of 0 votesYou have a string which stores a number with commas. For example, a string that has the number 345,000,000. How will you manipulate this string in-place [without using any extra memory] so that the output is the original string without any commas in O(n) ?
0of 0 votesGiven an array of integers (both positive and negative), find the continious sequence having the maximum sum.
0of 0 votesGiven an array of numbers, find if sum of any two elements is equal to K (constant).
0of 0 votesFind all files with US phone number format and print out
0of 0 votesPrint the longest sequence of numbers that appear in ascending order in an array(need not be contiguous). Suppose your array has values a={8,6,5,1,9,3,7,4,2,10}, the output would be 1,3,4,10.
0of 0 votesSuppose two lists merge at some node .. how do you find that particular node ..
I answered like this ..
link ==> http://bit.ly/9GvP1Z
0of 0 votesImplement strstr()
0of 0 votes#1. Implement (in C++ or C#) a function that removes the nth element of a single linked list.
C++:
class Node
{
char* value;
Node* next;
};
Node** RemoveNth (Node** list, int n)
{
}
C#:
class Node
{
string value;
Node next;
}
Node RemoveNth(Node list, int n)
{
}
#2. Using the following table provide at least 5 test cases to test the function implemented in the previous part.
Node n Expected Result
~~~~ ~~~ ~~~~~~~~~~~~~~~~~
0of 0 votesWrite a function that would: return the 5th element from the end in a singly linked list of integers, in one pass, and then provide a set of test cases against that function
0of 0 votesFind the intersection of 2 lists
0of 0 voteshow do u multiply a number by 7..tell an efficient method
0of 0 votesMultiply two numbers without using multiply(obviously),division,bitwise operators and no loops.
For example: 3*2=6 without *,/,bitwise operators and no for,while loops.
Hint: Answer using recursion..
0of 0 votesWrite a function to compare two xml files
bool CompareXMLFiles(string fileName, string fileName);
Scenario
1. Path to files are given
2. We have to compare the content of xml files.
3. Xml with different element position would be same i.e.
<Tests>
<Test>UI<Test>
<Test>Functional<Test>
</Tests>
is same as
<Tests>
<Test>Functional<Test>
<Test>UI<Test>
</Tests>
4. Different position of attributes can be there e.g.
<Test Id="4" No="50">Functional<Test>
is same as
<Test No="50" Id="4">Functional<Test>
5. One Xml file can contain comments and other can/cannot but this is same
0of 0 votescode to find transpose of a matrix using only one array
0of 0 votesgiven a stream of integers.. 112233344442222 write a finction that would return as 1222334424
0of 0 votesCan you write a program to create a deck of cards, with the two joker cards
0of 0 votesWrite code to find the nth factorial
