JavaRush /Java Blog /Random EN /23 frequently asked interview questions
Юрий Кузнецов
Level 35
Москва

23 frequently asked interview questions

Published in the Random EN group
I'll quickly tell you about myself. I am 25 years old, born in Crimea, Feodosia. He studied at the city technical school, then entered Kharkov, received a bachelor's degree and returned home in 2014. In 2014, I entered correspondence studies for a master’s degree (all specialties were somehow related to programming), and in 2015, I entered the army for contract service for a period of 3 years. After two years of military service, I realized that I needed to change something in my life... 23 questions frequently asked during interviews - 1And then I came across JavaRush in December 2017, and I began to persistently learn Java. In the summer I attend Topjava courses with Grigory, start taking each of his classes, and by mid-September the three-month course should have ended. In general, at the beginning of September I am moving to Moscow with my wife to look for a job as a Java programmer and have completed about 10 interviews to date. I will write to you what they constantly ask and questions that I have been bombarded with.
  1. What is JDK, JRE, JVM and compiler. This is a must have. If you are asked this question at an interview and you do not answer it, most likely they will not ask anything further. Small video from youtube

  2. Object-oriented programming (OOP). The main thing here is to tell you what polymorphism is. They may ask you to translate this word, then you need to tell its definition accordingly. You can tell everything in your own words. Then give your examples.

    Add. literature: Polymorphism

    Video: Introduction to OOP

  3. Multiple inheritance in Java. Java does not allow multiple inheritance of classes, but allows multiple inheritance of interfaces. About inheritance

  4. Methods of the Object class (it is advisable to look at each method directly in the code itself and pay attention to Equals and hashCode). I called it like this: getClass, finallize (read about it, you never know how many people will ask the question, but remember: in my opinion, THIS IS A CRUTCH), wait (it’s enough to know that there are 3 overloaded methods) notify, notifyAll, equals and hashcode (required!! !know the 4 rules of equals and be sure to know the law between equals and hashCode).

    Object Java

  5. JVM from the inside. Stack and Heap memory.

    Memory

  6. What is the new keyword and how does it work. I didn’t find the material, but they asked me about it, or rather, when we write for example

    A a = new A()

    what happens before equals and after equals?

    Before equal, we create a link, and after equal, we create a new object using the new keyword, which is placed in Heap memory as a set of bytes. (If I’m wrong, then please correct me)

  7. The work of Garbage Collection - they didn’t ask very often, but when they asked, they started digging, as far as I know this topic. Great article here

  8. Order of initialization of fields of parent and child classes

  9. Collections: I had to explain absolutely the entire hierarchy and work of each collection.

    The question is what is the difference between List and Set. The most important thing is to say what the List interface is. If you answer that Set is a collection of unique objects, that won't be enough.

    HashMap, HashSet - initial size; capacity, loadfactory, null allowed or not? How is the cell for an object calculated when working with a Hash collection? The difference between HashMap and TreeMap (it is not enough to say that TreeMap is a sorted collection, according to the red-black tree algorithm). Know the insertion, deletion, search algorithms for each collection. Queue, Deque, Stack - I was rarely asked questions about them. You need to know where the interface is and where the classes are in collections.

    23 questions frequently asked during interviews - 2

    Note that Collections has an Iterable parent

    link from our member)

  10. Java 8. Absolutely make the most of everything you know about the “innovations” released 4 years ago : here is the source New in Java 8

    They asked me about consumers, function, etc., then they asked about functional interfaces, then they asked me how to create my own annotation, which means, for example, @SomeAnnotation (name = .... count =....), namely, what is name, count and how do they work when creating your annotation.

  11. Generics . All about generics. They ask everywhere.

    Generics

  12. Threads . Thread, Runnable, what is the difference, how to start a thread. It's all about synchronization. Mutexes, monitors, Lock class. Deadlock when it occurs, give those examples.

  13. Hierarchy of checked/unchecked exceptions, write your own exception class.

    23 questions frequently asked during interviews - 3
  14. Final , finallize(again), immutable , finally . When the finally block fails.

  15. How to prohibit class inheritance (private constructors, final class...).

  16. IO/NIO streams.

  17. PATTERNS . Learn at least 5 basic ones (mvc, factory, decorator, singleton, observer).

  18. Spring ioc, di, ioc - container. Here's a link to some practical insight that helped me a lot... SPRING . Here I went through the spring until chapter 16, writing all the code by hand. I advise you to do the same.

  19. Maven -> profiles, artifacts, war, jar... scope types. What parameters should be set when connecting libraries.

    MAVEN

  20. What is ORM? How does it work? (easy answer).

    Hibernate: how it communicates with the database, which should be required when creating an Entity class. Session. 3 levels of caching - know. How to link a table and an entity class. Contacts:

    Many to many, one to many, etc.

    If we have a connection, for example, User who has a lot of Book. What the field in the User class and the field in the Book class will look like (this is where the many-to-one and one-to-many annotations are indicated above the fields).

    What is JPA, how is it related to Hiber. JPAQL.

    Hibernate

  21. The next question will be about SQL. Queries that you know what you have used. JOIN - external, internal, left, right.

    sql

    Problem from a company: 2 tables are given, department and employee. Here's an example .

  22. Horizontal scaling .

    A short video on vertical and horizontal scaling
  23. A little html, css, js.

  24. Git. Working in the console. commit, push, what is the difference between fetch and pull.

Finally, I advise you to read this list of questions and look for answers yourself (download the “Google” skill) and write code to fix it. PS: this is my first article, so in any case there will be shortcomings, write, I will be very glad to receive comments. Further reading, if this is not enough for you:
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION