Programming Interview Questions | Glassdoor

Programming Interview Questions


interview questions shared by candidates

Programming Interview Questions

Sort: Relevance Popular Date

What is your current employer doing better than we are? I work in marketing so I had to answer based on my research done prior to interview. I was so happy I did a ton of research/comparison before going in.

1 Answer

They do a better job of promoting and communicating their programs.

Number of 1's in binary representation of integer?

12 Answers

Implement a function to validate whether a given binary tree is a BST (i.e. write an isBST() function).

9 Answers

Write a function that divides two numbers without using the divide '/' operator.

10 Answers

List all anagrams in a file. Assumptions: case-insensitive, a-z characters only, one word per line. For example, if the file contains dog, cat, ddd, goo, act, god -- output dog, god, act, cat

10 Answers

Given a string find the first non-repeated character.

10 Answers

Given a matrix print it clockwise from the first element to the very inner element.

6 Answers

You are given an array with n positive integers where all values in the array are repeated except for one. Return the one that is not repeated.

7 Answers

You are given an integer N and an integer M. You are supposed to write a method void findBestCoinsThatMinimizeAverage(int N, int M) that prints the best collection of N coins that minimize the average number of minimum coins needed to generate values from 1 to M. So, if M = 100, and N = 4, then if we use the set {1, 5, 10, 25} to generate each value from 1 to 100, so that for each value the number of coins are minimized, i.e. 1 = 1 (1 coin), 2 = 1 + 1 (2 coins),..., 6 = 1 + 5 (2 coins), ..., 24 = 5 + 5 + 5 + 5 + 1 + 1 + 1 + 1 (8 coins), and we take the average of these coins, we would see that the average comes out to ~5.7. But if we instead use {1, 5, 18, 25}, the average would come out to be 3.7. We are to find that set of N coins, and print them, that produce the minimum average.

8 Answers

Assume that you are given the head and tail pointers of a doubly linked list where each node can also have a single child pointer to another similar doubly linked list. There are no cycles in this structure outside of the traditional double links. Write a procedure in C++ that flattens this structure into a single list.

7 Answers
110 of 216 Interview Questions