J@sper
BAN USER
- 2of 2 votes
AnswersGiven a string "2-4a0r7-4k", there are two dashes which we can split into 3 groups of length 1, 5, 2.
- J@sper in United States
If we want each group to be length 4, then we get "24A0-R74k"
Given a String A and an int K, return a correctly formatted string.
IF A is "2-4A0r7-4k" and B is 4, string is "24A0-R74K"
IF K is 3, string is "24-A0R-74K" as the first grp could be shorter.| Report Duplicate | Flag | PURGE
Google Algorithm - 0of 0 votes
AnswersCAREERCUP is a boad game hat contains m x n on a board. The objective of the CAREERCUP game is to reach the bottom of he board (bottom right corner) from the top of the board (top left corner) while moving one grid at a ime in either the down, right or diagonally downwrd directions.
- J@sper in United States
Write a method called CareerSolution that takes in two integers representing m and n, and returns the total number of ways a player can complete the game.
PS: Was later asked to optimize the solution.
int CareerSolution(int m, int n) {
}| Report Duplicate | Flag | PURGE
Amazon Intern Arrays - 1of 1 vote
AnswersLet's say I have a word "I love chicken", I can break the number of characters in each word, like so: [1] [4] [7]
- J@sper in United States
[1,4] [4,7], [1,4,7].
Now let's say I have a max = 5. The phrases with equal or fever than 5 characters are "[I], [love], and [I, love]. The longest phrase is [I,love], which contains 2 words.
Complete the Length function given. It has 2 parameters:
1) An array of integers, named array
2) A maximum number, named max.
int Careercup( int [] array, int max) {
}
Example test case 1:
[3,1,2,3]
4
Output expected : 2| Report Duplicate | Flag | PURGE
Google Software Developer Arrays - 2of 2 votes
Answersfind consecutive integers in a list that give you the biggest sum
- J@sper in United States
Like for -2 5 -1 7 -3 it would be 5 -1 7| Report Duplicate | Flag | PURGE
Google Java - 0of 0 votes
AnswersWrite the function READ, which is passed two double pointers pointing to the head pointers of two linked lists.
- J@sper in United States
One list will hold even integers, the other one will hold odd integers. READ reads a series of integers. It separates adds odd integers to the first list, and even ones to the second, all in sorted order.| Report Duplicate | Flag | PURGE
Google C - 1of 1 vote
AnswersGiven a string containing only 0 and 1's, write a function that reverses and returns the two complements of the string.
- J@sper in United States| Report Duplicate | Flag | PURGE
C - -12of 12 votes
Answers-
- J@sper in United States| Report Duplicate | Flag | PURGE
Google Jr. Software Engineer C - 0of 0 votes
AnswersGiven a number (200), compare it to four variables (E.G A,B,C,D) and return true if they are all equal to the given number.
- J@sper in United States
Do this in the most efficient way, and if possible without if statements.| Report Duplicate | Flag | PURGE
Amazon Computer Scientist C - 0of 0 votes
AnswersWrite a method that takes in a positive integer, return the number of 2s between 0 and the input number.
- J@sper in United States
If the input value given is 13, it should return 2 as the number 2 and 12 are between 0 and 13.
If the input value given is 21, it should return 3 as the number 2,12 and 20 are between 0 and 21.| Report Duplicate | Flag | PURGE
Amazon Jr. Software Engineer Java - -1of 3 votes
Answerswrite a method that takes in 2 int arrays of any size and returns an array that calculates the sum of both.
- J@sper in United States for -
for example, [1,2,3] and [2,3,4] will return [3,5,7]
Or [1,2,3] and [2,3,5,5] will return [2,4,7,8]
however, if it's like [9,9,2] and [0,1,3] you need to carry the sum so it returns as [1,0,0,5]
** SINGLE DIGIT ONLY| Report Duplicate | Flag | PURGE
Google Intern Arrays
Yes
- J@sper February 11, 2016