Front-end Software Engineer Interview Questions
- 0of 0 votes
AnswersGiven
colors = ["red", "blue", "green", "yellow"];
and a string
str = "Lorem ipsum dolor sit amet";
write a function that prints each letter of the string in different colors. ex. L is red, o is blue, r is green, e is yellow, m is red, after the space, i should be blue.
- rninja2019 May 08, 2019 in United States| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer - 1of 1 vote
AnswerHow do you make your pages performant?
- pri9 December 07, 2018 in United States| Report Duplicate | Flag | PURGE
PayPal Front-end Software Engineer - 1of 1 vote
AnswerWhat are the advantages of using React?
- pri9 December 07, 2018 in United States| Report Duplicate | Flag | PURGE
PayPal Front-end Software Engineer - 1of 1 vote
AnswerImplement the .reduce function of Javascript in plain JS.
- pri9 December 07, 2018 in United States| Report Duplicate | Flag | PURGE
PayPal Front-end Software Engineer JavaScript - 1of 1 vote
AnswersHow would you implement jQuery' s addClass and removeClass functions using vanilla JS? What other variations you can use? Can you pass multiple parameters for classnames ? How will you make these vanilla JS functions asynchronous? Make this component re-usable.
The implementation must respond to something like this:
- dtallinterviewee December 04, 2018 in United States$('#container') .addClass('blue') .addClass('bg-lime') .addClass('bold') .addClass('font-medium-italic') .addClass('border-solid-pink');
| Report Duplicate | Flag | PURGE
Uber Front-end Software Engineer JavaScript - 0of 0 votes
AnswersWhat are event emitters?
- Jaideep July 18, 2018 in India| Report Duplicate | Flag | PURGE
Capgemini Front-end Software Engineer Application / UI Design - 0of 0 votes
AnswersGiven a Binary string of 0s and 1s, and k, Find the number of different ways to get longest continuous streak of 1s. You can flip any k number of 0s to 1s.
- delta_x February 12, 2018 in India
Example:
1)Stirng is S=1010101, K=1
Result=3
1)Stirng is S=01010, K=3
Result=1| Report Duplicate | Flag | PURGE
Lava Front-end Software Engineer Java - 0of 0 votes
AnswersWrite a program which will get the top 'x' tweets based on their re-tweet count from 'n' tweets.
- danny459 September 20, 2016 in India| Report Duplicate | Flag | PURGE
N/A Front-end Software Engineer Algorithm - 0of 0 votes
AnswerWhat are semantic tags in HTML?
- Joey January 14, 2016 in India| Report Duplicate | Flag | PURGE
Auto NInja Front-end Software Engineer - 0of 0 votes
AnswersWhat are services in Angular.js?
- Joey January 14, 2016 in India| Report Duplicate | Flag | PURGE
Auto NInja Front-end Software Engineer JavaScript - 0of 0 votes
AnswersWhat is difference between Ember and Angular.js?
- Joey January 14, 2016 in India| Report Duplicate | Flag | PURGE
Auto NInja Front-end Software Engineer - 0of 0 votes
AnswersWhat are inline elements? What are block elements in HTML?
- Joey January 14, 2016 in India| Report Duplicate | Flag | PURGE
Auto NInja Front-end Software Engineer Web - 0of 0 votes
AnswersWhat is Dependency Injection in Angular.js?
- Joey January 14, 2016 in India| Report Duplicate | Flag | PURGE
Auto NInja Front-end Software Engineer JavaScript - 4of 4 votes
AnswersWe have an array of objects A and an array of indexes B. Reorder objects in array A with given indexes in array B. Do not change array A's length.
example:
- u-11i24223 October 26, 2015 in United Statesvar A = [C, D, E, F, G]; var B = [3, 0, 4, 1, 2]; sort(A, B); // A is now [D, F, G, C, E];
| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer Front End Web Development - 0of 0 votes
Answersyou are on a biz trip and travelling from one city to another. you have a stack of unsorted flight boarding passes. only departure city and destination city are on the boarding pass. how do you find the first departure city and your final destination city, write the solution in javascript.
- codebind September 06, 2015 in United States| Report Duplicate | Flag | PURGE
Google Front-end Software Engineer JavaScript - 0of 0 votes
AnswersWrite a function to determine if a string is a number without using any built-in function.
- Raul Rivero January 13, 2015 in United Statespublic bool IsNumber(string num) { }
| Report Duplicate | Flag | PURGE
Linkedin Front-end Software Engineer Algorithm - 0of 0 votes
AnswersSteps Problem,
- a9austin January 28, 2014 in United States
Givin n, find how many different ways you can take steps to reach the top
E.g.
findSteps(4)
1,1,1,1
1,1,2,
2,2
1,3,
4
this would return 5| Report Duplicate | Flag | PURGE
Front-end Software Engineer - 0of 0 votes
AnswersCount Scorecards
- sunilkanaujia.manit December 20, 2013 in India
In a tournament, N players play against each other exactly once. Each game results in exactly one player winning. There are no ties. You have been given a scorecard containing the scores of each player at the end of the tournament. The score of a player is the total number of games the player won in the tournament. However, the scores of some players might have been erased from the scorecard. How many possible scorecards are consistent with the input scorecard?
Input Format
The first line contains the number of cases T. T cases follow. Each case contains the number N on the first line followed by N numbers on the second line. The ith number denotes s_i, the score of the ith player. If the score of the ith player has been erased, it is represented by -1.
Output Format
Output T lines, containing the answer for each case. Output each result modulo 1000000007.
Constraints:
1 <= T <= 20
1 <= N <= 40
-1 <= s_i < N
Sample Input:
5
3
-1 -1 2
3
-1 -1 -1
4
0 1 2 3
2
1 1
4
-1 -1 -1 2
Sample Output:
2
7
1
0
12
Explanation:
For the first case, there are 2 scorecards possible: {0,1,2} or {1,0,2}.
For the second case, the valid scorecards are {1,1,1}, {0,1,2}, {0,2,1}, {1,0,2}, {1,2,0}, {2,0,1}, {2,1,0}.
For the third case, the only valid scorecard is {0,1,2,3}.
For the fourth case, there is no valid scorecard. It is not possible for both players to have score 1.
For the fifth case, 6-variations of {{3,1,0}[2]}, 3 variations each of {{2,2,0}[2]} and {{2,1,1}[2]}
Max Score: 89pts dynamic
Suggest Edits| Report Duplicate | Flag | PURGE
Front-end Software Engineer - 0of 0 votes
AnswersFor a table created using the following commands. State the SQL SELECT command to find the 1st and 2nd highest salary earned by staff working in DEL or MUM
- sunilkanaujia.manit December 20, 2013 in India
CREATE TABLE Employees (
ID int NOT NULL AUTO_INCREMENT,
Name varchar(100),
Sal decimal (10,2),
City char (3),
PRIMARY KEY (ID)
);
INSERT INTO Employees (Name, Sal, City) VALUES ('Ramesh',20000, 'BLR');
INSERT INTO Employees (Name, Sal, City) VALUES ('Sunil',24000, 'DEL');
INSERT INTO Employees (Name, Sal, City) VALUES ('Sreeja',21000, 'MUM');
INSERT INTO Employees (Name, Sal, City) VALUES ('Pavan',23000, 'DEL');
INSERT INTO Employees (Name, Sal, City) VALUES ('Maya',24000, 'MUM');| Report Duplicate | Flag | PURGE
Front-end Software Engineer - -1of 1 vote
AnswersThe below Java program prints the numbers from 1 to 50. But for multiples of three print "DNA" instead of the number and for the multiples of five print "RNA". For numbers which are multiples of both three and five print "ATGC". Please identify the three bugs in the code and suggest how they can be resolved.
- sunilkanaujia.manit December 20, 2013 in India
public class SeqTest {
public static void main(String args[]) {
for(int i = 1; i <= 50; i++) {
if(i % 3 == 0) System.out.println("DNA");
else if(i % 5 == 0) System.out.println("RNA");
else if(i % (3+5) == 0) System.out.println("ATGC");
else System.out.println(“1 to 50”);
}
}
}| Report Duplicate | Flag | PURGE
Front-end Software Engineer - 1of 3 votes
AnswersYou have a dictionary which is an array of words and array of strings.
- Grumpy December 11, 2013 in United States
Write two functions
1. Prepare the array of strings to be searched in the dictionary
2. Check if the string contains all valid words or not.| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer JavaScript - 3of 3 votes
AnswersHere is a good puzzle:
- Anonymous October 15, 2013 in United States
How do you write a program which produces its own source code as output?| Report Duplicate | Flag | PURGE
Microsoft Front-end Software Engineer - -1of 3 votes
AnswersGiven a string Sting="ABCSC" Check whether it contains a Substring="ABC"?
- Anonymous September 29, 2013 in India
1)If no , return "-1".
2)If yes , remove the substring from string and return "SC".
use very simple code and concept(ALGORITHM)..| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer - 0of 2 votes
AnswersDelete a specific char from string,,,,char is 'f' in string= "YOUSUF".the resultant string will be "YOUSU".
- Anonymous September 19, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer - 0of 2 votes
AnswersA string str ="STUN",, u hav to replace TU by KO . The resultant String "SKON". Use simple logic...
- Anonymous September 19, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer - -1of 1 vote
Answersstr="AB0CD1010" this s a string consider it as a counter variable n increment it
- Anonymous September 17, 2013 in India
for example the next element should be "AB0CD1011"
Note: If anyone know the answer fr ths ques well,pls post with full code and ALGORITHM(for beginners)...| Report Duplicate | Flag | PURGE
Amazon Front-end Software Engineer - -1of 1 vote
AnswersAdd the diagonal elements of a square matrix (of odd order say 3*3,5*5) but the intersecting element must be added only once.
- Anonymous September 13, 2013 in Australia
Sorry for my poor english..That what i understood from interviewer..| Report Duplicate | Flag | PURGE
Accenture Front-end Software Engineer - 2of 4 votes
AnswersAlex is standing on the top left cell (1,1) of a n*m table. The table has n rows and m columns. Initially, he is facing its right cell. He moves on the table in the following way:
- itzmevacho August 01, 2013 in United States
>He moves one step forward.
>He turns to his right
>While moving forward, if he would go out of the table or reach a visited cell, he turns to his right.
He moves in the table as much as he can. Can you find out the number of cells he visits before he stops?
For example, given a 9x9 grid, the following would be his moves. The number on each cell represents the step he would land on that particular cell.
1 2 55 54 51 50 47 46 45
4 3 56 53 52 49 48 43 44
5 6 57 58 79 78 77 42 41
8 7 60 59 80 75 76 39 40
9 10 61 62 81 74 73 38 37
12 11 64 63 68 69 72 35 36
13 14 65 66 67 70 71 34 33
16 15 20 21 24 25 28 29 32
17 18 19 22 23 26 27 30 31
Input:
The first line of the input contains two integer numbers n and m.
n and m are between 1 and 100.
Output:
Print an integer to the output being the answer of the test.
Sample input #00:
3 3
Sample output #00:
9
Sample input #01:
7 4
Sample output #01:
18| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer - 1of 3 votes
AnswersWe have a rectangle with n rows and m columns filled with numbers from 1 to n*m.
- itzmevacho August 01, 2013 in United States
Cell (i,j) of the rectangle is important iff:
* i = 1 and j = 1 (or)
*there is an important cell (a,b) such that (a,b) is a neighbor of (i,j) and the number
on (i,j) is greater than number on cell (a,b) and all of (a,b)'s neighbors except for (
(i,j) itself
Two cells are considered to be neighbors if they share a common edge between them.
Unfortunately the number in some of the cells has been erased. We want to write a number to those cells such that the resultant rectangle has all the numbers between 1 to n*m and it contains as many important cells as possible. In case there are several ways to do that, we are interested with the rectangle which is lexicographically smallest.
A table is lexicographically smaller that the other if the string of its row-major view is lexicographically smaller than the other.
Input:
The first line of the input contains two integers n and m, Each of the next n lines contains m tokens. Each token is either an integer between 1 and n*m or '?'.
Output:
Print the maximum number of important cells that can be obtained in the first line of the output and print the rectangle in the next n lines.
Constraints:
1 <=n,m <=6
Sample input #00:
2 3
2 ? ?
? ? 3
Sample output #00:
3
2 1 4
5 6 3
Sample input #01:
6 6
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
Sample output #02:
24
1 2 3 13 14 15
4 6 8 10 11 16
5 7 9 12 19 17
28 26 24 22 20 18
29 27 25 23 21 36
30 31 32 33 34 35| Report Duplicate | Flag | PURGE
Facebook Front-end Software Engineer