Software Engineer / Developer Interview Questions
- 1of 1 vote
AnswersGroup Anagrams
- Thiago January 13, 2014 in United States
input = ["star, astr, car, rac, st"]
output = [["star, astr"],["car","rac"],["st"]);| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 2of 2 votes
AnswersYou are given an array, divide it into 2 equal halves such that the sum of those 2 halves are equal. (Imagine that such division is possible for the input array and array size is even)
- gulusworld1989 January 13, 2014 in United States for Android| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 0 votes
AnswersBST - find next immediate higher value
- monty January 11, 2014 in United States
Ex . BST 2,3,6,9,7,4,13,24,19
find immediate highest value for 9 should be 13| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven String ss = "(a(b))(c(d(f))g)(y(h))
- monty January 11, 2014 in United States
Find the max depth of parentheses. Result should be numeric like here result should be 3 as "f" is surrounded by 3 parentheses.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an array of integers and the target as an input E.g.
- AA January 11, 2014 in United States
input = {5,2,1,4,3,6,7,8} .. target : 333 it should true as (5 +214 + 36 + 78) if the target does not match it should return false.... Eg. of false input : {5,5} target:60 ... It should return false as the combinations possible are 5+5 = 10 and 55| Report Duplicate | Flag | PURGE
A9 Software Engineer / Developer Coding - 0of 0 votes
AnswersImagine a binary tree lying on the floor with nodes as balls and edges as threads, you are given a pointer to a node. When you pick the tree from that node up what will be the structure of the tree. You have gravity changing the structure of the tree
- nishu January 11, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - -1of 3 votes
AnswersThere is a matrix which contains white cells , black cells and only one gray cell, need to go from (0,0) to (N-1, N-1) if Arra[N][N]
- Guy January 10, 2014 in United States
constraints:
a. The path should cover only white cells and should go via grey cell.
b. The node once visited cannot be visited again.
White cells are represented by 0, black cells by 1 and grey cell by 2.
Java preferred.
I know there is another thread on the same problem, but apparently nobody has the correct solution there. Most of the suggested solution won't cover all cases.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a 2d array N*M made of only 1's and 0's . I need to find a maximum subarray(square or rectangle) between two rows of the given 2d array which has all ones inside it. I need to find count of ones in this maximum subarray
- justhack4fun688 January 09, 2014 in United States
EXAMPLE : Let N=4 and M=5 and the array be
1 0 1 1 0
1 0 1 1 1
0 1 1 1 1
0 0 0 0 1
Now if their are Q(say here it be 2) queries each describing upper and lower row between which we need to find this subarray.
Query 1 : 1 1(means start at row 1 and end also at row 1).Then we can clearly see answer will be 2
Query 2 : 2 3(means start at row 2 and end at row 3).Then answer will be 6 here.
Now,if queries can be very large in number(say upto 10^6) .How to tackle this problem| Report Duplicate | Flag | PURGE
Accenture Software Engineer / Developer Algorithm - 0of 0 votes
Answers//Online Coding Assignment
As a member of the cab finder app team, you are tasked with implementing a CabFinder class that has the following minimal public interface:class CabFinder implements CabStatusListener { /** * Initiates CabFinder. Called only once per app startup. * @app An application object providing services implemented by * the rest of the application. * @maxCabs Nearest number of cabs that can be returned to the user */ public void initialize(CabApp app, int maxCabs) { //Insert code here... } /** * Gets nearest cabs within 1km of the current user’s location. * These must be the *nearest possible* @maxCabs in the 1km area. * @return An unordered list of the nearest cabs. */ public Cab[] getNearestCabs() { //Insert code here... } /** * Asynchronous Callback per CabStatusListener (see below). Called when the position of a cab has changed. */ void onCabPositionChanged(Cab cab) { //Insert code here… } /** * Asynchronous Callback per CabStatusListener (see below). Called when a cab’s availability changes. * @cab The cab whose availability has changed * @isAvailable true if the cab is now available, false otherwise */ void onCabAvailabilityChanged (Cab cab, boolean isAvailable) { //Insert code here… } }
Supporting Classes:
Here are the classes and utilities that are available for your use (you are not required to write any implementation for these classes)
/**
* Coordinates on a 2D map with a one meter granularity.
*/class Position { public int x; public int y; } interface Cab { /** * Unique identifier of a cab. */ int getID(); /** * Gets the current position of the cab */ Position getCabPosition(); /** * Returns whether or not the cab is available */ boolean isAvailable(); }
/**
- chandeepsingh85 January 08, 2014 in United States
* Provides services implemented by the rest of the Cab Application.
*/
interface CabApp {
/**
* Gets the current location of the user
*/
Position getUserPosition();
/**
* Returns an iterator that gives access to the list of all cabs in the city
*/
Iterator<Cab> getCabs();
/**
* Registers a CabStatusListener object for change notifications of cab object data.
*/
void register(CabStatusListener listener);
}
/**
* The CabStatusListener interface
*/
interface CabStatusListener {
/**
* Called when the position of a cab has changed.
* @cab The cab object
*/
void onCabPositionChanged(Cab cab);
/**
* Called when a cab’s availability changes.
* @cab The cab object
* @isAvailable true if the cab is available, false otherwise
*
*/
void onCabAvailabilityChanged (Cab cab, boolean isAvailable);
}| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 2 votes
AnswersHow would you model the animal kingdom (with species and their behavior) as a class system?
- Guy January 08, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer System Design - -4of 6 votes
AnswersHow would you model the animal kingdom (with species and their behavior) as a class system? Java
- Guy January 08, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer System Design - 0of 0 votes
AnswersDesign database locks to allow r/w concurrency and data consistency.
- lianshiwu January 08, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Threads - 2of 2 votes
AnswerThreads synchronization methods, how do they use CPU time slice and compare their efficiency?
- lianshiwu January 08, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Threads - 0of 0 votes
Answersyou are given a log file with userid, login time and logout time . The login/logout times are in terms of integers .
- juny January 08, 2014 in United States for Traffic
When given a time range with a difference of 1 i.e. (1-2) or (2-3) return how many users are online| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an array of integers, return the maximum subsequence subset and the sum formed by the subset
- juny January 08, 2014 in United States for Traffic| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer - 0of 0 votes
AnswersUsing the symbols of Periodic table, return the longest word possible from the english dictionary
- juny January 08, 2014 in United States for Traffic| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Algorithm - 1of 1 vote
AnswersA Contracter is doing work for 7 days at your home, you need to pay him 7000$ in total. Every day you need to pay him 1000$ only .. To Pay him you have a gold plate wortjh 7000$ , but you can cut it only twice
- juny January 08, 2014 in United States for Traffic| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswersDesign LRU Cache
- juny January 08, 2014 in United States for Traffic| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Object Oriented Design - 1of 1 vote
AnswersDesign Service like tinyurl
- juny January 08, 2014 in United States for Traffic| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersStart with the sequence of non-zero digits 123456789. The problem is to place plus or minus signs between them so that the result of thus described arithmetic operation will be 100.
- juny January 08, 2014 in United States for Traffic| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Algorithm - -2of 4 votes
AnswersHow would you model the animal kingdom (with species and their behavior) as a class system?
- Guy January 07, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer System Design - 1of 1 vote
AnswersYou are given an array A with elements 0 to n-1, numbers can be repeated in the array. Create n sets where
- nirupam.astro January 05, 2014 in India
S[i]={a[i],a[a[i]],a[a[a[i]]]…}. Set has all elements unique. Find the size of the largest set.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersWhat is the output of following program:
- godzilla January 04, 2014 in United States for unknown1 #include <stdio.h> 2 3 int r = 1; 4 int numbers[5] = {1, 2, 3, 1, 5 }; 5 6 int main(int argc, char** argv) 7 { 8 #if !defined(_MSC_VER) 9 asm("leal numbers, %esi"); 10 asm("movl $0, %ecx"); 11 asm("movl r, %eax"); 12 asm("label1:"); 13 asm("movl (%esi,%ecx,0x4), %ebx"); 14 asm("imul %ebx, %eax"); 15 asm("addl $1, %ecx"); 16 asm("cmpl $5, %ecx"); 17 asm("jl label1"); 18 asm("mov %eax, r"); 19 #else 20 __asm 21 { 22 LEA ESI, numbers 23 MOV ECX, 0 24 MOV EAX, r 25 label1: 26 MOV EBX, [ESI + ECX * 4] 27 IMUL EAX, EBX 28 ADD ECX, 1 29 CMP ECX, 5 30 JL label1 31 MOV r, EAX 32 } 33 #endif 34 printf("Result= %d\n", r); 35 return 0; 36 }
| Report Duplicate | Flag | PURGE
CareerCup Software Engineer / Developer Assembly - 3of 5 votes
AnswersYou're given a machine (Let's say a sprinkler). The machine is controlled with a software component that has UI. The user can set different parameters in the UI. for example : 'speed' : 120 'pressure' : 30
- GeorgyBoy December 30, 2013 in Israel
Change the system so it will accept an arithmetical expression in the UI. The expression can contain constants, parameters (e.g 'speed') and operators.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Object Oriented Design - 7of 7 votes
AnswersYou need to develop the game Snake. What data structures will you use? Code your solution.
- GeorgyBoy December 30, 2013 in Israel| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Coding Java Problem Solving - 2of 4 votes
AnswersGiven a sorted array of integers, write a function that will return the number with the biggest number of repetitions.
- GeorgyBoy December 30, 2013 in Israel
(Asked to refine the solution to be more efficient)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Arrays Coding Data Structures Problem Solving Sorting - 3of 3 votes
AnswersGiven a board made of 2 x n squares, and boards made of 2 x 1 squares, write a function that will calculate the number of possible ways to arrange the 2 x 1 boards on the 2 x n board, in a way that will fill it completely.
- GeorgyBoy December 30, 2013 in Israel
(Asked to refine the solution to be more efficient)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Coding Problem Solving - 0of 0 votes
Answershow to read a big data file to get the top K values?
- HadoopUser December 29, 2013 in India| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer - 1of 1 vote
AnswersThree points are given A(x1, y1), B(x2, y2), C(x3, y3). Write a method returning an array of points (x, y) inside the triangle ABC.
- BB December 28, 2013 in Serbia| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm