Requirements gathering Does the array allow duplicates? If duplicates are allowed, then do you need to report duplicates? For example, in {2,4, 6, 3, 6, 5}, is 6 or 5 the …
Requirements gathering Does the array allow duplicates? If duplicates are allowed, then do you need to report duplicates? For example, in {2,4, 6, 3, 6, 5}, is 6 or 5 the …
A trivial coding example (i.e. a Calculator) tackled using the following programming paradigms in Java not only to perform well in coding interviews, but also to learn these programming paradigms.
Approach …
Java coding questions are very common in job interviews. Good coding skills are essentials for passing the peer code reviews with flying colors. Here are 17 coding tips with Java examples.…
Q1. Can you write a function to determine the nth Fibonacci number? The Fibonacci numbers under 2000 are : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …
Complimenting Fibonacci number coding – iterative and recursive approach, we can improve performance by caching. If you run this
Q1. Given an array of integers, find two numbers such that they add up to a specific target number? For example, Given numbers: {2, 3, 8, 7, 5} Target number: 9 …
Pseudocode 1) Precodnition check for null or empty input. 2) Loop throught the input string, and store each “character” as a key in a map with the value being the “character …
Q. Can you write code to identify missing numbers in a given array of numbers?
Solution 1: Assuming that the given numbers are in order
Q. Can you write code to output the perfect number between a given range? Definition: A perfect number is a positive integer that is equal to the sum of its proper …
Q1. Write a program that prints numbers from 1 to 30, but for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For …
Q1. Can you write Java code to generate random numbers between a given range? A1. E.g. 0 and 9 or 5 to 35, and so on.
This is a very decent coding exercise to sharpen your coding skills. Nicely explained with diagrams and complete code. Q1. What is Huffman coding? A1. Huffman coding is a compression technique …
Q1. Can you write a sample code that will count the number of “A”s in a given text “AAA rating“? Show both iterative and recursive approaches?
A1.…