## Senior Software Development Engineer Interview Questions

- 2of 2 votes
Given 2 strings representing very large numbers (these are not representable as a BigInteger or other various type) write a method for adding the two numbers and returning their sum.

- 0of 0 votes
Round 3- Find the first duplicate occurence of a number in an array

- 0of 0 votes
Round 3 - puzzle-there are 8 coins out of which 1 coin is faulty.The faulty coin has a lesser weight than the rest of coins which all have the same weight.You have been given a weighing balance with a pulley.Find the faulty coin

- 0of 0 votes
Round 3 - Write a java program to print a matrix in spiral

- 0of 0 votes
Round 2 - Write a java program to determine if a 10 digit number is magic number.A number is magic number if it has all digits between 1 to 6 occuring in it or if it has any number between 0 to 9 occuring thrice or if it contains three consecutilvely increasing or decreasing digits differing by 1 example 345 or 543

- 0of 0 votes
Round 2 - write java code to create the following pattern

*

* * *

* * * * *

* * * * * * *

* * * * * * * * *

- 0of 0 votes
Round 1-question 1 - given an array of stock prices for n days.Write an algorithm to maximize the profit of a customer such that he can buy and sell only once.

-Question 2

Prove that complexity for searching in arraylist is o(n)

and adding is o(1)

- 0of 0 votes
write java code to create the following pattern

*

* * *

* * * * *

* * * * * * *

* * * * * * * * *

- 0of 0 votes
Round 2- puzzle given 4 pair of socks of different colors(Red,green,blue and yellow)

Arrange the socks in such a way such that there are exacly 4 socks between the yellow socks,3 between the red ones and 2 between the green

- 0of 0 votes
Round 1-Question 2

Prove that complexity for searching in arraylist is o(n)

- 0of 0 votes
Round 1-Question 1

1)Given an array of stock prices for 7 continuous days.Write an algorithm to maximize the profit for a customer who buys stock on any day and sells it later.Buying and selling can happen only once and selling should happen on any day after buying

- 0of 0 votes
Design a system like HackerRank/Codechef.

- 0of 0 votes
Search for a sorted integer in an integer array that has been rotated multiple times.

- 1of 1 vote
Print the bottom view of a Binary Tree.

ex-`1 2 3 4 5 7 8 9 10`

result is 4, 8, 5, 9, 7, 10

- 0of 2 votes
All Sim characters are loaded with the same copy of your software. Imagine two of these sims are positioned somewhere on a line that extends to infinity in both directions, left and right. Using the below interface, write a C# method called "Collide" that ensures that the two sims will collide at some point in the future. Remember, the code that you write will be deployed to each Sim. You cannot write code that will be deployed to one and not the other. The method should have no parameters. You do not need to implement the ISim interface.

`public interface ISim { void MoveLeft(); // Moves the sim character one unit on the line to the left void MoveRight(); // Moves the sim character one unit on the line to the right void Relax(); // Commands the sim character to not do anything void MarkPosition(); // Puts a mark on the line at the current position of the sim character bool IsCurrentPositionMarked(); // Inspects the current position of the sim character for a mark and returns true if one is found, false if one is not found. }`

- 0of 0 votes
You need to design a new YouTube feature where userA is uploading a video and userB (friend of userA) gets notified for the video and wants to watch the same video in real time (i.e. even the video is not completely uploaded but we want to enable the other user to watch it).

How would you tackle the situation when userB wants to view the content starting from a position which is not yet uploaded.

Draw block diagram for this problem identifying the different components.

- 0of 0 votes
Given two positive integers represented as linked lists, provide the sum of the numbers as a linked list.

`1->2->3 4->5->6 ----------- 5->7->9 1->2->3 4->5 ----------- 1->6->8 4->5->6 7->8->9 ----------- 1->2->4->5`

- 0of 0 votes
A and B are playing a perfect 8-9 game. The rules are pretty simple. At each point, you can either insert an 8 at the end of the previous number or a 9. one 8 and one 9 forms a pair. a 9 can only be inserted if there is an 8 which does not form a pair. Perfect solution is the one which has all its numbers in pair. Find out all the possible perfect outcomes of the game in lexicographic order.

Input-

Input 1: Max length of number

Output-

Your array must return an array of string s containing all possible outcomes.

Example 1:

Input: 4

Output: {"8899", "8989"}

Explanation: There can be only 2 possible outcomes out of 4 as nine must follow eight.

Example 2:

Input: 6

Output:{"888999","889899","889989","898899","898989"}

Explanation: The possible outcomes are 5.

