## Recent Interview Questions

- 0of 0 votes
Write a function to convert a String of ip address to hex

eg: ip is 197.27.11.11 = 0xC51BBB

- 0of 0 votes
An web service maintains logs (suppose there are multiple log files per day) of all ip address which has requested service. If there is a DOS attack on the server find all ip addresses that has sent more number of requests and block them. Can this be done without writing any function in higher programming language?

What would the function look like if written in some language like C, Java etc?

Can this be done in Time optimized and space optimized manner?

- 0of 0 votes
Given a linked list with next and random pointer, deepcopy the linked list and return new head.

Node {

char val,

Node next,

Node random }

A {

val: ’a’

next: D

random: G}

D {

val: ’d’

next: G

random: A}

G {

val: ’g’

next: null

random: D}

-----------

| |

| V

A -> D -> G -> null

-------------

| |

| V

A' -> D' -> G' -> null

- 0of 0 votes
Explain in detail about your favourite android api.

- 0of 0 votes
given 2 list of interval representing users online offline timestamp e.g (already sorted), find all intervals that both of users are online.

e.g A= [(3, 5), (7, 11)] B=[(2, 4), (9, 10)] --> [(3, 4), (9, 10)].

- 0of 0 votes
Design a SparseVector class that implements

Vector interface, which contains 4 methods: get(int index),

increment(int index, int delta), numNonZeros(), and dotProduct(Vector other)

- 0of 0 votes
Give a vote list = [(a, 100), (b, 150), (a, 200)] # (name, timestamp) and time T

Find the highest number of votes (or anyone with the highest number of votes) at T

ex: T = 100 -> a, T = 150 -> a or b, T = 200 -> a

followup1, give one more input K, find Top K votes at T

followup2, the same vote list, K, but given the Top K votes list, find the time T.

- -1of 1 vote
what is technology?

- 1of 3 votes
Congrats to aonecode's member F.L.

Got offers from - Youtube(G), LinkedIn, Airbnb, Square, Wish, Blend and NextDoor!

Thanks for sharing the interview experience with us.

Youtube Interview

- Phone: Find anagrams of string A from string B (sliding window)

- Phone: Find if two frames in a screen are equal. Frames may overlap. (equal method)

Onsite:

- LC41 first missing positive

- LC499+LC505 The maze

- LC161 one edit distance

- Similar to hangman but make guesses based on a dictionary.

Assume a dictionary has words - {house, morse, jesus} and ‘morse’ is the answer. If your first guess is ‘house’, output will be ‘_o_se’, which indicates 3 letters are correct. (Here the arrangement of letters does not matter. Your guess can be ‘co’ and if answer is ‘ok’ then the output is gonna be ‘_o’ which indicates letter ‘o’ in answer. )

Try to get the answer with minimum guesses.

(Interviewer expects pre-processing the dictionary. Key: letter; Value: frequency. Begin with combinations of most frequent letters first)

- 1of 3 votes
Congrats to F.L.

Got offers from - Youtube(G), LinkedIn, Airbnb, Square, Wish, Blend and NextDoor!

Thanks for sharing the interview experience with us.

LinkedIn

Phone:

- Questions from LC tagged LinkedIn.

Onsite:

- Get sqrt(x). Output a floored integer if result is not a perfect square. sqrt(18) = 4

- Implement BST, insert, delete, search.

- Design a dashboard for service logs stats (sort and aggregate). Scale from 1 to more machines. Discuss async and realtime as different scenarios.

- 2of 2 votes
Facebook

-Phone: LC304 & longest arithmetic sequence. Return the sequence.

- 3of 3 votes
Wish Interview

-Phone: Two sum, Three sum, N sum(recursion)

Onsite:

-Implement merge sort (recursion&iteration)

-Merge two sorted arrays: one of length m+n, the other n; store the result in the longer array

-Given a number print diamond:

Given 1

Pirnt 1

Given 3

Print

1

121

1

Given 5

Print

1

121

12321

121

1

- Rank N people in a game. There may be a tie among participants. How many possible ways of ranking there is.

- Design: Define a bot as an IP that hits the web app over M times in the past T seconds (not necessarily hits on the same page. Also take into account different API calls.) How to design a bot detector layer and where to place it in the system.

- 0of 0 votes
Developing Java game

creating a RESTful service using which players can play a simple game described

below.

The game should have the following rules:

• The player has an infinite amount of coins.

• The player bets 10 coins to play a normal game round.

• In any round (free or normal), the player has a 30% chance of winning back 20 coins.

• In any round (free or normal), the player also has a 10% chance of triggering a free round where

