Coding Interview Questions
- 0of 0 votes
AnswersAn infinitely long stream of bits coming one bit at a time. You have to tell (at any point of time), whether the decimal number is divisible by 3 or not .
- ashish March 25, 2012 in India for bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a function to sort the linked list given the head as parameter. Do not use extra memory. You have to sort it in place. Time complexity is secondary. (He told me that he wants to see how fast I can code with any of of the solutions)
- lippie March 21, 2012 in United States for Switching Softwares| Report Duplicate | Flag | PURGE
Cisco Systems Software Engineer / Developer Algorithm C Coding Linked Lists - 0of 0 votes
AnswersGiven two lists of strings return a list of strings that is an intersection of both of the lists.
- An March 19, 2012 in United States
Analyze running time and space complexity.
Give Test Case scenarios.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersThere is a monkey which can walk around on a planar grid. The monkey can move one space at a time left, right, up or down. That is, from (x, y) the monkey can go to (x+1, y), (x-1, y), (x, y+1), and (x, y-1). Points where the sum of the digits of the absolute value of the x coordinate plus the sum of the digits of the absolute value of the y coordinate are lesser than or equal to 19 are accessible to the monkey. For example, the point (59, 79) is inaccessible because 5 + 9 + 7 + 9 = 30, which is greater than 19. Another example: the point (-5, -7) is accessible because abs(-5) + abs(-7) = 5 + 7 = 12, which is less than 19. How many points can the monkey access if it starts at (0, 0), including (0, 0) itself? There is no input for this program.
- techieZone March 18, 2012 in United States
Print out the how many points can the monkey access. (The number should be printed as an integer whole number eg. if the answer is 10 (its not !!), print out 10, not 10.0 or 10.00 etc)| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm C++ Coding Data Structures - 0of 0 votes
AnswersCount number of higher bits(1) in an integer alongwith its complexity? improvise it
- axoaxo March 16, 2012 in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Coding - 0of 0 votes
Answersstatic synchronized method 1()
- axoaxo March 16, 2012 in United States
{
counter++;
}
synchronized method 2()
{
counter++;
}
use only one counter variable to count the number of method calls to method 1 and method 2?| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Coding - 1of 1 vote
AnswersPush all the zero's of a given array to the end of the array. In place only. Ex 1,2,0,4,0,0,8 becomes 1,2,4,8,0,0,0
- CheckThisResume.com March 09, 2012 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm Arrays C Coding - 0of 0 votes
AnswersSpiral traversal of an array.
- y2km11 March 08, 2012 in India for Bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 1of 1 vote
AnswersWrite a recursive function to convert Binary Code of a number into its equivalent Gray's code and the other way round.
- hello world February 27, 2012 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer in Test Coding - 0of 0 votes
AnswersGiven (i) a non-empty binary search tree with double values (e.g. 3.5) in each node and (ii) a key value K
- mihirk February 15, 2012 in United States
Write a method to find the closest value to K.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Coding Data Structures Java Trees and Graphs - 0of 0 votes
AnswersGive logic for implementing "diff" command in Linux.
- mihirk February 08, 2012 in United States for Cloud Resource Management
Consider various test cases and explain what will happen in each. The two files are source code and are huge..
For e.g.
File 1: 1-2-3-4
File 2: 1-3-4-2| Report Duplicate | Flag | PURGE
VMWare Inc Software Engineer / Developer Algorithm Coding Data Structures Ideas Application / UI Design - 0of 0 votes
AnswersGet the top 3 frequently used words in a book. The book contents are given as a single text file.
- anon.guy January 31, 2012 in United States for Kindle
I used hashmap solution. The interviewer said its not optimal. Use a combination of two or three data struct.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Arrays Coding Data Structures - 0of 0 votes
AnswersWrite code for the following problem:
- vinayakravi January 27, 2012 in United States
find the element in the array that appears consecutively in the array max number of times. Should be O(N)
eg. 1113333244111 ans. 3| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite code for the following problem:
- vinayakravi January 27, 2012 in United States
find the element in the array that appears consecutively in the array max number of times. Should be O(N)
eg. 1113333244111 ans. 3| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersAn unsorted array contains elemets 1-1000, we are replacing one element in the array with n , and n is greater than 1000. How can we find out what element got replaced with n
- sanoj January 16, 2012 in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm Arrays Coding Java - 0of 0 votes
Answersfind common ancestor of 2 nodes in
- capricornkmu January 14, 2012 in United States
1. binary tree
2. binary search tree
No parent pointer is given.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
Answersgiven a million integers find the largest k elements
- capricornkmu January 14, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven an array of ints (positive and negative) and a sum, find 2 numbers in the array whose sum equal to input sum.
- capricornkmu January 14, 2012 in United States| Report Duplicate | Flag | PURGE
Riverbed Software Engineer / Developer Coding - 0of 0 votes
Answersimplement function:
- capricornkmu January 14, 2012 in United States
char * get_ip_address(int ip_address)
basically convert input ip_address to user-friendly format a.b.c.d| Report Duplicate | Flag | PURGE
Riverbed Software Engineer / Developer Coding - 0of 0 votes
AnswersCheck if tree 1 is sub tree of another tree 2
- capricornkmu January 14, 2012 in United States| Report Duplicate | Flag | PURGE
Riverbed Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven 2 sorted arrays, find the kth element in the merged array.
- capricornkmu January 14, 2012 in United States| Report Duplicate | Flag | PURGE
Riverbed Software Engineer / Developer Coding - 0of 0 votes
AnswersCheck if a tree is a BST.
- capricornkmu January 14, 2012 in United States| Report Duplicate | Flag | PURGE
Arista Networks Software Engineer / Developer Coding - 0of 0 votes
AnswersFind the in-order successor of an element in a BST.
- capricornkmu January 14, 2012 in United States| Report Duplicate | Flag | PURGE
Arista Networks Software Engineer / Developer Coding - 0of 0 votes
AnswersWhat features must a programming language and its runtime environment provide in order to support automatic memory management?
- balaaaji140 January 06, 2012 in India
1. Dynamic memory allocation
2. Explicit deallocation of data
3. Garbage collection
- 1 and 3, but not 2
- 1
- 3
- 2| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersImplement Iterator for a n-ary Tree structure.
- Gloryhunter January 06, 2012 in United States| Report Duplicate | Flag | PURGE
Coding - 0of 0 votes
AnswersA large integer is stored in an Array , with each index position storing a single digit of the Number. WAC to increment the integer , stored in the array by one.
- Gloryhunter January 06, 2012 in United States| Report Duplicate | Flag | PURGE
Coding - 0of 0 votes
AnswersGiven two integers a and b. Find the value of a/b without using division or modulo operators in C/C++.
- ssrmit62 December 20, 2011 in India
I tried with repeated subtraction of b from a, but the interviewer felt that this approach is inefficient. Any better approach ?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersIf pairwise sums of 'n' numbers are given in non-decreasing order
identify the individual numbers. If the sum is corrupted print -1
Example:
i/p:
4
4 5 7 10 12 13
o/p:
1 3 4 9Example: N = 4, Say numbers are a, b, c, d. The input is: pairwise sums in sorted order, i.e. values a+b, a+c, a+d, b+c, b+d, c+d are given sorted order
- sahasra.india December 14, 2011 in United States
We have to find a, b, c, d.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding