Learned or Solved Something Today?

Dump it here! Let others learn from you

Showing 8 of 8 from page 1

metabox posted in #java #codingchallenge #facebook #interviewquestion

Checking subset sum | Facebook Interview Question & Solution

This problem was asked by Facebook. Given a multiset of integers, return whether it can be partitioned into two subsets whose sums are the same. For example, given the multiset  15, 5, 20, 10, 35, 15,

metabox posted in #java #codingchallenge #interviewquestion #facebook

Non-decreasing Array | Facebook Interview Question & Solution

This problem was asked by Facebook. Given an array of integers, write a function to determine whether the array could become non decreasing by modifying at most 1 element. For example, given the array

metabox posted in #java #codingchallenge #interviewquestion #facebook

Get number using bit math operations | Facebook Interview Question & Solution

This problem was asked by Facebook. Given three 32 bit integers x, y, and b, return x if b is 1 and y if b is 0, using only mathematical or bit operations. You can assume b can only be 1 or 0. Idea be

metabox posted in #javascript #codingchallenge #interviewquestion #facebook

[Solution] Matrix-num-paths | Facebook Interview Question

This problem was asked by Facebook. There is an N by M matrix of zeroes. Given N and M, write a function to count the number of ways of starting at the top left corner and getting to the bottom right 

metabox posted in #java #codingchallenge #facebook #interviewquestion

[Solution] numbers-sum-to-k | Facebook Interview Question

This problem was recently asked by Facebook You are given a list of numbers, and a target number k. Return whether or not there are two numbers in the list that add up to k. Example Given  4, 7, 1 , 3

metabox posted in #java #codingchallenge #facebook #interviewquestion

[Solution] Longest-Sequence-With-2-Numbers | Facebook Interview Question

This problem was recently asked by Facebook Given a sequence of numbers, find the longest sequence that contains only 2 unique numbers. Example Input   1, 3, 5, 3, 1, 3, 1, 5  Output  4 The longest se

metabox posted in #javascript #codingchallenge #facebook #interviewquestion

[Solution] Best-Multiply-In-Array | Facebook Interview Question

This problem was asked by Facebook. Given a list of integers, return the largest product that can be made by multiplying any three integers. For example, if the list is  10, 10, 5, 2 , we should retur

metabox posted in #javascript #facebook #interviewquestion #codingchallenge

[Solution] Best-Buy-Sell-Price | Facebook Interview Question

This problem was asked by Facebook. Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made

fb