N pots, each with some number of gold coins, are arranged in a line. You are playing a game against another player. You take turns picking a pot of gold. You may pick a pot from either end of the line, remove the pot, and keep the gold pieces. The player with the most gold at the end wins. Develop a strategy for playing this game.
Programmer Intern Interview Questions
715,910 programmer intern interview questions shared by candidates
Capitalize 2nd, 4th, 8th, 16th, … letters in a string input : letters in a string output: lEtTers in a stRing
Two trains traveling in the opposite direction with x and y miles per hour , they are 100 miles apart.Where would they meet ? formula?
Consider the following function: int f (int num) { int out = 0; for (; num > 0; num /= 10) { int d = num % 10; out *= 10; out += d; } return out; } 1) What does it do? 2) Write the same algorithm using recursion
Reverse an integer using C.
Can't remember the details, but was asked a question regarding dropping eggs off high buildings to determine the height at which an egg would first break.
There are 25 horses, and each runs at different constant speeds. If you want to find the 5 fastest horses, what is the minimum number of races needed, if each race can have five horses at most?
Find if given text does have matching [ { ( opening and closing. So ({[]}) is valid and ({)} is invalid. They should open and close in proper order.
How would you sort the list of version numbers. For eg: You are given a list A as ["1.1","1.1.5","12.0","1.23","12.3"]. Now sort this ?
If you have 2 coins in your pocket (one is double-headed, and the other is a fair coin), you grab a random coin from your pocket and see that one face is a head. What is the probability that if you flip the coin, the other face is also a head (i.e. that you picked the double-headed coin)?
Viewing 681 - 690 interview questions