You are trying to rob houses on a street. Each house has some +ve amount of cash. Your goal is to rob houses such that you maximize the total robbed amount. The constraint is once you rob a house you cannot rob a house adjascent to that house.
Software Interview Questions
550,499 software interview questions shared by candidates
I was asked a pretty straight forward brain teaser during my last phone interview, which they said they don't normally do, but because I put that I was a logical problem solver on my resume they couldn't resist the opportunity to. It was the following "There are 20 different socks of two types in a drawer in a completely dark room. What is the minimum number of socks you should grab to ensure you have a matching pair?"
You have 17 red and 17 blue balls, and you remove 2 at a time. If the two are the same colour, add in one extra blue ball. If they are different colours, add in an extra red ball. What colour is the final ball removed?
Given an array of numbers, nums, return an array of numbers products, where products[i] is the product of all nums[j], j != i. Input : [1, 2, 3, 4, 5] Output: [(2*3*4*5), (1*3*4*5), (1*2*4*5), (1*2*3*5), (1*2*3*4)] = [120, 60, 40, 30, 24] You must do this in O(N) without using division.
To find and return the common node of two linked lists merged into a 'Y' shape.
Suppose we can translate numbers into characters: 1->a, 2->b, ...26->z given an integer, for example, 11223, output every translation of the number.
Add two binary numbers (Input as a string)
Develop an algorithm for finding the shortest distance between two words in a document. After the phone interview is over, take a few hours to develop a working example in C++ and send it to the manager.
Een vraag. Schrijf een functie hoe je twee inputstrings kan detecteren die anagrammen zijn (een woord, fase, of naam geformeerd door het herschikken van de letters van een andere, zoals bioscoop, gemaakt door ijsman). Ze zullen van je vragen om het op de
Find the first index of the substring. Condition: Do not use java library function or regular expressions. And measure the performance of your implementation with the standard java library function. Examples: String 1: “abcdefg” String 2: “bcd” Should return 1 String 1: “abcdefg” String 2: “x” Should return -1
Viewing 71 - 80 interview questions