Two Sigma Interview Questions
- 0of 0 votes
Answerstext = 'ABCDEFGHIJ'
- allen zhao August 24, 2020 in United States
output = '"A""| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer Problem Solving - 0of 0 votes
AnswersRegex matching algorithms
- sonesh May 08, 2017 in United States
You will be given a string and a pattern string consisting of only '*','?', and small letters. You have to return tree or false based upon the comparisons.
? repersent one char.
* means zero or n number of char for any positive n.
Example
abc, a?c : true
abc, a*?c : true
abc, * : true
abc, ?c : false| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersYou are given following design architecture.
[DB] <==> [Server]
Now let's say user are complaining about our server being slow, how would you figure out where is the problem?
- sonesh May 08, 2017 in United States
2) now let's say the problem is in server, where do you think the problem is in server?
3) What if you found our server is fast, how about now?
4) you have also found that the network call from server to DB is also fast, how about now?
5) Lets say, our server is also setting near the complaining user, how about now?| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer design - 0of 0 votes
AnswersYou are given two Queues where each queue contains timestamp price pair. You have to print <price1 price 2> pair for all those timestamps where abs(ts1-ts2) <= 1 second where ts1 and price1 are the from the first queue and ts2 and price2 are from the second queue.
- sonesh May 08, 2017 in United States
Now let's say one queue is slow, what kind of modification you will make?| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Stacks q - 0of 0 votes
AnswersYou are given an array of nodes where each node consists of node name, isValid flag, and parent Node index. so, this array actually represents a tree(forest). where root node has -1 as its index for the parent node. rest all node have their parent's index value.
- sonesh May 08, 2017 in United States
You will be given this array and an index. You have to cut down the subtree from the index. Cutting down a tree means, making all the nodes of that subtree false(Isvalid flag).
He was expecting O(N) solution.| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Arrays Coding Trees and Graphs - 0of 0 votes
AnswersDefine Reverse Polish notation calculator. Interviewer needed class design for the calculator. Please make sure that adding extra operator tomorrow should not make us change the class or any of its methods.
- sonesh May 08, 2017 in United States| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer design - 0of 0 votes
AnswerQ 7. You are getting a stream of integers, You have to find the median of these in real time(or with minimum complexity).
- sonesh April 26, 2017 in United States| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Algorithm - 0of 0 votes
AnswersTheoretical Questions
- sonesh April 26, 2017 in United States
Q 1. Any design patterns you have used, please explain in details
Q 2. Difference between a process and a thread
Q 3. How threads/processes can communicate with each other.
Q 4. What is latency and throughput, what is there the difference?
Q 5. When to use merge sort over quick sort and vice-versa.
Q 6. What is hashmap, how would to implement one.| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Brain Storming technical - 0of 0 votes
AnswersYou are given an array of words. from each word, you make a chain, in that, you remove one char at a time and you remove that char only when the remaining word is present in the input array.
- sonesh April 18, 2017 in United States
For Example, if the input is {a, b, ab, ac, aba}
then the possible chains are
from 'a', there is no chain, the chain it 'a' itself (of length 1)
similarly, from 'b', the chain length is 1 one (length is defined by the number of words in the chain)
now from 'ab', there are two possibilities which are ({ab -> b when you remove a},{ab -> a when you remove b}). So the max length is 2 here
now from 'ac', we only have one possibility which is ({ac -> a when we remove c}), because, when we remove 'a', we left with 'c' which is not present in the input.
Now, you have to find the length of the biggest such chain.
Input: array of words
Output: length of the biggest such chain.| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Algorithm String Manipulation - 0of 0 votes
AnswersFriends have transitive property where if A is the friend of B, and B is the friend of C then A is also the friend to C. Like that we make friend circle.
- sonesh April 18, 2017 in United States
You have to find the number of such circles in a given list of friends
You are given a NxN matrix, where columns of each row will have either 'N' or 'Y', where 'N' represents not a friend and 'Y' represents Yes, they are friends.
Example :
YNY
NYN
YNY
The output is 2({0,2},{1}), as the 0 and 2 are friends of each other and 1 is another friend who is neither friend with 0 nor with 2.| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Graphics - 0of 0 votes
AnswerGoogle is going to provide an over-the-wire service that the phone companies can use. This over-the-wire protocol will support three operations:
- Steve September 06, 2012 in United States
(1) void I_GAVE_OUT(n) -- the phone company is telling us that it handed out phone number (n).
(2) bool IS_TAKEN_(n) -- we are telling the phone company whether (n) is taken.
(3) number GIVE_ME_ONE() - the phone company is letting us tell them what number to hand out next.| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer Data Structures - 0of 0 votes
AnswersCompare pangrams with string and find missing letters.
- xyzz October 22, 2010| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer C - 0of 0 votes
AnswersProvide animation of particles in string format.
- xyzz October 22, 2010| Report Duplicate | Flag | PURGE
Two Sigma Software Engineer / Developer C