Przejdź do głównej zawartości

Learning by doing - Java - 50+ Interview Questions for Programmers

Learning by doing - Java - 50+ Interview Questions for Programmers



50+ Interview questions for 50+ days ? We will see ;) Risky resolution but method "learning by doing" is great!!

First are coming questions regarding Arrays:
  1. How do you find the missing number in a given integer array of 1 to 100? (solution)
  2. How do you find the duplicate number on a given integer array? (solution)
  3. How do you find the largest and smallest number in an unsorted integer array? (solution)
  4. How do you find all pairs of an integer array whose sum is equal to a given number? (solution)
  5. How do you find duplicate numbers in an array if it contains multiple duplicates? (solution)
  6. How are duplicates removed from a given array in Java? (solution)
  7. How is an integer array sorted in place using the quicksort algorithm? (solution)
  8. How do you remove duplicates from an array in place? (solution)
  9. How do you reverse an array in place in Java? (solution)
  10. How are duplicates removed from an array without using any library? (solution)

Komentarze

Popularne posty z tego bloga

Skrócony zapis if - instrukcja warunkowa java

Instrukcja warunkowa - warunek i rezultat. if (warunek) { jesli spełniony wykonań operacje i zwróć wynik; } warunek nie spełniony Możliwości skrócenia kodu instrukcji warunkowej if (i < 0) ? i-- : i++; Jeżeli i mniejsze od zera to i-- jezeli false to i++ if (i < 0) {     i--; } else {     i++; } Skrócony zapis instrukcji warunkowej else if (i < 0) ? i--;  inna_zmienna=4; : i++; if (i < 0) {     i--; } else {     i++;     inna_zmienna = 4; } Skrócony zapis if

Runnable and Call able - Java rekrutacja

Runnable - interfejs zawierający metode run() - obiekt implementujący tą metodę tworzy wątek thread public interface Runnable The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run. This interface is designed to provide a common protocol for objects that wish to execute code while they are active. For example, Runnable is implemented by class Thread. Being active simply means that a thread has been started and has not yet been stopped.  In addition, Runnable provides the means for a class to be active while not subclassing Thread. A class that implements Runnable can run without subclassing Thread by instantiating a Thread instance and passing itself in as the target. In most cases, the Runnable interface should be used if you are only planning to override the run() method and no other Thread methods. This is important because classes should not be subclas...

wait and notify() Methods in Java - rekrutacja

Synchronizacja wątków. Procesor może wykonywać wiele zadań jednoczenśnie - concurrent software. Java wspiera współbieżność jest potrzebna synchronizacja ponieważ różne wątki threads mogą w tym samym czasie usiłować zmodyfikować ten sam zasób jeśli nie są zarządzane poprawinie. Object.wait() - zawiesza wątek - thread suspension Object.notify() - wznów wątek - thread wake up Object.notifyAll() - wznowienie wszystkich wątków