Coding Interview Questions
- 2of 2 votes
AnswersRound 1 :
- sonesh January 03, 2013 in India
Q 2 : longest palindrome in a string ? (Need to tell in O(n) time complexity + O(1) space complexity)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm Coding Dynamic Programming String Manipulation - 0of 2 votes
AnswersA log file which has user details(user ID,timestamp) and pages visited in a particular day by that user.The next day -the same kind of log file gets generated.How do you find the probability of users who logged in consecutive days out of the second day - logged in users? The question is simple,but they look for the efficient data structure and time complexity.
- sriramMS December 20, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Application / UI Design Arrays Assembly Automata Behavioral Bit Manipulation Brain Teasers C C# C++ Cache Coding Data Mining Data Structures - 0of 0 votes
AnswersPrint in spiral form as shown below
- umang.1rn09cs116 November 23, 2012 in India for Development
For n=2
3 2
0 1
For n=3
4 3 2
5 0 1
6 7 8
For n=4
15 14 13 12
4 3 2 11
5 0 1 10
6 7 8 9| Report Duplicate | Flag | PURGE
IBM Intern Coding - 0of 0 votes
AnswersGiven an integer array, convert it into a linked list with each node containing one sequence.
- manish.89july November 15, 2012 in India
Please reply on manish.89july@gmail.com| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Coding - 0of 0 votes
AnswersGiven an integer array with sequence of numbers, come up with a way to compress the data without losing the information. Based on the compressed data, it should be possible to construct the original integer array.
- manish.89july November 15, 2012 in India
Please reply on manish.89july@gmail.com| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Coding - 0of 0 votes
AnswersGiven an integer array, find the longest sequence and print it.
- manish.89july November 15, 2012 in India
Please reply on manish.89july@gmail.com| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Coding - 0of 0 votes
AnswersFind the number of sequences in an integer array. A sequence is a list of numbers(more than one number) that comes in strict numerical order like [3, 4, 5, 6].
- manish.89july November 15, 2012 in India
Please reply on manish.89july@gmail.com| Report Duplicate | Flag | PURGE
Microsoft Applications Developer Coding - 0of 0 votes
AnswersYou are given a binary search tree T of finite (means can fit in memory) size n in which each node N contains
- mag November 09, 2012 in India
- integer data element
- pointer to left child
- pointer to right child
- pointer to in order successor (which is set null for each node)
Set all in order successor pointers of the given binary search tree.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Coding Data Structures - -1of 3 votes
AnswersGiven a number x = 0x25. Convert it into y = 0x25252525.
- Nitin Gupta November 03, 2012 in India| Report Duplicate | Flag | PURGE
Adobe Member Technical Staff Algorithm Bit Manipulation C Coding - 0of 0 votes
AnswersYou are given an input form such as the following
- panoptic.biopower November 01, 2012 in United States
(1, (2, 3), (4, (5, 6), 7))
Each element is either a number or a list (whose elements may also be numbers or other lists).
Output the numbers as they appear, stripped down into a single list.
E.G. (1, 2, 3, 4, 5, 6, 7)
(Complication - how does your code handle the case of ((((5)))) vs just ( 5 ) ? )| Report Duplicate | Flag | PURGE
Facebook Intern Coding - 0of 0 votes
AnswersYou are given a string that is in roman numeral format.
- panoptic.biopower November 01, 2012 in United States
Output the integer representation.
E.G. You're given XIV
Output 14.| Report Duplicate | Flag | PURGE
Facebook Intern Coding - 0of 0 votes
Answersimplement Java's pow function, then list test cases, examine performance, see if you can optimize performance.
- rollingstar.15 October 30, 2012 in United States for NA
public double pow(double a, int b)| Report Duplicate | Flag | PURGE
Linkedin Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven a positive integer, decode it into a string in following way :-
- @ce October 24, 2012 in India
1 - a, 2 - b,3 - c,...26 - z, 27 - aa, 28 - ab........and so on.| Report Duplicate | Flag | PURGE
Microsoft Intern Coding - 0of 0 votes
AnswersGiven today is Thursday and 23rd August, 2012. Write a function to input a date (future or past) and tell which day it is:-
- @ce October 24, 2012 in India
int day_of_week(int dd, int mm, int yyyy)
Mon -1, Tue - 2, Wed -3......Sun-7| Report Duplicate | Flag | PURGE
Microsoft Intern Coding - 0of 0 votes
AnswersGiven a matrix represented as int[n][n], rotate it 90 degrees clockwise in-place. (In-place means minimal extra memory to be used, ie, don't make a new array to copy into). Rotate clockwise means top-row becomes right-column, right column becomes bottom-row etc.
- vasan.srini October 23, 2012 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven a binary tree, where each node has some value.
- freeninza October 13, 2012 in United States
Print the path with maximum value.| Report Duplicate | Flag | PURGE
Amazon Coding - 0of 0 votes
AnswersHow to calculate a mathematical expression stored as a string ? for eg :- string = "4* ( 3 + 2 ) - 1"
- karthika18ece October 04, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersA well renowned hotel has three branches in Miami. Namely x,y and z.Each has two types of customers. Regular and Rewardee. Also each branch has its own ratings x is given a 3 star rating while y has 5 star rating and z has 4 star rating.
- priya October 03, 2012 in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer Coding - 0of 0 votes
AnswersDesign a Date class that represents a US date. Write add and subtract operation using the class. Optimize the operations.
- k October 03, 2012 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 1of 1 vote
AnswersGiven an array of integers [2,1,3, 5, 7, 6], re arrange elements such that either even numbers in even locations or odd numbers in odd locations. i.e [2,1,6,5,7,3] in O(n)
- bluesky October 02, 2012 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven an unsorted array, how to divide them into two equal arrays whose sum of difference is minimum.
- Psycho September 29, 2012 in United States
Can it be done in o(n)?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm Morgan Stanley Java Developer Coding - 0of 0 votes
Answershow would you print the lever order of a tree (not a binary tree i.e. each node has more than two children)?
- MobileEdge September 27, 2012 in United States| Report Duplicate | Flag | PURGE
Algorithm C++ Coding Data Structures - 0of 0 votes
AnswersImplement a console based palindrome game where the input follows a sting and optionally followed by player's name.
- kk September 26, 2012 in India
Rules
-----
1. If the player enters a valid palindrome then increase the score by half the palindrome's length.
2. The game also lists top 5 Hall-of-Fame players based on the score ranks.
3. The game should register the player if not already registered.
4. If the server resets - then the players score should be reset to zero.| Report Duplicate | Flag | PURGE
Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite an API to find valid IP address.
- anvijain September 23, 2012 in United States for Windows Azure
(Asked followup questions like which kind or IP format, return type, range specific, etc.)| Report Duplicate | Flag | PURGE
Microsoft Program Manager Coding - 0of 0 votes
AnswersThe aim is to find the optimal solution which packs the pieces in 4x4 unit square.
- jaipster September 14, 2012 in India for SDE
a jig saw puzzle is made up of exactly 4 pieces.
size of the completed puzzle is always 4 units x 4 units. This is given
There is no picture printed on the pieces; any solution would be valid, as long it is a 4 x 4 unit square.
The pieces can be only triangles, or quadrilaterals. Nothing else.| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm Brain Teasers Coding Dynamic Programming - 0of 0 votes
AnswersGiven a log file, extract all the lines starting with the word ERROR.
- sam August 28, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersA string s is said to be unique if no two characters of s are same.
- swati.2332 August 19, 2012 in India
A string s1 is producible from s2 by removing some of the characters from s2.
A string s1 is said to be more beautiful than s2 if length of s1 is more than s2 or if both have same length and s1 is lexicographically greater than s2( ex: ba is more beautiful than ab)
Input: is a string which can be of maximum 10^6 characters, you have to produce the most beautiful unique string out of the given string.| Report Duplicate | Flag | PURGE
Facebook Coding - 0of 0 votes
AnswersN*N matrix. contains only 0's and 1's.
- kb August 13, 2012 in India
every row is sorted in descending order.
find row containing maximum no of 1's. Efficient soln reqd.| Report Duplicate | Flag | PURGE
Adobe Amazon Algorithm Coding - 0of 0 votes
AnswersThis is a newbie interview question from Statistic industry.
- Xiaonb August 13, 2012 in CHINA
there are a vector v {c1, c2,c3...c(n-1)} and a variable x, try to construct a polynomial eg:
p(x)= c1 + c2*x + c3*x^2 + ... + c(n-1)*x^(n-1)| Report Duplicate | Flag | PURGE
Coding Java - 0of 0 votes
AnswersGiven a line, adjust this line to the page width.
- jiangok2006 August 10, 2012 in United States
For example, given "Dog is cute" (length of chars is 11) and the page width is 15, adjust the line to "Dog is cute". The extra spaces should be distributed as much even as possible. Assume there is no space before the first word or after the last word.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding
Open Chat in New Window