rodrigoreis22
BAN USER- 1of 1 vote
AnswersWrite a program to sum two binary numbers represented as strings.
- rodrigoreis22 in United States
Input: "110", "01101"
Output: "10011"
Method signature:
public String addBinaryNumbers(String num1, String num2);| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 2of 2 votes
AnswersHow to detect cycles in a graph?
- rodrigoreis22 in United States
Don't need to write code, just your idea and complexity.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersChange the structure of a Tree node to hold a pointer for the next in-order element (sucessor).
- rodrigoreis22 in United States
Given a Binary Search Tree.. transform it on a LinkedList by setting the next pointer described above.
Maybe this is a duplicate question.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Trees and Graphs - 0of 0 votes
AnswersImplement a shared int pointer in C++ (SharedIntPtr).. the use would be like this:
SharedIntPtr a(new int); // reference count 1; SharedIntPtr b(a); // reference count 2; *a = 2; cout << *b; // "2"; a.reset(); // reference count -> 1 *a // <- NULL b.reset(); // reference count ->0 , object is deleted.
There is also this reference count which tells how many references do you have.
- rodrigoreis22 in United States
And the question was: Implement SharedIntPtr, constructors and reset().| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersHow would you implement an infinite counter?
- rodrigoreis22 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 0 votes
AnswersIntersection of two lists of unsorted integers.
- rodrigoreis22 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm
I understand that DRYing the code is making it more cleaner
- rodrigoreis22 February 11, 2013Was this interview in-person or phone?
- rodrigoreis22 February 03, 2013What is the variable pos in this line:
if dp[pos] == true:
I didn't understand this code, could you please provide full code?
- rodrigoreis22 February 03, 2013for the sentence thereisastoneontheroad when you reach the 3rd character ('e') you have a good word ('the') and the rest ('reisastoneontheroad') is not a well formed word.. in this case you should keep trying.
- rodrigoreis22 February 02, 2013What if the question was asking about 3 numbers that sum to a given number?
- rodrigoreis22 January 22, 2013Don't you have to check first if the tree is a binary tree.. and then check if it's a BST? Maybe the tree isn't binary tree.
- rodrigoreis22 January 22, 2013
- rodrigoreis22 February 11, 2013