You are on page 1of 1

List of problems - old tests

1. Write a program which for passed list of integers prints out distinct values and their counts (i.e. for the
list 1 3 5 3 7 3 1 1 5 prints 1(3) 3 (3) 5(2) 7 (1)).
2. Write a function that prints out a breakdown of an integer into a sum of numbers that have just one nonzero digit. For example, given 43018 it should print 40000 + 3000 + 10 +8.
3. Write a program to find out 5000th number in the Fibonacci series is a mathematical series, where each
number is sum of previous two numbers e.g. 1, 1, 2, 3, 5, 8, 13, 21...
4. Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of
the number and for the multiples of five print Buzz. For numbers which are multiples of both three and
five print Fizz Buzz.

New problems
1. Write a program that reads a decimal number and presents its binary representation.
2. Write a program that counts words in text file. The words are separated by space and new line. Solve the
problem of successive spaces and new lines.
3. Write a program that parses error log file error_log.txt and reports how many error entries are logged
between 20 and 21 hours.

Java Interview Programs


http://www.java2novice.com/java-interview-programs/

You might also like