Coding Interview Questions
- 0of 0 votes
AnswersWrite the code in C for the series eg: If a3b2c4 ..is taken then output should be aaabbcccc
- guptapayal493 December 02, 2013 in India for Rainbow| Report Duplicate | Flag | PURGE
Wipro Technologies Software Engineer / Developer Coding - 1of 1 vote
AnswersImplement Hashtable in Java
- unicorn November 16, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersFind a sub-sequence in a list of numbers where sum of sub sequence is maximum. Numbers can be positive or negative
- sanjay05iitr November 10, 2013 in India for Cyllas Experience| Report Duplicate | Flag | PURGE
Amazon SDE-2 Coding - 6of 6 votes
AnswersYou are given two string named str1 and str2. Your task is to find the minimum window in str1 which contains all characters from string str2.
- Rahul Sharma November 09, 2013 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Coding - -1of 1 vote
AnswersWrite a method that takes a string, in this format "aabbaadddc". Encode the string by counting the consecutive letters. Ex: "a2b2a2d3c1"
- unicorn November 07, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - -8of 8 votes
AnswersGiven a result in string of pass, fail, blocked, unknown as pppppppfffffbbbbbuuuuu or pppppppppppppppfffffff or pfpfpfpfpfpfpfpfpuuuuuuuuu or any combination of characters from p,f,b, or unknown character say u or x or y or z... question is write a program which can identity a pattern like all tests passed or all tests are failing or tests started failing (blocking issue may be) or unknown pattern... this is what my friend recall if someone also faced this question and recall better explaination , please add.. interviewer asked to code the solution not algo...
- Jack Williams November 01, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 1of 1 vote
AnswersFind if all the leaf nodes are at same level in binary tree.
- poojabasia September 26, 2013 in India
Recursive and non-recursive approach?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - -1of 1 vote
AnswersGiven a positive int "N". and an array of numbers ranging from 0-9 (say array name is arr).
- Abhi September 23, 2013 in India
print all numbers from 0 to N which include any number from "arr".
example:
i/p: N=20
arr={2,3}
o/p: 2,3,12,13,20| Report Duplicate | Flag | PURGE
Cadence Inc SDE1 Algorithm Coding - 4of 4 votes
AnswersWe are given a set of integers with repeated occurences of elements. For Example, S={1,2,2}.
- sc.shobhit September 14, 2013 in India
We need to print the power set of S ensuring that the repeated elements of the power set are printed only once.
For the above S, the power set will be {NULL, {1}, {2}, {2}, {1,2}, {1,2}, {2,2}, {1,2,2}}. So, as per the question requirements, we need to print {NULL, {1}, {2}, {1,2}, {2,2}, {1,2,2}}| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm Coding Trees and Graphs - 1of 1 vote
AnswersWrite a function which returns the square root of a given number upto a precision of 0.0001. Only arithematic operations like addition, subtraction, division and multiplication are allowed.
- sc.shobhit September 14, 2013 in India| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm Coding - 0of 0 votes
AnswersDesign a web crawler to dump all the pages of a given website (URL) onto disk. So basically it saves pages which is related to the website (for instance dump all pages of aws.amazon.com) and do not crawl the links outside the website
- vik September 06, 2013 in United States
I coded it in python and then they asked what is the internal structure of dict in python and why or why not it is fast| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Coding Data Structures Python - 0of 2 votes
AnswersGiven a float number 7.64, convert it into the string WITHOUT using any inbuilt function/library.
- sandy September 05, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - -1of 1 vote
AnswersDelete the repeated elements in a singly linked list in O(n) time complexity without using extra space. Linked list contains elements in unsorted order
- Saurabh Singhal August 22, 2013 in India
P.S. - Sorting is not allowed| Report Duplicate | Flag | PURGE
VMWare Inc Intern Coding Data Structures Linked Lists - 3of 3 votes
AnswersA standard chess knight (it moves in its standard way i.e. L shaped OR 2.5 moves) is sitting at the position a1 on an N x N chess board. What is the minimum number of moves it will take to reach the diagonally opposite corner?
- Saurabh Singhal August 17, 2013 in India
P.S. - If it were a 8 x 8 chess board, the final destination for the knight would be h8| Report Duplicate | Flag | PURGE
Goldman Sachs Intern Algorithm Coding Data Structures Trees and Graphs - -1of 1 vote
Answerswhat is the data structure used to build a text editor
- geek.coder August 10, 2013 in United States| Report Duplicate | Flag | PURGE
Coding - 0of 0 votes
AnswersUse iteration to find the common ancestor of two nodes on a BST.
- jiangok2006 August 07, 2013 in United States| Report Duplicate | Flag | PURGE
Coding - 4of 4 votes
Answersgiven a matrix of size m * n, place k students in such a way so that cheating in an exam could be minimized
- dddd July 27, 2013 in United States| Report Duplicate | Flag | PURGE
Algorithm Brain Teasers Coding - 1of 1 vote
AnswersImplement enque() function for a fixed size circular queue with synchronization / locking using any atomic opetations.
- suomi July 23, 2013 in United States| Report Duplicate | Flag | PURGE
VMWare Inc Member Technical Staff Coding - -1of 1 vote
AnswersWrite a function which will find number of bits set and for each set bit its index. Function declaration will be: int find_set_bits(uint8 *from, int size)
- suomi July 23, 2013 in United States| Report Duplicate | Flag | PURGE
VMWare Inc Member Technical Staff Coding - -2of 2 votes
AnswersGiven 2 sorted linked list, merge them into a third sorted linked list
- suomi July 23, 2013 in United States| Report Duplicate | Flag | PURGE
VMWare Inc Member Technical Staff Coding - -2of 2 votes
AnswersReverse a string in place
- suomi July 23, 2013 in United States| Report Duplicate | Flag | PURGE
VMWare Inc Member Technical Staff Coding - 1of 1 vote
AnswersWrite a high performance file search utility program . You are required to write a program that takes command line arguments and searches the required file in the current folder and the sub folders . Search could be for files or folders or both . Below are the four parameters that would be passed . You are also required to so proper exception handling and you code must be optimized as much as possible .
- shipra.harlalka July 22, 2013 in India
1) A top folder name : Folder from where search would begin. (Ex : C:/MyFolder )
2) Search Option (File /Folder /Both )
3) Search Pattern : A regular expression : (*my*.txt )
4) Timeout in seconds : once the operation treaches this timeout search should be stopped saying " Could not complete operation " and results obtained till then must be returned .| Report Duplicate | Flag | PURGE
Sapient Corporation Senior Software Development Engineer Coding - -2of 4 votes
AnswersFor a technical phone screen:
- mgm.globalization July 14, 2013 in United States for International
Given a string "aaabbcccc", write a program to find the character with the second highest frequency.| Report Duplicate | Flag | PURGE
Twitter Software Development Manager Coding - 6of 12 votes
AnswersGiven a list of integers, find out the biggest interval that has all its members in the given list. e.g. given list 1, 7, 4, 6, 3, 10, 2 then answer would be [1, 4]. Develop algorithm and write code for this
- prongs July 08, 2013 in India| Report Duplicate | Flag | PURGE
Google Applications Developer Algorithm Arrays C++ Coding - 0of 0 votes
AnswersWrite code to clone a graph recursively
- prongs July 08, 2013 in Indiastruct Node { int data; vector<struct Node*> neighbors; }
| Report Duplicate | Flag | PURGE
Google Applications Developer Algorithm C++ Coding - 0of 0 votes
AnswersGiven a pointer to a node in tree, you have to find the depth of that node.
- SK July 07, 2013 in India
function signature:
int depth (root, node);| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer Coding - 0of 0 votes
AnswersGiven a string, compute the number of all possible palindromes of all the possible anagrams of that string.
- gtkesh July 06, 2013 in United States| Report Duplicate | Flag | PURGE
Software Engineer Intern Coding - 0of 0 votes
AnswersYou are given a 2D array that is your sea. It has more than one ships which don't overlap each other. All ships are not necessarily of the same size.
- JSDUDE June 27, 2013 in United States
You are to improve on performance and space is no concern.
Write a program that takes in two co-ordinates:
If the attack co-ordinates did not have a ship, print "Missed"
If the attack co-ordinates have a ship, print "Attacked Ship <Name>"
If the attack co-ordinates have a the same part of the attacked ship, print "Already Attacked"
If the last piece of the un-attacked ship was attacked print: "Ship sunk".| Report Duplicate | Flag | PURGE
Ebay SDE1 Coding Data Structures - 0of 0 votes
AnswersImplement (in C++, MATLAB, or Java) a Fraction class that supports the following operations: addition, subtraction, multiplication, division, equality/non-equality, greater than/less than, and display. The program should take on the order of several hours. If there are techniques that would take longer to implement, note it down as comments.
- AnOnYmOuS June 24, 2013 in India| Report Duplicate | Flag | PURGE
Algorithm C++ Coding Java Math & Computation - 1of 1 vote
AnswersTwo files containing large number, one in each. You have only fopen(), int read(fp), fclose(), fwrite(). Add these two numbers and write in third file with the help of given functions only.
- grave June 23, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm C# C++ Coding Data Structures