- 0of 0 votes
/**

*

* Google OnSite Round 3

*

* Data structure for Task Dependency

* A task can start only after all its pre-requisites are done

*

* Code the methods addTask(preRequisiteTask, dependentTask)

* and

* getExecutionSequence()

*

*/

- 0of 0 votes
/**

*

* Google OnSite Round 2

*

* Input is an integer array A

* Return an array B such that B[i] = product of all elements of A except A[i]

*

*/

- 0of 0 votes
/**

*

* Google Telephonic Round 2

*

* Given any uppercase string. Report the starting index at which any valid permutation of

* ABCDEF starts. If not found, then report -1.

* Possible permutations of ABCDEF are ABCDFE, BCDAFE, FEDCAB etc (a total of 6! = 720 permutations)

*

*/

- 0of 0 votes
/**

*

* Google Telephonic Round 3

* Find the sum of all nodes stored in a tree

*

*/

- 0of 0 votes
/**

*

* Google Telephonic Round 3

*

* Convert an integer to base-3 equivalent

*

*/

- 1of 1 vote
/**

*

* Google Telephonic Round 1

*

* Given two strings - S1 and S2.

* Arrange the characters of S1 in same alphabetical order as the characters of S2.

* If a character of S1 is not present in S2 - such characters should come at the end of

* the result string, but make sure to retain the order of such characters

* Case sensitivity is irrelevant

* e.g. S1 = "Google", S2 = "dog"

* Output = "ooggle"

*

* e.g. S1 = "abcdedadf", S2 = "cae"

* Output = "caaebdddf"

*

*/

- 0of 0 votes
Find valid bracket from provided string. Only { [ ( are involved as brackets. A valid bracket contains with a enclose companion.

Example: {} is valid, [[] Invalid

Input: {[()]}[]() Result: Valid

Input: {}[]()( Result: Invalid

- 0of 0 votes
Given a List determine if contiguous elements of the List sum to an input number. For example: Array/List [6 5 3 2 1 7], and input number 8. The numbers 5 + 3 = 8. Or suppose an input number 10, the elements of the list 2 + 1 + 7 = 10.

- 0of 0 votes
Question:

* Implement a program which receives tasks, which are basically objects with "run()" method and

* a long field, where long field indicates the time after which the task should start running

* by calling the run() method

EdgeCases:

* Imagine a case, where (A,10) task A is scheduled to run after 10 seconds

* and then when at 3rd second, another task B comes where (B,2) seconds

* then which one would be executed first ?

- 0of 0 votes
A special number is defined as a number where, in binary notation,

a. has only set bits (OR)

b. all set bits are followed by unset bits (OR)

c. the sequence formed by count of the number of set bits separated by any number of unset bits is a contiguous subsequence of the sequence of natural numbers.

2, 3, 11271 and 15667135 are special numbers because their binary represenation is 10, 11, 10110000000111 and 111011110000111110111111 respectively.

2 is a special number because of condition (b).

3 is a special number because of condition (a).

11271 is a special number because its binary representation is 10110000000111 because of condition (c). The sequence of the count of number of set bits separated by a unset bits is 1, 2 and 3. This is clearly a continguous subsequence of the natural numbers.

Similarly, 15667135 is a special number. (The sequence is 3,4, 5 and 6.)

So, given two integers n and m where n <= m, find out the number of special numbers between n and m inclusive.

Input Format:

The first line of input contains an integer T where T is the number of test cases. Then T lines follow containing two space separated integers n and m where n <= m.

Output Format:

For each test case, output, in different lines, a single integer P where P is the number of special numbers between the range specified.

Constraints:

1 <= T <= 1000

1 <= n <= 10^6

1 <= m <= 10^6

n <= m

Sample Input:

4

2 10

11 15

20 30

2 100

Sample Output:

6

4

5

43

- 0of 0 votes
Implement a rate limiter attribute/decoration/annotation on top of an API endpoint. caps to N requests per minute with a rolling window (implement from scratch / test / compiling + working code. Was made to write the code in front of a computer.

- 0of 0 votes
Basic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical products that are exempt. Import duty is an additional sales tax applicable on all imported goods at a rate of 5%, with no exemptions.

When I purchase items I receive a receipt which lists the name of all the items and their price (including tax), finishing with the total cost of the items, and the total amounts of sales taxes paid. The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded up to the nearest 0.05) amount of sales tax.

Write an application that prints out the receipt details for these shopping baskets.

Input:

1) 1 book at 12.49

2) 1 music CD at 14.99

3) 1 chocolate bar at 0.85