Dropbox Interview Questions
- 0of 0 votes
AnswerI want to implement a simple HTTP Denial-of-Service protection. There are clients that can send HTTP request to a Server (i.e. a GET Method of http://10.1.1.2:8080/?clientId=7)
- Patrick July 18, 2018 in United States
if in an interval of 10 seconds more then 10 request comes from a specific client the 11th, 12th.. requests will get blocked. until 10 seconds from the first request will pass and then a new time windows of 10 seconds will be open. the idea is no more than 10 requests per 10 secs.
The time frame starts on each client’s first request and ends 10 seconds later.
I want to implement this logic on the server. Which data structures/collection/custom made object would you build to implement such a logic...
it is also important to have a threats safe solution.. and performances is also a factor here..
Thanks.| Report Duplicate | Flag | PURGE
Dropbox Software Trainee Java - 2of 2 votes
AnswersDropbox
- aonecoding March 21, 2018 in United States
Grid Illumination: Given an NxN grid with an array of lamp coordinates.
Each lamp provides illumination to every square on their x axis,
every square on their y axis, and every square that lies in their diagonal
(think of a Queen in chess).
Given an array of query coordinates,
determine whether that point is illuminated or not. The catch is when checking a query all lamps adjacent to, or on,…| Report Duplicate | Flag | PURGE
Dropbox Software Engineer Algorithm - 3of 3 votes
AnswersDesign a hit counter which counts the number of hits received in the past 5 minutes.
- aonecoding January 18, 2018 in United States
Each function accepts a timestamp parameter (in seconds granularity) and you may assume that calls are being made to the system in chronological order (ie, the timestamp is monotonically increasing). You may assume that the earliest timestamp starts at 1.
Example:
HitCounter counter = new HitCounter();
// hit at timestamp 1.
counter.hit(1);
// hit at timestamp 2.
counter.hit(2);
// hit at timestamp 3.
counter.hit(3);
// get hits at timestamp 4, should return 3.
counter.getHits(4);
// hit at timestamp 300.
counter.hit(300);
// get hits at timestamp 300, should return 4.
counter.getHits(300);
// get hits at timestamp 301, should return 3.
counter.getHits(301);
Follow-up:
Due to latency, several hits arrive roughly at the same time and the order of timestamps is not guaranteed chronological.
Follow up 2:
What if the number of hits per second could be very large? Does your design scale?| Report Duplicate | Flag | PURGE
Dropbox Software Engineer Algorithm - 3of 3 votes
AnswersDropBox Dec 2017
- aonecoding December 15, 2017 in United States
Congrats to Brian landing @DropBox
Dropbox always has the most responsive HR and gives review on the interview within a week. The canteen is also one of the best in Bay Area.
Phone:
LC: game of life
What if the board is huge?
Store in disk
with bitmap
Load into memory, process and write to disk row by row
Visit AONECODE.COM for private lessons by FB, Google and Uber engineers
Our ONE TO ONE class offers
SYSTEM DESIGN Courses (highly recommended for candidates of FB, LinkedIn, Amazon, Google & Uber etc.)
ALGORITHMS (conquer DP, Greedy, Graph, Advanced Algos & Clean Coding),
latest interview questions sorted by companies,
mock interviews.
Members get hired from G, U, FB, Amazon, LinkedIn, MS and other top-tier companies after weeks of training.
Email us aonecoding@gmail.com with any questions. Thanks!
Onsite:
Round 1:
Given an array of byte and a file name, find if the array of byte is in file.
Solution: Rolling hash
Round 2:
Given an Iterator of some photo with IDs, find the top K most hit photo IDs.
Follow up: What if the input is from a stream? When iterator reaches the end, moments later new hits can be added to the iterator. Modify code for this scenario.
Lunch was great.
Then came a demo round. Discussed Dropbox Paper| Report Duplicate | Flag | PURGE
Dropbox Software Engineer - 0of 0 votes
AnswersLets say we have to find a tallest line of the horizon from a given 2D array of the preprocessed image. The line starts at left most column of the Martrix and end at right most column of the matrix. To calculate the line you can only move left to right to 3 position, diagonally up , horizontally right and diagonally right i.e from a[i][j] you can move to a[i-1][j+1], a[i][j+1] and a[i+1][j+1].
- sachin323 December 02, 2017 in United States
When moving to the right we need to pick the highest value in the cell . We will do this for very row in column 0 i.e a[0][j] then we will pick the smallest value of the path we have got. The ans will the smallest of the all values we got from traversing all the path
I know this bit vague and I had hard time understanding the question but this what I understood
Lets say we have 3*3 array {{5,4,8}, {1,5,9}, {2,6,10}} . Now if we start from a[1][0] the possible path we can have
1 -> 6 -> 10 as we have to pick the highest value . Once we have this path we pick the smallest value on this path which is 1 . We repeat this for all rows in a[i][0] then among all those values pick the smallest one
Find the best line from the matrix.
I said we can do BFS to find best path but interviewer said time complexity of that is too high, need to do better than that.
Time complexity for BFS I think is Rows * 3^Colms as from any given cell we have 3 options to go to right (please confirm this as I not sure about it)| Report Duplicate | Flag | PURGE
Dropbox Software Engineer Algorithm - 1of 1 vote
AnswerGame of Death:
- praneeth.kapuganti July 07, 2017 in United States
Implement an algorithm that produces the next move in the game of death.
Basically given a two dimensional array it will have either values 1 (live cell) or 0 (dead cell)
1. A Live cell will live only if it has two or three live neighbors All other cases die.
2. A dead cell with exactly three live neighbors will live otherwise no change, dead
Transform the array by using above two rules| Report Duplicate | Flag | PURGE
Dropbox Software Engineer / Developer Algorithm - 0of 0 votes
Answers1) Given a file containing lines of chars, find if it contains "aaaaab\naaaaa" string pattern. Need to return true only if contains the EXACT pattern specified (observe the new line character).
- xankar March 10, 2017 in United States
2) How do you differentiate between actual new line and the new line character?
3) what if the file is way too big to bring it all in memory?| Report Duplicate | Flag | PURGE
Dropbox Backend Developer Algorithm - 1of 1 vote
AnswersWrite a program to find all duplicate files within a folder.
- sw May 08, 2016 in United States| Report Duplicate | Flag | PURGE
Dropbox SDE1 Algorithm - 2of 2 votes
AnswersYou are designing a system the records website visits. The interface for this system is:
- taylor.halliday April 26, 2016 in United States
void recordHit();
long getCount();
`getCount()` returns the amount of hits to the site for only the last 5 minutes.
Your task is to code `recordHit()` and `getCount()`| Report Duplicate | Flag | PURGE
Dropbox Software Engineer Algorithm - -1of 3 votes
Answerhow to calculate ncr%p where p is not a prime
- kanhaiya.yadav47 June 11, 2015 in United States| Report Duplicate | Flag | PURGE
Dropbox Algorithm - 0of 0 votes
AnswersThis is the screening question from Dropbox. I see it appear in other topics as the question in the interview. However I did not find a complete solution so I put my discussion here (http://www.capacode.com/?p=447) for your reference.
- truongkhanh March 02, 2015 in United States
Question: Given a pattern and a string, check whether the string matches the pattern. For example: pattern "aba" and the string is "redblackred" then it matches because "a" is translated to red and "b" is translated to "black". Note that for each character in the pattern, the translation is not empty and unique.| Report Duplicate | Flag | PURGE
Dropbox Software Engineer Algorithm