MUST KNOW junior role JAVA interview questions

Поделиться
HTML-код
  • Опубликовано: 8 июн 2024
  • 📚 courses.keeponcoding.io - Check out my courses!
    ⚡️ KeepOnCoding.io - Ace the coding interview
    Become a Member: ruclips.net/user/keeponcoding...
    Discord: / discord
    Comparator vs Comparable: • #95 Comparator vs Comp...
    0:00 Intro
    0:34 Full Java Course
    1:01 Method Overloading vs Overriding
    4:12 Heap vs Stack Memory
    6:19 Print Statement Code Snippet
    7:58 Shallow vs Deep Copy
    11:11 Garbage Collector
    12:58 Method vs Constructor
    14:44 this
    16:00 Abstract Class
    17:37 super
    19:52 Generics
    22:30 final
    24:21 protected
    26:35 equals() vs ==
    28:23 Pass by Value or Reference
    30:38 Singleton Class
    32:43 Composition
    35:15 static Block
    36:12 Remove from List
    37:09 ArrayLists
    38:53 Comparator vs Comparable
  • НаукаНаука

Комментарии • 87

  • @KeepOnCoding
    @KeepOnCoding  11 месяцев назад +5

    📚courses.keeponcoding.io - Check out my courses!

  • @Musa-lf5yn
    @Musa-lf5yn 11 месяцев назад +46

    Good job on this one! It would be great to see an advanced/intermediate JAVA interview questions.

  • @leohuang-5050
    @leohuang-5050 8 месяцев назад +22

    This example would be better in explaining deep copy(constructor method):
    public Example(Example original) {
    this.x= original.x;
    }
    Example example2 = new Example(example1);
    example2.x = 200;
    sout(example1.x);

  • @IAmNumbers561
    @IAmNumbers561 3 месяца назад +6

    This was really helpful. Thanks for making this.

  • @chrisstela
    @chrisstela 11 месяцев назад +4

    more videos like this please, I love it, thankyou!

  • @thanhhaiinh7465
    @thanhhaiinh7465 9 месяцев назад +2

    Thank you so much for sharing the valuable knowledge. I'm junior and I learned many thing from your video. Good job. It'd be great for junior developer

  • @kiddchaos-titans
    @kiddchaos-titans 7 месяцев назад +4

    We need a whole series on these

  • @evangelospoulios8061
    @evangelospoulios8061 8 месяцев назад +20

    Regarding protected keyword, sth that was not mentioned:
    The protected access modifier is accessible within the package. However, it can also accessible outside the package but through inheritance only.

    • @procode_procode
      @procode_procode 7 месяцев назад

      👍👍

    • @TheEsotericProgrammer
      @TheEsotericProgrammer 3 месяца назад

      Isn't that the same as default?

    • @the_cheesecake
      @the_cheesecake 3 месяца назад +3

      ​in video he told exactly about how default works
      protected is the same as default, but it is also accessable outside the package in inherited classes

    • @user-zc9gc6fx3g
      @user-zc9gc6fx3g Месяц назад

      ​@@TheEsotericProgrammer default cant be accessed thru inheritance

  • @bkr_vids
    @bkr_vids 7 месяцев назад +1

    I loved this video, thank you, super useful!

  • @wilddiscoveryzone
    @wilddiscoveryzone 8 месяцев назад +16

    You didn’t explain what is deep copy, you just crated a new object.
    But what if I want to create exactly the same copy of existing instance?

    • @leohuang-5050
      @leohuang-5050 8 месяцев назад +4

      Deep copy copies all the values ​​of the source object, so even if the value of the source object changes, the value of the copied object will not change.
      You can implement deep copy in these three ways:
      1. Using Cloneable interface and clone method. However, the deep copy in this way is limited. If the object contains other reference types, the copies of these reference types are still shallow copies.
      2. Using serialization and deserialization. Deep copying is achieved by converting an object to a byte stream and then back to an object from the byte stream. This method can handle all reference relationships of the object and ensure that the copied object is independent.
      3. Assign values ​​one by one in the constructor of the copied object
      Besides, you can use third-party libraries as well

  • @liliabekuzinaensosense8987
    @liliabekuzinaensosense8987 Месяц назад

    Wow! Thank you for showing the examples!

  • @pejko89
    @pejko89 9 месяцев назад +9

    The protected explanation is incorrect. Enemy and Ghost didn't have to be in the same package. Ghost could have accessed the protected name filed as long as it extends Enemy class. Your example would be correct with default modifier which is package-private.

  • @paulallen4622
    @paulallen4622 10 месяцев назад +8

    great job on this one - just noticed a slight nuance to observe. I think the default access modifier Eg no modifier will allow other classes inside the package to access the variables/methods but protected will only allow child classes which extends their parent class to access those variables/methods which are protected.

    • @davidblbulyan3077
      @davidblbulyan3077 8 месяцев назад +1

      Protected members also can be accessed from the same package, please read docs. It gives you access for protected members in the same package and for children, in the same or different packages.

    • @issambekkari1674
      @issambekkari1674 7 месяцев назад +2

      ​@@davidblbulyan3077 No they Actually can't, Only Subclasses of the class that has the protected attribute have access to that attribute, even if all the classes are in the same package.
      If you have a protected attribute inside a class A and you have a class B that extends A, and class C (which doesn't extend A) is in the same package as A and B, then class C will not be able to access the protected attribute of class A`.
      While using default makes class fields 'package-private' = Accessible to all classes within the same package but not outside of it.

    • @issambekkari1674
      @issambekkari1674 7 месяцев назад

      25:47

  • @markmahowald7866
    @markmahowald7866 Месяц назад

    I was a c# dev for 5 years but I’m interviewing for a Java position today. Thanks for the refresher!

  • @user-ht2bi3uo2y
    @user-ht2bi3uo2y 11 месяцев назад +2

    This was a really good video

  • @kzelmer
    @kzelmer 5 месяцев назад +4

    Seems like a great interview. I usually make similar questions to juniors. The problem comes with companies that basically make juniors grind leetcode like monkyes :_(

  • @AYJ959
    @AYJ959 10 месяцев назад +6

    You explained each concept in a very easy way thanks ☕more videos please🤩

  • @gsabella4
    @gsabella4 20 дней назад

    Great video brother.

  • @cpratham3
    @cpratham3 11 месяцев назад +1

    Good job, really helpful

  • @kyahAndoy
    @kyahAndoy 10 месяцев назад +3

    I have an upcoming interview and your explainations is so good.

  • @helloworld4788
    @helloworld4788 11 месяцев назад +1

    love it, more videos please

  • @esterdaci2008
    @esterdaci2008 3 месяца назад +1

    Please make a video of some more advanced questions...Very Good work

  • @younghercules4308
    @younghercules4308 5 месяцев назад

    Thank you!

  • @Forty3Stories
    @Forty3Stories 10 месяцев назад

    Good for Test Engineers too. Please mention in the description

  • @abhishekrbhat8919
    @abhishekrbhat8919 4 месяца назад

    Great video

  • @InVunter
    @InVunter 3 месяца назад

    Nowadays the default garbage collector is multithread, so it basically doesn't stop the app, it will stop really quickly each thread, but never all at once. Junior's doesn't have to know that, but it's always good to make it clear to all seniority, even tho threads are something kinda complex for entry-level devs xD (and basically we don't have good online material about that, no course is that advanced, and u mostly find things about it in books, mainly using C as example, I've even seen one in Assembly LoL)

  • @user-oh1ru9dd9b
    @user-oh1ru9dd9b Месяц назад

    very good

  • @mastershonobi110
    @mastershonobi110 11 месяцев назад +1

    Very noice. I don’t see the link to the other vid discussing “Comparator” etc.

    • @KeepOnCoding
      @KeepOnCoding  11 месяцев назад +2

      I added it to the description. Thank you.

    • @mastershonobi110
      @mastershonobi110 11 месяцев назад

      @@KeepOnCoding thank you. We appreciate your efforts and hard work creating these vids. 🙌🏿🙏🏾☺️

  • @alejandrospencio5524
    @alejandrospencio5524 6 месяцев назад

    Are u sure that stack space is fixed?

  • @gavinaren8534
    @gavinaren8534 6 месяцев назад

    Lifesaver

  • @thething6268
    @thething6268 11 месяцев назад +55

    lol ... i am definitely failing my next interview

  • @TigranMovsisyanTB
    @TigranMovsisyanTB 6 месяцев назад +1

    This is so easy, once I have applied to EPAM for Junior Position, their test was like 1500 times harder

    •  4 месяца назад

      Did you pass the interview? What kind of questions did they ask?

    • @TigranMovsisyanTB
      @TigranMovsisyanTB 4 месяца назад +1

      @ I didn't. It was java, spring and ds related questions. With a lot of codes for you answer if it will compile or not, what kind of exceptions it will throw, what output it will print and etc.

  • @shis10
    @shis10 11 месяцев назад +1

    Can you provide Timestamp ?

  • @mattstyles4283
    @mattstyles4283 5 месяцев назад +1

    8:00 this doesn't really explain what shallow and deep copies are. It's not a deep copy if you just create a new object and populate it manually. The default implementation of clone() on Object creates a new instance of that class with new references to the same referenced object fields of the original - this is a shallow copy. You can override clone() to create a deep copy by creating new referenced object fields. This way if anything changes in the referenced object fields it is only reflected in the new deep copy, not the original.

  • @shivamrai3959
    @shivamrai3959 10 месяцев назад +1

    Good

  • @icjay1793
    @icjay1793 5 месяцев назад

    can someone do me a favor what project application or any logical practice should I make I have basics knowledge on java and I just want to improved it by writing a code or a project :(

    • @jordyn.bagents
      @jordyn.bagents 4 месяца назад

      Hey, I’m looking to create a project also. Would you be interested in building something together?

  • @hamdamxudayberganov9788
    @hamdamxudayberganov9788 7 месяцев назад

    what is the name of the app he is using for list of questions?

  • @user-hx8wk9oe8o
    @user-hx8wk9oe8o 3 месяца назад

    Has Java not changed since 2015

  • @reshamsaharan1064
    @reshamsaharan1064 11 месяцев назад

    What's the experience range for a junior java developer. 0 - ?.

    • @rileydagloden
      @rileydagloden 10 месяцев назад +1

      Could be anything, i know Seniors with 3-4y experience, while there are juniors with 3y experience too. Keep learning 💪🏾

  • @user-qe2ij3jn5j
    @user-qe2ij3jn5j 5 месяцев назад

    Junior role In indian edtech company with employees

  • @Leemcioo
    @Leemcioo Месяц назад +2

    Actually, this video covers maybe like 20% of what content recruiters want us to know for a junior role. Pretty sad

    • @Leemcioo
      @Leemcioo Месяц назад

      How can you describing abstract class without saying even word about interfaces? Its the most asked question i think. Also this abstract description is covering max 20% of abstract topic. Nothing about inherritance of abstract classes, abstract methods etc, its really common tricky question

  • @carguy-xv2cl
    @carguy-xv2cl 8 месяцев назад +1

    To be fair I know senior developers that couldn't answer some of these.

    • @AngelGiurov
      @AngelGiurov Месяц назад +1

      I got interviewed by a senior developer who asked me a question that he thought he knew the answer to but ended up being wrong.
      After answering his questions he arrogantly tried to enforce his answer onto mine telling me I needed to check my information and that I'm wrong. After the interview I checked if his info was correct since I'm still learning after all and I might've messed it up. Turns out I was 100% correct.
      Tbh even these questions are only 1/5 of all the questions you must know for a junior level position nowadays.

    • @kacperk2201
      @kacperk2201 16 дней назад

      @@AngelGiurov what question was it exactly ?

    • @AngelGiurov
      @AngelGiurov 15 дней назад

      @@kacperk2201 "Is the finally block always executed ? Will it execute if an exception occurs?" Said yes but the answer somehow wasn't correct based on his information 🤣🤣

    • @kacperk2201
      @kacperk2201 15 дней назад

      @@AngelGiurov I mean it is designed to execute always, but in fact it can be omitted in rare circumstances, maybe that’s what he wanted to check with you, cheeky question. It might not execute for example if you terminate the system with system.exit or you run out of memory, or infinite loop in try block, so technically he was kinda correct. If an exception occurs “outofmemoryerror” it’s not gonna execute but kinda weird to ask such cheeky question for a junior dev.

    • @AngelGiurov
      @AngelGiurov 15 дней назад

      ​@@kacperk2201 I'm aware of when it won't execute so that's why I got mad at the answer. The java code executes line by line. So the only reason for why it won't reach the finally block is if the program itself stops or if we are in a infinite loop.
      If I was wrong it was 100% some corner case BS BUUUUUUT in this case I was correct. He asked specifically if it will execute if a exception occurs and it 100% does. But from his knowledge I was incorrect and instead of telling me why he said in a very angry but yet again passive aggressive voice "Check your information because you're incorrect". That's a FCKING SENIOR DEVELOPER.
      Now my first case also. My last interview for a junior position I was interviewed by two indians.
      The first interview which was a mistake and apparently they didn't see anything wrong with it was when I was supposed to do a full on code review for another junior developer. Had to learn how their code functioned, how it worked and leave 20-40 comments 😂😂😂😂.
      After the obvious fail because I am not a senior dev (the process instructions were for a senior dev) and after 2 hours total wasted they told me "yeah I don't think we were supposed to ask you that" so we scheduled another interview.
      Everything were more than great but got rejected because I forgot that you need to use "group by" when using aggregation and I didn't have experience with agile terminology.
      Also one of those indian interviewers wanted to dive deeper into mysql and asked me what kind of data structure it is. I simply forgot since it was a very long time ago since I was curious about it. I decided to ask him for the answer because I wanted to remember... He said "It's fine, I don't know it either". The market is absurd for juniors

  • @pythoknick
    @pythoknick 3 месяца назад +1

    Person hasa job... mine is set to false.

  • @RochaNahuel
    @RochaNahuel 8 месяцев назад +1

    La verdad que mas de una explicacion deja mucho que desear

  • @user-nr5tp2jo3u
    @user-nr5tp2jo3u 10 месяцев назад

    In Russia, it is, mildly speaking, insufficient to know even at trainee.

    • @ozan546
      @ozan546 9 месяцев назад

      What do you mean? Expectation is so high?

    • @user-nr5tp2jo3u
      @user-nr5tp2jo3u 9 месяцев назад +1

      @@ozan546 You must know much more than it was represented in the video.

    • @user-nr5tp2jo3u
      @user-nr5tp2jo3u 9 месяцев назад +2

      At trainee position, you must know perfectly
      - Java Core
      - JDBC
      - Spring (различное всякое говно)
      - Thymeleaf
      - XML
      - Паттерны проектирования
      - MVC
      - Hibernat
      - HTML
      - CSS
      - JS
      - БД
      - HTTP
      - JSON

    • @ozan546
      @ozan546 9 месяцев назад +1

      @@user-nr5tp2jo3u I understand. Good luck

    • @front-endpadavan4421
      @front-endpadavan4421 7 месяцев назад

      @@user-nr5tp2jo3u Agreed, but you forgot Docker, RabbitMQ/Kafka, AWS, Kubernetes, Maven/Gradle, JUnit5/Mockito, GIT

  • @chens4157
    @chens4157 10 месяцев назад +2

    Good for a JAVA tester, but way too easy for any JAVA Dev roles...

    • @avidreader6534
      @avidreader6534 9 месяцев назад

      what are good interview questions/concepts for Junior Java Dev Roles? I have almost 2 yrs of experience as java tester but its boring and the pay sucks

    • @randomstranger8326
      @randomstranger8326 5 месяцев назад

      yes they are very easy

  • @mikedelta658
    @mikedelta658 4 месяца назад

    Thank you!