Month: June 2015
Problem: Implement producer consumer problem solution in Java. Producer consumer problem is basic multi-threading problem which will give idea about concurrency and inter-thread communication in Java. Producer produces items and …
Problem: How to print even and odd numbers using threads in Java? Two threads should be used to print numbers. One thread should print even numbers and other should print …
This is the basic question asked in any entry-level Java interview. Knowledge of threads is very important to be an efficient and good Java programmer. We will see how …
Problem: Given a matrix of -1’s and 0’s, display matrix which contains minimum distance to reach nearest 0 for that particular position. Example: Input matrix: -1 0 -1 -1 -1 …
Problem: Find number of customers who left without using a computer. This program was asked in makeMyTrip interview. Western union owns several cyber cafes. A research firm did an analysis …
Problem: Given a number, find next greater number with the same set of digits as original number. For example, if input number is 1234, then output should be 1243 if …