Cognizant Java Coding Interview | Second Round | Java Developer Interview

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024
  • Cognizant Java Coding Interview | Second Round | Java Developer Interview
    Social Links:
    Insta: / ashwani_a_j
    Linkedin: / ashwani-kumar-7b986a14b
    Telegram Channel: t.me/JavaGenie
    About Video:
    In this video, we have covered all the questions asked to me in the recent cognizant interview.
    Do let me know in the comments section about what else you would like to see on this channel. Your feedback matters a lot! If you have any questions please comment down below.
    Publicis Sapient Interview Process: • Publicis Sapient Inter...
    EPAM Interview Process: • EPAM Interview Process...
    Placement Roadmap: • Placement Roadmap For ...
    My Experience at Cognizant: • My Experience at Cogni...
    About this video:
    In this video, we will talk about your fir salary
    Please leave a LIKE and SUBSCRIBE for more content!
    ⭐ Tags ⭐
    ✅ Hashtags ✅
    #cognizantinterview | #javadeveloper | #codinginterview
    Important Videos:
    ✅ Microservices with real-time project: • Microservices with rea...
    ✅ GraphQl In one video: • GraphQL In One Video |...
    ✅ Keycloak With Spring Boot: • Keycloak with Spring B...
    ✅ EPAM Interview Process: • EPAM Interview Process...
    ✅ Cognizant Experience part-1: • My Experience at Cogni...
    ✅ Spring Security Introduction: • Spring Security Tutori...
    ✅ Spring Security Internal working: • Spring Security Tutori...
    ✅ Changing default behavior of spring security: • Spring Security Tutori...
    ✅ what is ci cd pipeline: • ci cd pipeline| DevOps...
    ✅ what is scrum and sprint in the agile model: • What is Scrum in Softw...
    ✅ learn docker in 1 hour: • Docker Tutorial for Be...
    ✅ complete spring data jpa tutorial: • Spring Data JPA in 1 v...
    ✅ debugging in eclipse java with source code: • Eclipse debugging tech...
    ✅ oop interview questions and answers: • OOPS Interview Questio...
    Important playlists :
    ✅ Spring Security Tutorial: • Spring Security Tutori...
    ✅ Microservices full course playlist: • Microservices full cou...
    ✅ java 8 features: • JAVA 8 NEW FEATURES
    ✅ Building a Medicine Management app with Spring Boot and Java: • Building a Medicine Ma...
    ✅ Linux tutorial: • UNIX | LINUX Shell Scr...
    ✅ spring boot interview questions: • Spring Boot Interview ...
    cognizant Java Coding Interview | Second Round | Java Developer Interview

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

  • @mrcoder9401
    @mrcoder9401 Год назад +96

    Interviewer: Is this your final answer?
    Buffalo in the background : AAAAAN, yesssss.

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

    To those who didnt understand the last question,basically they give you an array of string numbers and you have to rearrange the elements inside such that it makes the largest number possible with that combination. So '9''5''34''3''30' is the largest one possible, 330>303 hence that last change.Pretty interesting and tricky question.

    • @theanimemanofindia8036
      @theanimemanofindia8036 8 месяцев назад +7

      It's a mock interview of some institute 2 year experience might not build logic that quickly 😅

    • @zeezinc7
      @zeezinc7 8 месяцев назад +13

      @@theanimemanofindia8036 i myself am 2yrs exp bro 💀 i needed to watch it 4-5 times to understand properly😵

    • @theanimemanofindia8036
      @theanimemanofindia8036 8 месяцев назад +3

      @@zeezinc7 yeah 💯 bro I had 1 year experience but only able to build logic, output is still wrong after 9th time😅

    • @zeezinc7
      @zeezinc7 8 месяцев назад +3

      @@theanimemanofindia8036 keep at it, i dont even know how to write logic coz i never practiced dsa, but i just understood the question 🤣

    • @theanimemanofindia8036
      @theanimemanofindia8036 8 месяцев назад

      @@zeezinc7 what are you doing now like job or study?

  • @vsaihruthikreddy7127
    @vsaihruthikreddy7127 5 месяцев назад +2

    There is an edge case with the largest number code now if you have 0 and 0 in the string this will print “00” and not “0” if interviewer specifically asks for “0” and not “00” as output then I believe we can add that case after sorting the string array

  • @beingSenpai
    @beingSenpai 10 месяцев назад +11

    last question we can do digit sort which takes O(D*N) your approach take O(N*N)
    D = size of largest length string
    N = size of array

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

    Present companies....
    Asking easy questions to experienced candidates..
    Tough questions to fresher candidates....😢

    • @ShubhamKumar-pe3dt
      @ShubhamKumar-pe3dt 7 месяцев назад

      Diya hai kya interview experienced candidate ke liye? 4-5 round karaate hain uske baad bolte hain salary is out of budget.

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

      @@ShubhamKumar-pe3dt I'm a fresher bro, attended 20+ interviews still jobless....I have lot of skills, technically strong....
      But, companies are playing games for hiring freshers...

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

      @@mahesh0371konsa mern stack mei kr rhe ho apply?

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

      @@unkownindian11 full stack Dot net development

  • @nagunagu229
    @nagunagu229 8 месяцев назад +6

    if(ans==yes){
    print("aooooo");
    }
    😅 buffalo in background 😅

  • @jaswanthreddy7135
    @jaswanthreddy7135 7 месяцев назад +8

    Range of integer is not -127 to 128 FYI that is for byte hence this mock interview is useless.

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

      Usually == checks for memeory references in case of objects and value in the case of primitive variables.
      But here is a twist that for Integer objects, JVM use cache for values from -128 to 127. Thus, the program will return true both times. But if we use any value higher than 127 the if loop will execute the else condition.

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

    first question answer should be num1== num2 num3==num4 because it is not in byte and byte has -127 to 128 range not integer please correct me if wrong.

  • @SurajRoy
    @SurajRoy 8 месяцев назад +15

    For last 5 years I am working as a fullstack webdeveloper in different govt. undertaking projects (Contractual post) and using jsp, springboot, core php, android app, mysql, PostgreSQL. But I can't answer a single question from these (though I understand logic of these answers after explanation) ........ Can anybody explain why ? (I think these can be answered by someone who is more connected to theories and studies or a fresher who is just completed his graduation)

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

      I too was asked these type of o/p prediction questions. Though these are very basic I was not able to answer few of them. I think constant practising of 5-6 qsts like this will help..!! :)

    • @pragadeesh9044
      @pragadeesh9044 8 месяцев назад +2

      Thanks for posting this question. I too had the same feeling and scared a bit.

    • @HR-pz7ts
      @HR-pz7ts 8 месяцев назад +2

      I could answer all of these except the last one although I understood the logic completely. It's because I'm a little rusty in DSA I'll continue it as soon as I'm done with servlets and jsp.

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

      while practicing , understanding each and every line you code, why and how it is happening internally will surely help

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

      ​@@anoysantra9851🎉

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

    @11:56 alternate answer String answer = nums.stream().sorted((o1, o2) -> (o2+o1).compareTo(o1+o2) ).collect(Collectors.joining(""));

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

    question1 -
    demo class - 500 is a whole number that can be written without a fractional so output would be
    num1==num2
    num3 == num4 correct ?

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

      from integers within the range -128 to 127 will be stored in cache by JVM (so 100 will be in JVM cache and same memory reference is assigned to num1,num2) ,out side of this range will be stored in Heap memory(num3 and num4 will point to different 500 objects).

  • @adnanraza1838
    @adnanraza1838 2 года назад +11

    Nailed it bro🔥

  • @aabhasjain96
    @aabhasjain96 8 месяцев назад +7

    Can someone please explain the logic behind last question ?

  • @SelvaKumar-xv9eb
    @SelvaKumar-xv9eb 8 месяцев назад +7

    does cognizant only goes for python developers??? is this java coding interview or an coding interview where we can solve in diff languages??

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

    2nd question answer is not correct..everything would print from base class as DoPrint method taking reference as Base class.

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

      Nah bro, he is right, that's called upcasting. Where obj can call all the overridden methods of derived class

  • @vlog_with_SK
    @vlog_with_SK 8 месяцев назад +4

    😂😂 what !! Is it really 2 yr experience interview.even I can solve it as a fresher.

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

      Bhai fresher ke liye hi zyada easy hai... experienced ke liye tough, and I have a logic too... experienced ppl mostly work in projects with some framework where we dont need these concepts in such depth... it just vanishes with time, that's why it becomes challenging for an experienced guy

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

    Good job bro 🎉🎉🎉🎉

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

    I got placed in both Cognizant and Deloitte. Thank you.

  • @saicharanmiriyala4985
    @saicharanmiriyala4985 8 месяцев назад +5

    In First question, Integer range is not -127 to 128 right, it a range of byte

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

      I also didnt get 1st one

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

      Huh

    • @ophirfernandes3869
      @ophirfernandes3869 7 месяцев назад +3

      We always thought that whenever two object references are compared using “==”, it always evaluates to “false”. But here Integer caching changes the results.Integer class has a caching range of -128 to 127. Whenever a number is between this range and autoboxing is used, it assigns the same reference. That’s why for value 100, both num1 and num2 will have the same reference, but for the value 500 (not in the range of -128 to 127), num3 and num4 will have different reference.

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

      I thought Byte has range from -128 to 127

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

      Bro it is Integer Cache Array range -128 to 127. First learn wrapper classes

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

    One more last question: what was that moooo in the background?

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

    Thanks for sharing,

  • @arunsinghrajpoot5363
    @arunsinghrajpoot5363 2 года назад +4

    Bhiya like that label questions asked in airtal labs also

    • @GenieAshwani
      @GenieAshwani  2 года назад

      Airtel asked bit DSA side question and it also depends on you interviewer

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

      @@GenieAshwani what is DSA?

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

      ​@@croydon21HDATA STRUCTURE ALGORITHM

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

    sir , i have gap in my carrier , so please give me some advise to revive me

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

    the largest number problem if done without comparator interviewer will be happy ??

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

    What was the third questions .. not clear

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

    I guess you have already seen the last question before this interview

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

    genie bhaiya interview de rehe the ya shika rehe the 😂😂😂

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

    2 nd question is unclear can anyone explain what actually ahe asked on interview?

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

      Given the array, return the reverse array but in a string..

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

      ​@@aadityaa.She said form largest number in an array

    • @aj9706
      @aj9706 8 месяцев назад

      ​@@gautam_505just sort it and reverse it .

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

    @bro, where you learned Java , plz help me

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

    what was the last question???

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

    for a comment"You are correct"

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

    2nd one's wrong right? You cannot downcast an object right?

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

      You can , that is called dynamic method dispatch
      Object Reference is base class 's but it points to child class
      Compiler checks but JVM binds the method

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

    @4:10 same as 39:16 of ruclips.net/video/SPtbeZ20OtM/видео.html . OK this is how interviews happen in India

  • @jacksandy-oh8gf
    @jacksandy-oh8gf 8 месяцев назад

    I'm confused with 3rd answer

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

    That cow sound got me 😢

  • @845shubham
    @845shubham Год назад +2

    Bro are you able to crack the interview???

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

    What is the correct answer ?please share

  • @user-we2dt3xv9k
    @user-we2dt3xv9k 4 месяца назад

    Very easy interview

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

    Derived ❌ drived ✅

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

    wow nice bro

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

    How 9534330 is correct if she asking to print reverse then it should be 9534303

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

      That's what i was also thinking of

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

      Largest number would be 9543330 right? I didn't get how it's right

    • @abhaykushwah3301
      @abhaykushwah3301 8 месяцев назад

      She didn't said that he is right

    • @rajjaiswal4769
      @rajjaiswal4769 8 месяцев назад

      He's right, you don't have alter numbers in array , just manipulate numbers in array in such a way that it gives largest possible number

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

      brother can you change one int number 34 to 43 i mean its harcoded to 34 hope you understood thats why and ​@gautam_505 is 95.......

  • @Death-metal99
    @Death-metal99 6 месяцев назад

    Just 3 questions?

  • @raghavendrac1053
    @raghavendrac1053 Год назад +3

    I didn't get the last question

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

    Any java develooer from bangalore please ping me

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

    Se escucho una vaca de fondo o yo estoy mal? jajajaa

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

      Estás mal.
      Son 2 vacas 😂

  • @jagadishroy6063
    @jagadishroy6063 2 года назад +1

    Sir itna easy hota h kya!!!

    • @GenieAshwani
      @GenieAshwani  2 года назад +2

      jagadish bhai last wala question easy nhi tha yr agar pahle esa question nhi dekha ho to time lagta ha GKG ka medium level ka question ha

    • @jagadishroy6063
      @jagadishroy6063 2 года назад

      @@GenieAshwani ha sir. Last wala though tha thora.

    • @jagadishroy6063
      @jagadishroy6063 2 года назад

      But sir is this real cognizant interview? How to get chance for these type of interviews.

    • @GenieAshwani
      @GenieAshwani  2 года назад +2

      @@jagadishroy6063 When you will exp they will call you or you can react out to them on linkedin

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

      @@GenieAshwani How to reach out to them..means How to ask referal with them?

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

    Derived ❌ drived ✅