Software Engineer / Developer Interview Questions
- 1of 1 vote
AnswersGiven n rows of integers, such that the ith row (1 <= i <= n) contains i integers, find the path having the maximum weight.
- ramdomain October 29, 2014 in India
Path traversal rules:
1. A valid path sequence would be top-down i.e. begins with the integer in the first row, and traverses all rows selecting only one integer in each row.
2. From any jth integer in the ith row i.e row[i][j], traversal can happen either downward (i.e to row[i+1][j]) or diagonally downward to the right (i.e to row[i+1][j+1])
The weight of a Path is the sum of values of integers in the Path sequence.
Sample Input:
No. of Rows: 5
4
2 9
15 1 3
16 92 41 44
8 142 6 4 8
Expected Output: 4, 2, 15, 92, 142 (Max weight is 255)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven two integer arrays. Find the Largest Common sub array. For example,
- ravio October 29, 2014 in United States
arr1 = {1,2,3,2,3,2} arr2={2,2,3,3,4,5}, the largest common sub array is {2,2,3,3}| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer Algorithm - 5of 5 votes
Answersint fun() { /*write code here.*/ } int main() { int i=10; fun(); printf("%d",i); }
change the value of the i without changing code of the main function, assign 20 to i ?
- mohit sharma October 28, 2014 in India| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer C - 0of 0 votes
AnswersGiven ~300k words with an average length of 7 in a file.
- JSDUDE October 27, 2014 in United States
All words are dictionary correct words.
Print all the anagrams that are present in this list of words without repeating them.
E.g. if the list has:
ACT
BAT
CAT
TAB
TAC
print:
ACT, CAT, TAC
BAT, TAB| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Data Structures - -1of 1 vote
AnswersDesign the algorithm and the system for a WebCrawler.
- JSDUDE October 27, 2014 in United States
The webcralwler will be provided millions of URLs. The webpage will be downloaded and then parsed for more URLs. If more URLs are found then they should also be downloaded and parsed.
He was interested in:
1. Scale to handle millions of URLs
2. What are the bottle necks in the system? How will you resolve them| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 2of 2 votes
AnswersDesign a vending machine
- JSDUDE October 27, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersGiven a sorted array with some sequenced numbers and some non-sequenced numbers. Write an algorithm that takes this array as an input and returns a list of {start, end} of all consecutive numbers. Consecutive numbers have difference of 1 only.
E.g. of array:
[4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 20, 22, 23, 24, 27]
- JSDUDE October 27, 2014 in United Statespublic class Range { private int begin; private int end; public int begin { get; set; } public int end { get; set; } }
| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Arrays - 0of 0 votes
Answers1. Consider an ordinary binary min- heap data structure with n elements supporting the instructions INSERT and EXTRACT-MIN in O(lg n) worst case time. Give a potential function f such that the amortized cost of INSERT is O(lg n) and the amortized cost of EXTRACT-MIN is O(1) , and show that it works.
- nikeshjoshi2001 October 27, 2014 in India| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer Algorithm - 0of 2 votes
AnswersThere are two coins that make 55 cents. If one of them is not nickle then what are the two coins?
- nafisah.islam October 26, 2014 in United States| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Math & Computation - 2of 2 votes
AnswersA bear have to climb a 60.5 feet long hill. It climbs 3 feet in every minute before it fall down for 2 feet. How long it will take to climb the hill?
- nafisah.islam October 26, 2014 in United States| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Math & Computation - 1of 1 vote
AnswersColorful Number:
- nafisah.islam October 26, 2014 in United States
A number can be broken into different sub-sequence parts. Suppose, a number 3245 can be broken into parts like 3 2 4 5 32 24 45 324 245. And this number is a colorful number, since product of every digit of a sub-sequence are different. That is, 3 2 4 5 (3*2)=6 (2*4)=8 (4*5)=20 (3*2*4)= 24 (2*4*5)= 40
But 326 is not a colorful number as it generates 3 2 6 (3*2)=6 (2*6)=12.
You have to write a function that tells if the given number is a colorful number or not.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Problem Solving - 0of 0 votes
AnswersA string "aBIY" is said to be a well-ordered word as each of the letters are in sequential manner regardless of case. So, "AbLe" is not a well-ordered word.
- nafisah.islam October 26, 2014 in United States
You are a anti-hacker. you have a number of character sequences. Your task is to generate all possible well-ordered word that can be generated by those numbers of given character sequences.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Problem Solving - 0of 0 votes
AnswersEdge Detection:
- nafisah.islam October 26, 2014 in United States
Two-dimensional array representation of an image can also be represented by a one-dimensional array of W*H size, where W represent row and H represent column size and each cell represent pixel value of that image. you are also given a threshold X. For edge detection, you have to compute difference of a pixel value with each of it's adjacent pixel and find maximum of all differences. And finally compare if that maximum difference is greater than threshold X. if so, then that pixel is a edge pixel and have to display it.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Problem Solving - 1of 1 vote
AnswersUse the shorest unique prefix to represent each word in the array
- sunshihaosd October 25, 2014 in United States
input: ["zebra", "dog", "duck",”dot”]
output: {zebra: z, dog: do, duck: du}
[zebra, dog, duck, dove]
{zebra:z, dog: dog, duck: du, dove: dov}
[bearcat, bear]
{bearcat: bearc, bear: ""}| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an array of paper products in which each product has an attribute name, width, and height, and given a sheet of paper that has width xx and height yy, write a program that returns the number of sheets of paper needed to print out the array of paper products
- emptypeace October 24, 2014 in United States| Report Duplicate | Flag | PURGE
Vistaprint Software Engineer / Developer Algorithm Java - 4of 4 votes
AnswersPrint combinations of strings from List of List of String
- mohrmanla October 23, 2014 in United States
Example input: [[quick, slow], [brown, red], [fox, dog]]
Output:
quick brown fox
quick brown dog
quick red fox
quick red dog
slow brown fox
slow brown dog
slow red fox
slow red dog| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 0of 0 votes
AnswersWrite a function that takes a list of positive integers as an input, and returns all of the pairs of integers it contains that sum to 100. You can assume that all inputs are between 1 and 99.
- cguru171 October 22, 2014 in Canada| Report Duplicate | Flag | PURGE
Software Engineer / Developer Data Structures - 0of 0 votes
AnswersThis test was on https://www.hackerrank.com
- JSDUDE October 22, 2014 in United States for TRMS
Input is a string of Bytes E.g.341B
Convert it to human readable form: 3 characters long (excluding decimal)
No trailing or leading zeros
E.g:
Input 341B
Output 341B
Input 12345B
Output 12.3K
Input 1234567B
Output 1.23M
Input 1000000000B
Output 1G
Do not round off
Assume input will not be more than 1G
For this problem 1000B = 1K, so on and so forth| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWe are given a specific time(like 02:23), we need to get the angle between hour and minute(less than 180)
- 9610 October 21, 2014 in United States| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Application / UI Design - -2of 2 votes
AnswersGiven an array of numbers print the values in diagonal format.
- dd.metro October 21, 2014 in United States
Example (1) for 8 dataset
Input Array : [1, 2, 3,4,5,6,7,8]
Output
01 02 04 07
03 05 08
06
Example (2) for 45 dataset
Input Array: [1, 2, 3,4,5,6,7,8,9,10……….44, 45]
Output
01 02 04 07 11 15 19 23 27 31 35 39
03 05 08 12 16 20 24 28 32 36 40 43
06 09 13 17 21 25 29 33 37 41 44
10 14 18 22 26 30 34 38 42 45
Code in Java.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 2of 4 votes
AnswersGiven number of digits of a phone number and number of disallowed digits as input, find all permutations of numbers which do not have two adjacent numbers the same, i.e. 1232 is allowed but not 1223. Disallowed digits can be upto 3, and can be included along with the phone number. Also the phone number should start with 4 if it contains the number 4.
- hpfan1 October 18, 2014 in United States| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer - 0of 2 votes
AnswersThe decimal and octal values of some numbers are both palindromes sometimes. Find such numbers within a given range.
- hpfan1 October 18, 2014 in United States| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Algorithm - 0of 0 votes
AnswersIf one and a half teenagers, eat one and a half pizzas in one and a half days, how many pizzas can 9 teenagers eat in 3 days
- hpfan1 October 18, 2014 in United States| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswersSuppose I am given a set of input strings input[5](five of them) and their corresponding replacement strings replace[5]. Then I am given an input text, how can I replace the strings in the text matching any of the inputs with their corresponding replacements.
- mikewhity October 16, 2014 in United States
Also I have to make sure that if suppose, I find a match input[0] and I replace it by replace[0], then because of that it could be possible that I have a new match for input[2] lets say because of the new characters added by replace[0]. I don't want to make replacements with replace[2].| Report Duplicate | Flag | PURGE
Software Engineer / Developer Replacing multiple string occurences from a text - 0of 0 votes
AnswersSuppose I have five strings input[5] and their corresponding replacements replace[5]. I am given an input text and I want to find the occurence of any of the input strings and replace them with the corresponding replace strings. I cannot use regex. How can I do it. Also I have to make sure that lets say after replace input[0] with replace[0], if a new string arises due to replace[0] that matches with lest say input[2], then I cannot replace it with replace[2].
- mikewhity October 16, 2014 in United States| Report Duplicate | Flag | PURGE
Software Engineer / Developer Replacing multiple string occurences from a text - 0of 0 votes
AnswersGoldbach's conjecture : Every even integer greater than 2 can be expressed as the sum of two primes.
- vamsi1899 October 16, 2014 in India
Write a function which takes a number as input, verify if is an even number greater than 2 and also print atleast one pair of prime numbers.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Algorithm - 2of 2 votes
AnswersThe stepping number:
- Anon October 13, 2014 in United States
A number is called as a stepping number if the adjacent digits are having a difference of 1. For eg. 8,343,545 are stepping numbers. While 890, 098 are not. The difference between a ‘9’ and ‘0’ should not be considered as 1.
Given start number(s) and an end number(e) your function should list out all the stepping numbers in the range including both the numbers s & e.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Algorithm Data Structures Dynamic Programming Java Online Test - 0of 0 votes
AnswersI was having an interview and here is the question:
- gzyeli123 October 13, 2014 in United States
If there are different pairs of characters, each pair of the characters means the two matching characters are the same. Print out all the identical characters.
For example:
if you have pairs:
A-B
C-D
E-F
G-H
A-D
F-G
you should print out:
{A, B, C, D} are the same characters.
{E, F, G, H} are the same characters.
Does anyone know how to solve this problem by not using brutal force?| Report Duplicate | Flag | PURGE
Lab126 Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven a NXN matrix, starting from the upper left corner of the matrix start printing values in a counter-clockwise fashion.
- Anon October 13, 2014 in United States
Eg: Consider N = 4
Matrix= {a, b, c, d,
e, f, g, h,
i, j, k, l,
m, n, o, p}
Your function should output: dcbaeimnoplhgfjk
Another example would be
C I P E
R N K U
U O W O
L E S Y
The function should print: EPICRULESYOUKNOW| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Algorithm