the player does not have to pay for bet. The free round works in the same way as a normal round except

it costs 0 coins. The free round should follow immediately after the normal round.

• The player can both win coins and free round at the same time.

- 0of 0 votes
Given an array of integers and k, find the difference between the number of the strictly increasing number of subarrays (of size more than one) and the number of the strictly decreasing subarray in the window of size k. your method should be time and space efficent

example

int[] nums = {188930, 194123, 201345, 154243, 154243};

int k = 3;

Output

3, 0, -1

Explanation

For the first window of [188930, 194123, 201345], there are 3 increasing subranges ([188930, 194123, 201345], [188930, 194123], and [194123, 201345]) and 0 decreasing, so the answer is 3. For the second window of [194123, 201345, 154243], there is 1 increasing subrange and 1 decreasing, so the answer is 0. For the third window of [201345, 154243, 154243], there is 1 decreasing subrange and 0 increasing, so the answer is -1.

public int[] getdiff(int[] nums, int l){

}

- 0of 0 votes
I participated interview event with Amazon and receive email from Amazon recruiter that the team was happy with my performance and would be giving me offer at Amazon Vancouver Office, Canada. However,17 days later i still not get an official offer. I did several follow up with the recruiter within the period, just to get some "they are finding team for me" response. What could go wrong? Why is it in my case that the offer is being process so slow?

- -1of 1 vote
What is the Big O of that algorithm? What happens at runtime?

- 0of 0 votes
What's the algorithm to transform the sentence "the brown fox ran fast" in "eht nworb xof nar tsaf" (reverse any word)

- 1of 1 vote
A gaming application assigns a sessionid to each player every time they start a new session. These sessionid are all unique and can be selected from 1 to 10^6 numbers. A get() and put() function is used to assign and then release the sessionid for each user. A released session id can then be reused and assigned to another player. How can you write the get() and put() function to handle this in time and space optimized manner?

I did provide o(n) solution with hash table but he seemed to be asking for a bit manipulation or bit masking technique for 32 bit address.

- 0of 0 votes
Write a merger and separator for Linked List.

eg: 1->2->3->4->5

separator()

1->3->5 and 2->4

merger()

1->2->3->4->5

- -1of 1 vote
Microsoft Office support phone number diagnose the issues related to Microsoft office. Using Microsoft office if any features and application doesn’t configure properly then you can call our support number. We provide you all support for Microsoft product like Microsoft office outlook all versions, Microsoft office 365 configuration and other problems related to Microsoft office product on third party basis. Our well experienced executives at Microsoft office 365 support helpline number +1-800-826-8068 will provide you support and satisfy you. For more information you can visit our website.

Read More

http://www.microsoftoutlookoffice365.com/outlook-365-support.html

- 0of 0 votes
`give an enum, where each element has a parent-children relationship, and children's expression is the value of parent append an index, such as enum vehicle { car = 1 toyota = 11 camry = 111 corolla = 112 honda = 12 truck = 2 GMC = 21 } Ask a value, return to his parent, such as GMC = 21, return to the truck`

- 1of 1 vote
Given a list points on a 2d plane, find

largest rectangular area that can be formed

for the rectangle only considers those parallel to x and y

- 0of 0 votes
`There is an unordered interval stream, write a method, returns the total length that all intervals cover by now class Interval{ int start; int end; } public List<Integer> countCoverLength(Iterator<Interval> stream){ }`

- 0of 0 votes
I have a service in Which you need to send below data in SMS with a keyword and in return you will get the availability of flight or you can book a seat in flight.

Data - AirlineName, Date, Time, From, To

1. Give Test Data

2. Give Test Scenarios

3. If you have not being given any Mobile phone to send text or any API client to query the webservice, how will you test this?

- 0of 0 votes
I have clicked some photos in a Camera. I am trying to transfer photos to laptop using USB cable but the Camera is not getting connected. Give debugging steps.

- 0of 0 votes
i want to know the 30% hike of 10.5lac?

- 1of 1 vote
Write a program to shuffle a deck of card?

- 0of 0 votes
Suppose you have a stock broker events that send events whenever there is an event occurs, like buy, sell etc.

There are apps that needs gets these data from the events application, not all application needs all the functions.

There is broker interface that is a link between the apps and the stock application. How will you design the classes, methods etc.

- 0of 0 votes
Supposed you have a sorted array, that was rotated like [2 4 6 7 8] => [7 8 2 4 6]. How will find an element in the array.

- 0of 0 votes
Consider a social networking site, where in each user has a number of contacts, how will you find the shortest path between 2 users who are not connected.