panoptic.biopower
- 0
0of 0 votes
AnswersLet's say you have to make changes to 1000 API's. For example, currently developers need to put a .then() just to write something to the screen; we want to remove this in simple cases, but also enable it in cases where you really do want to write something only AFTER some other action has taken place.
- panoptic.biopower on December 12, 2012 in United States for Windows Edit | Report Duplicate | Flag
These 1000 API's are split among 200 teams, and you're a product manager for one of those teams.
How do you go about pushing for this change, so that eventually all of them will be changed?
How long would it take? What is the deadline?
What if one team simply says they're far too busy?
And once the dev teams are done with the changes, what more is there to do? What should the testing team do?
Microsoft Intern - 10
0of 0 votes
AnswersGiven a list of words, return a list of lists, where each list contains a group of anagrams.
- panoptic.biopower on December 12, 2012 in United States Edit | Report Duplicate | Flag
Sample Input: cat bat act tab
Sample Output: [ [ cat, act ] , [ bat, tab ] ]
Jane Street Intern - 31
0of 0 votes
AnswersYou are given an input form such as the following
- panoptic.biopower on November 01, 2012 in United States Edit | Report Duplicate | Flag
(1, (2, 3), (4, (5, 6), 7))
Each element is either a number or a list (whose elements may also be numbers or other lists).
Output the numbers as they appear, stripped down into a single list.
E.G. (1, 2, 3, 4, 5, 6, 7)
(Complication - how does your code handle the case of ((((5)))) vs just ( 5 ) ? )
Facebook Intern Coding - 11
0of 0 votes
AnswersYou are given a string that is in roman numeral format.
- panoptic.biopower on November 01, 2012 in United States Edit | Report Duplicate | Flag
Output the integer representation.
E.G. You're given XIV
Output 14.
Facebook Intern Coding
This approach doesn't seem to be constant space. It's linear space - i.e. creating a new array that's within a constant of n, the length of the original array.
If the array isn't sorted, this cannot be done in linear time, so I'm assuming that the array is sorted.
Sorry I'm just a little confused by the question. Am I way off base here?
Yeah, I think this is what they were looking for. Thanks!
- panoptic.biopower on December 04, 2012 Edit | Flag View ReplyAs I said above, you do not get a string as an input
- panoptic.biopower on November 02, 2012 Edit | Flag View Reply
type 'a tree = | Leaf of 'a | Tree of 'a tree list let flatten tree = let rec aux root acc = match root with | [] -> acc | Leaf x::t -> aux t (x::acc) | Tree h::t -> aux t (aux h acc) in List.rev(aux tree []);; flatten [ Tree [ Leaf 1; Leaf 2 ; Tree [ Leaf 3 ; Tree [ Leaf 4 ]]]];;OCaml and other functional languages were made for this problem.
In a C program, I would use a qualified union, which is the alternative in an imperative language.
typedef struct _Tree { int tell; int branch_count; union _Data { int num; struct _Tree *branches; } Data; } Tree;}
- panoptic.biopower on December 14, 2012 Edit | Flag View ReplyI believe the size of the union is the size of the largest of its elements, where the union can only be one of the elements at any one time; hence, it can either be a pointer to its first branch, or it can be a leaf's data. The tell int determines if it is a leaf or a node with branches. If it does have branches, num_branches determines how many.