FizzBuzz is a fun game mostly played in elementary school. The rules are simple: when your turn arrives, you say the next number. However, if that number is a multiple of five, you should say the word “fizz” (preferably with a French accent) instead. If the number is a multiple of seven, you should say […]
A commonly asked puzzle at Java interviews is – find the missing number from a series or array of numbers. This puzzle has been asked in Amazon.com. In this Java puzzle, you have a series of numbers start (e.g. 1….N) and exactly one number in this series is missing. You have to write a java […]
Writing a program to calculate factorial in java – can be a coding exercise during java interviews. It’s always better to have idea of how to build such factorial program. Let’s go through such three ways: 1) Calculate Factorial Using Iteration Simple and most basic version. Good to know but not right to use for […]
Learn to write Java program to reverse a String. We will first see how to reverse string and the we will also see how to reverse the words in String.
Algorithm: given a list of strings, return all the strings with the nth longest length in that list for example: list – Yuri, Ron, Interview, Longest, List, Contain and nth = 1 will return just “Interview” whereas nth = 2 will return both “Longest” and “Contain”. Though solution to “How to find the kth largest […]