Cognizant Java Coding Interview | Second Round | Java Developer Interview

Sdílet
Vložit
  • čas přidán 17. 09. 2022
  • 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

Komentáře • 111

  • @mrcoder9401
    @mrcoder9401 Před rokem +94

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

  • @zeezinc7
    @zeezinc7 Před 7 měsíci +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 Před 7 měsíci +7

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

    • @zeezinc7
      @zeezinc7 Před 7 měsíci +13

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

    • @theanimemanofindia8036
      @theanimemanofindia8036 Před 7 měsíci +3

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

    • @zeezinc7
      @zeezinc7 Před 7 měsíci +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 Před 7 měsíci

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

  • @adnanraza1838
    @adnanraza1838 Před rokem +11

    Nailed it bro🔥

  • @aabhasjain96
    @aabhasjain96 Před 7 měsíci +7

    Can someone please explain the logic behind last question ?

  • @SelvaKumar-xv9eb
    @SelvaKumar-xv9eb Před 6 měsíci +7

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

  • @vsaihruthikreddy7127
    @vsaihruthikreddy7127 Před 4 měsíci +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

  • @amanrathore3610
    @amanrathore3610 Před 8 měsíci +3

    Thanks for sharing,

  • @jaswanthreddy7135
    @jaswanthreddy7135 Před 5 měsíci +8

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

    • @athul03
      @athul03 Před 3 měsíci

      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.

  • @TheMumbai31
    @TheMumbai31 Před 7 měsíci +1

    What was the third questions .. not clear

  • @rushikeshgodase8498
    @rushikeshgodase8498 Před 7 měsíci +1

    what was the last question???

  • @harshwardhanshetty4683
    @harshwardhanshetty4683 Před 5 měsíci

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

  • @beingSenpai
    @beingSenpai Před 9 měsíci +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

  • @yashwanthreddygowreddigari1997
    @yashwanthreddygowreddigari1997 Před 4 měsíci +1

    Good job bro 🎉🎉🎉🎉

  • @845shubham
    @845shubham Před rokem +2

    Bro are you able to crack the interview???

  • @vish3890
    @vish3890 Před 6 měsíci

    What is the correct answer ?please share

  • @mahesh0371
    @mahesh0371 Před 5 měsíci +9

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

    • @ShubhamKumar-pe3dt
      @ShubhamKumar-pe3dt Před 5 měsíci

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

    • @mahesh0371
      @mahesh0371 Před 5 měsíci +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 Před 5 měsíci

      @@mahesh0371konsa mern stack mei kr rhe ho apply?

    • @mahesh0371
      @mahesh0371 Před 5 měsíci

      @@unkownindian11 full stack Dot net development

  • @katreji
    @katreji Před 3 měsíci

    @bro, where you learned Java , plz help me

  • @jacksandy-oh8gf
    @jacksandy-oh8gf Před 7 měsíci

    I'm confused with 3rd answer

  • @bhaveshjoshi9404
    @bhaveshjoshi9404 Před 5 měsíci

    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 Před 4 měsíci

      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).

  • @hrithikgupta1134
    @hrithikgupta1134 Před 7 měsíci

    wow nice bro

  • @nagunagu229
    @nagunagu229 Před 7 měsíci +6

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

  • @SurajRoy
    @SurajRoy Před 7 měsíci +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 Před 7 měsíci +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 Před 7 měsíci +2

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

    • @HR-pz7ts
      @HR-pz7ts Před 6 měsíci +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 Před 6 měsíci +1

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

    • @DhavalBirade
      @DhavalBirade Před 6 měsíci

      ​@@anoysantra9851🎉

  • @user-pd5hj3jc3x
    @user-pd5hj3jc3x Před 4 měsíci +1

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

  • @user-zn8dm8cp5t
    @user-zn8dm8cp5t Před 6 měsíci +1

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

    • @hindutwa7462
      @hindutwa7462 Před 4 měsíci

      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

  • @op_traders
    @op_traders Před 16 dny

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

  • @deepakdevkar7174
    @deepakdevkar7174 Před 9 měsíci +5

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

    • @shubhamshejaval8526
      @shubhamshejaval8526 Před 7 měsíci +2

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

  • @arnavjadhav2659
    @arnavjadhav2659 Před 4 měsíci +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.

  • @arunsinghrajpoot5363
    @arunsinghrajpoot5363 Před rokem +4

    Bhiya like that label questions asked in airtal labs also

    • @GenieAshwani
      @GenieAshwani  Před rokem

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

    • @croydon21H
      @croydon21H Před 4 měsíci

      @@GenieAshwani what is DSA?

    • @kn24
      @kn24 Před 4 měsíci

      ​@@croydon21HDATA STRUCTURE ALGORITHM

  • @Cosmo_Gamer
    @Cosmo_Gamer Před 5 měsíci

    Just 3 questions?

  • @movietrailer3616
    @movietrailer3616 Před 9 měsíci +2

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

    • @aadityaa.
      @aadityaa. Před 8 měsíci

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

    • @gautam_505
      @gautam_505 Před 7 měsíci

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

    • @aj9706
      @aj9706 Před 6 měsíci

      ​@@gautam_505just sort it and reverse it .

  • @saicharanmiriyala4985
    @saicharanmiriyala4985 Před 7 měsíci +5

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

    • @faisalfarhan8090
      @faisalfarhan8090 Před 6 měsíci +1

      I also didnt get 1st one

    • @ophirfernandes3869
      @ophirfernandes3869 Před 6 měsíci

      Huh

    • @ophirfernandes3869
      @ophirfernandes3869 Před 6 měsíci +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.

    • @faisalfarhan8090
      @faisalfarhan8090 Před 6 měsíci

      I thought Byte has range from -128 to 127

    • @ranveervaghela7030
      @ranveervaghela7030 Před 2 měsíci

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

  • @trishulcurtis1810
    @trishulcurtis1810 Před 5 měsíci

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

  • @Aman-kd6js
    @Aman-kd6js Před 7 měsíci +1

    for a comment"You are correct"

  • @user-we2dt3xv9k
    @user-we2dt3xv9k Před 3 měsíci

    Very easy interview

  • @user-zx5zx4ic4u
    @user-zx5zx4ic4u Před 4 měsíci +1

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

  • @huhahahahhaa
    @huhahahahhaa Před 7 měsíci +1

    That cow sound got me 😢

  • @vlog_with_SK
    @vlog_with_SK Před 7 měsíci +4

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

    • @shiVam01242
      @shiVam01242 Před 5 měsíci +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

  • @hiteshsharma9192
    @hiteshsharma9192 Před 7 měsíci

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

    • @krishnachandrarai8759
      @krishnachandrarai8759 Před 7 měsíci

      That's what i was also thinking of

    • @gautam_505
      @gautam_505 Před 7 měsíci +2

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

    • @abhaykushwah3301
      @abhaykushwah3301 Před 7 měsíci

      She didn't said that he is right

    • @rajjaiswal4769
      @rajjaiswal4769 Před 7 měsíci

      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 Před 6 měsíci +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.......

  • @siddharthsekharsingh4263
    @siddharthsekharsingh4263 Před 8 měsíci +21

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

  • @raghavendrac1053
    @raghavendrac1053 Před rokem +3

    I didn't get the last question

  • @saurabhnaigaonkar7918
    @saurabhnaigaonkar7918 Před 5 měsíci

    Derived ❌ drived ✅

  • @croydon21H
    @croydon21H Před 4 měsíci

    @4:10 same as 39:16 of czcams.com/video/SPtbeZ20OtM/video.html . OK this is how interviews happen in India

  • @nikhilmishra9337
    @nikhilmishra9337 Před 5 měsíci

    Any java develooer from bangalore please ping me

  • @RochaNahuel
    @RochaNahuel Před 7 měsíci

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

  • @jagadishroy6063
    @jagadishroy6063 Před rokem +1

    Sir itna easy hota h kya!!!

    • @GenieAshwani
      @GenieAshwani  Před rokem +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 Před rokem

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

    • @jagadishroy6063
      @jagadishroy6063 Před rokem

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

    • @GenieAshwani
      @GenieAshwani  Před rokem +2

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

    • @replytohaters
      @replytohaters Před 7 měsíci

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

  • @croydon21H
    @croydon21H Před 4 měsíci +1

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

  • @saurabhnaigaonkar7918
    @saurabhnaigaonkar7918 Před 5 měsíci

    Derived ❌ drived ✅