Front-end Software Engineer Interview Questions
- 3of 5 votes
AnswersA string is called sstring if it consists of lowercase english letters and no two of its consecutive characters are the same.
- priteshpathak15 July 29, 2013 in India
You are given string s of length n. Calculate the number of sstrings of length that are not lexicographically greater than s.
Input format
The only line of input contains the string s. It's length is not greater than 100.
All characters of input are lowercase english letters.
Output format:
Print the answer of test modulo 1009 to the only line of output.
Sample input:
bcd
Sample output:
653| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Front-end Software Engineer Algorithm - 0of 0 votes
AnswersGiven an array A of length n where each element is 1..k where k is much smaller than n,
- San April 23, 2013 in United States
find one set of distinct indices i1 and i2 such that A[i1] + A[i2] == z.| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer - 1of 5 votes
AnswersBelow question was asked in online coding exam for Palantir Technology, Palo Alto, CA. Time given was 100 min. I could not complete it by the time.
- Nitin Gupta February 02, 2013 in United States
-----------------------------
A group of farmers has some elevation data, and we’re going to help them understand how rainfall flows over their farmland.
We’ll represent the land as a two-dimensional array of altitudes and use the following model, based on the idea that water flows downhill:
If a cell’s four neighboring cells all have higher altitudes, we call this cell a sink; water collects in sinks.
Otherwise, water will flow to the neighboring cell with the lowest altitude. If a cell is not a sink, you may assume it has a unique lowest neighbor and that this neighbor will be lower than the cell.
Cells that drain into the same sink – directly or indirectly – are said to be part of the same basin.
Your challenge is to partition the map into basins. In particular, given a map of elevations, your code should partition the map into basins and output the sizes of the basins, in descending order.
Assume the elevation maps are square. Input will begin with a line with one integer, S, the height (and width) of the map. The next S lines will each contain a row of the map, each with S integers – the elevations of the S cells in the row. Some farmers have small land plots such as the examples below, while some have larger plots. However, in no case will a farmer have a plot of land larger than S = 5000.
Your code should output a space-separated list of the basin sizes, in descending order. (Trailing spaces are ignored.)
While correctness and performance are the most important parts of this problem, a human will be reading your solution, so please make an effort to submit clean, readable code. In particular, do not write code as if you were solving a problem for a competition.
A few examples are below.
Input:
3
1 5 2
2 4 7
3 6 9
Output:
7 2
The basins, labeled with A’s and B’s, are:
A A B
A A B
A A A
Input:
1
10
Output:
1
There is only one basin in this case.
Input:
5
1 0 2 5 8
2 3 4 7 9
3 5 7 8 9
1 2 5 4 2
3 3 5 2 1
Output:
11 7 7
The basins, labeled with A’s, B’s, and C’s, are:
A A A A A
A A A A A
B B A C C
B B B C C
B B C C C
Input:
4
0 2 1 3
2 1 0 4
3 3 3 3
5 5 2 1
Output:
7 5 4
The basins, labeled with A’s, B’s, and C’s, are:
A A B B
A B B B
A B B C
A C C C| Report Duplicate | Flag | PURGE
Palantir Technology Front-end Software Engineer Algorithm - 0of 0 votes
AnswerHow would you build a stock ticker service?
- sylarific July 17, 2012 in United States for Web Developer| Report Duplicate | Flag | PURGE
Front-end Software Engineer Coding - 0of 0 votes
AnswersAssuming a preexisting list of 100 words, how would you efficiently see if a word received from input is an anagram of any of the 100 words?
- sylarific July 17, 2012 in United States for Web Developer| Report Duplicate | Flag | PURGE
Front-end Software Engineer Algorithm - 0of 0 votes
AnswersWhat are some ways of improving performance of the web pages using HTML, JS and CSS optimization?
- sylarific July 17, 2012 in United States for Web Developer| Report Duplicate | Flag | PURGE
Front-end Software Engineer Application / UI Design - 0of 0 votes
AnswersExtend the JavaScript Array object by adding a method that removes duplicates.
- niharika.verma June 21, 2012 in United States| Report Duplicate | Flag | PURGE
Ebay Front-end Software Engineer Coding - 0of 0 votes
Answersimplement a deque
- Itcecsa June 10, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer Algorithm - 0of 0 votes
Answersfind the 2nd largest # in int array
- Itcecsa June 10, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer Algorithm - 0of 0 votes
AnswersGiven a triangle like the following
3 4 6 1 5 0
1. How many nodes would you have, for 20 rows?
- Anonimo July 23, 2011
2. How to find the largest sum from the top of the triangle to the one of the nodes at the bottom. In other words, if you consider it as a tree, find the max sum of all paths from root to the leaf.| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer Algorithm - 0of 0 votes
AnswersDescribe Fly-Weight pattern
- ds999 June 09, 2011| Report Duplicate | Flag | PURGE
Ebay Front-end Software Engineer - 0of 0 votes
AnswersWhen do you use Abstract and when do u use Interface
- ds999 June 09, 2011| Report Duplicate | Flag | PURGE
Ebay Front-end Software Engineer - 0of 0 votes
AnswersTypes of exceptions in JAVA
- ds999 June 09, 2011| Report Duplicate | Flag | PURGE
Ebay Front-end Software Engineer Java - 0of 0 votes
AnswerDevelop the conversion function among UTF-8, UTF-16 and UTF-32 in C, and test it.
- Anonymous March 04, 2011| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer - 1of 1 vote
AnswersHow to print this:
- JavaJavas February 24, 2011
1
11
21
1211
111212
31121112
this means you have to count like. In first line there is ' one 1 that's why second line is '11', now in second line is 'two 1', so third line is '21'. We have to count the appearance and print the number of appearance and number.| Report Duplicate | Flag | PURGE
Front-end Software Engineer Algorithm - 0of 0 votes
AnswersWrite a function
- pp February 23, 2011
int triangle(int A[], int n);
which given a zero-indexed array A of n integers returns 1 if there exists triple i,j,k ($i\not=j\not=k$, $0\le i,j,k <n$) such that:
A[i] + A[j] > A[k]
A[i] + A[k] > A[j]
A[j] + A[k] > A[i]
or returns 0 otherwise.
Examples:
For:
A[0]=10, A[1]=2, A[2]=5, A[3]=1, A[4]=8, A[5]=20
your function should return 1, since for i=0,j=2,k=4 all conditions are fullfiled (i.e. A[2]+A[4]>A[0]).
For:
A[0]=10, A[1]=50, A[2]=5, A[3]=1
your function should return 0.| Report Duplicate | Flag | PURGE
Front-end Software Engineer Algorithm - 0of 0 votes
AnswersSo the Problem being this.
- Prashanth October 13, 2010
Given a particular number say 637-8687 (NERVOUS) would be the word.
So for the older keypad’s seen on telephone’s I would have to create Mnemonics.
So for doing this, the first part being list out all the Permutations possible for a particular number series.
Ex: ListMnemonics(“723″) would result in
PAD PBD PCD QAD QBD QCD RAD RBD RCD SAD SBD SCD
PAE PBE PCE QAE QBE QCE RAE RBE RCE SAE SBE SCE
PAF PBF PCF QAF QBF QCF RAF RBF RCF SAF SBF SCF
For this my logic is
for the above number 723, somehow create all the permutations for 23 and then append for each of those permutations the letters of 7. That would give all the permutations possible for 723. The base case being if there is a single number then I would print its letters.
But please let me know what you guys think| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer Algorithm - 0of 0 votes
AnswersYou bought a carpet of size n*n, and when you got home you found it has white spots, and black spots (You don't know if it's a white carper with black spots, or a black carpet with white spots). A spot is one or more of the n*n 'cells', or the same color, with either a common side or a common corner. The 'original color' is that of which there are more spots.
- facebookista September 10, 2010
for example:
- if the carpet is all white, with a black circle in the middle, it's either black or white (as there is one white spot and one black spot)
- if the carpet is all white with a black, side to side, stripe in the middle, the carpet is white (as there are two whites, and one black spot)
- if it's a 'chessboard' pattern, it's again 1:1 (as each white has a common corner with another white...)
write a function:
int getOriginalColor(boolean[][])
that would return 0 for white, 1 for black, 2 for tie| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer Algorithm - 1of 1 vote
AnswersWrite a function to find the nearest link on a webpage given the mouse x,y coordinates.
- bjh August 14, 2010
If your algorithm just iterates through all the links, give an idea of how to make it faster.| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer Algorithm - 0of 0 votes
AnswersInterviewer drew an 2D graph on the board (X and Y axis). Given a set of buildings, defined by (x1,x2,height) discuss an algorithm to determine the silhouette of the buildings (line, the skyline). Buildings can overlap each other.
- bjh August 14, 2010| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer Algorithm - 0of 0 votes
AnswersIn C++, write functions for:
- bjh August 14, 2010
string serialize(vector<string> v);
vector<string> deserialize(string s);
such that a string returned from 'serialize' can be passed into deserialize to get the original set of strings back.| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer C++ - 0of 0 votes
AnswersPretend there is a robot that has to navigate a maze (N x M). The robot can only move down or right and the maze can contain walls. Write an algorithm to determine the number of paths the robot can take.
- bjh August 14, 2010| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer Algorithm - 0of 0 votes
AnswersDesign a backend for a Chess Application
- Anonymous August 08, 2010| Report Duplicate | Flag | PURGE
Highbridge Capital Front-end Software Engineer Data Structures Experience - 0of 0 votes
AnswersHow will you go about implementing google suggest kind of functionality for a cellphone
- Anonymous August 08, 2010| Report Duplicate | Flag | PURGE
Highbridge Capital Front-end Software Engineer Brain Teasers - 0of 0 votes
AnswerHow will you go about implementing BlockedQueue with a List
- Anonymous August 08, 2010| Report Duplicate | Flag | PURGE
Highbridge Capital Front-end Software Engineer Java - 1of 1 vote
AnswerDesign a car rental model
- hotdell March 28, 2010
Implement the accessor functions and a CarRental class which contains the container to store them.
A car rental company wants to keep track of its cars. Each vehicle has a license plate and a brand. (eg. BWM). Currently the company has SUV-s and Sedans. SUV-s have an optional third row seat, sedan’s have an optional sport package. Each car can be queried to inquire the number of passengers it can carry.| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer Object Oriented Design - 0of 0 votes
AnswersFind all files with US phone number format and print out
- hotdell March 26, 2010| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer Coding - 1of 1 vote
AnswersIn a very complicated Java back-end system, since the load is too big, the garbage collector can not handle the memory and start having memory leaks. How to detect it and solve it?
- nixu09 March 01, 2010| Report Duplicate | Flag | PURGE
Linkedin Front-end Software Engineer Large Scale Computing