Google Coding Interview P1 | By Salesforce Engineer

Sdílet
Vložit
  • čas přidán 11. 04. 2020
  • #SalesforceCodingInterviews #SFDCFactsAcademy
    Here we are with yet another coding interview for Salesforce Developer position. The interview pattern is very similar to how major product companies like Google, Amazon, Salesforce, Uber etc conduct their interviews and you will be seeing similar problems in your interviews.
    In this video, I paired up with Ranjan Kumar Saha who is an Ex-Salesforce employee and has been working on Apex for the last 7 years.
    Check out part 2 of this interview here: • Google Coding Intervie...
    Check out the interview doc here: docs.google.com/document/d/16...
    Follow Ranjan on LinkedIn here: / ranjansaha04
    Become a patron and support my work here: / sfdcfacts
    Please share this video and subscribe to the channel if you love my content.
    Content By: Manish Choudhari & Ranjan Saha
    Editor: Manish Choudhari
    Website: sfdcfacts.com
    Twitter: / manish_sfdc
    LinkedIn: / manish-choudhary

Komentáře • 73

  • @SFDCFacts
    @SFDCFacts  Před 4 lety +7

    ****FREE LWC COURSE VOUCHER*****
    Are you someone or do you know someone who recently appeared for a Salesforce Developer interview at Google/Amazon/Uber/Salesforce or any major product company?
    Then reach out to me at *sfdcfacts@**gmail.com* to share your interview experience and get access to LWC udemy course for FREE!!!!!

    • @SMSMAILRU
      @SMSMAILRU Před 3 lety

      Did you really expect him to write code? Would it be fine to provide high level solution without coding?

  • @sfdccoder3928
    @sfdccoder3928 Před 4 lety +39

    I think it is easy to add 2 formula fields in Patient Object for Days to Cure and Days to Fatal . Use Aggregate Query by Count( id) and SUM( days to Cure ) and Sum ( days to Fatal ) group by Area and Status. This should be 5 lines of code in Trigger.

    • @jyotilankapati9501
      @jyotilankapati9501 Před 8 měsíci

      Exactly...
      I think this may work
      List aggrPatient=[SELECT Id, State, SUM(NOD_Recover__c)/count(Id) AvgRecover, SUM(NOD_Fatality__c)/count(Id) AvgFatality, areaId
      FROM Patient Where Id IN:Id && areaId IN:areaId
      Group By areaId]
      NOD_Recover__c and NOD_Fatality__c both are Formula fields on Patient object.

  • @Ramreddy-kq5or
    @Ramreddy-kq5or Před 4 lety +1

    The most useful information ever i seen on youtube regarding salesforce. please keep making these kind of videos. Thanks

  • @AshishSharma-mn6uc
    @AshishSharma-mn6uc Před 4 lety +7

    Good content.. i would like to see more complex problems in next interviews..
    Love your videos..!!

  • @ADITYA5777
    @ADITYA5777 Před 4 lety

    Thank You sir for posting these interview sessions. It will help us a lot. 👍

  • @HumbleNishachar
    @HumbleNishachar Před 4 lety +2

    thanks manish for wonderful coding interview session

  • @akshay9467
    @akshay9467 Před 4 lety +1

    Very helpful. Waiting for more complex scenarios in upcoming videos. 👍🏼

  • @rdash3804
    @rdash3804 Před 4 lety

    What is meant by read only mode?? What i can see that the code hasn't been properly bulkified and you would be hitting governor limits after the insertion.

  • @vidyutdevam9204
    @vidyutdevam9204 Před 4 lety

    Would my approach be termed " not using best practices" if i don't implement a trigger factory but still make handler for the trigger?

  • @sumanbai8238
    @sumanbai8238 Před 3 lety +2

    Sir please tell should I learn Java or apex language for salesforcedevelopment.

  • @maddipatirenu7894
    @maddipatirenu7894 Před 2 lety

    Thanks for sharing the live coding interview.

  • @SINADINO
    @SINADINO Před 3 lety +1

    Great video, thanks for sharing it ! If the objective was to display the averages fields on the Area__c details page or a LWC, why not use an attribute with a getter on the controller returning an aggregate soql result? If you are allowed to create a custom field before hand, this seems to be a more elegant and scalable solution.

  • @siddhumca34
    @siddhumca34 Před 4 lety

    Thank-you sooo much

  • @DrunkenEngineer
    @DrunkenEngineer Před 4 lety +1

    Your videos inspire me a lot.
    Planning to share my interview Experience as well.

    • @SFDCFacts
      @SFDCFacts  Před 4 lety

      Hi,
      Please write to me at sfdcfacts@gmail.com, happy to talk further.

  • @luchomarchese
    @luchomarchese Před 4 lety +9

    What about having a formula field to calculate days and get the AVG directly in the SOQL? Keep in mind that what is shown in the video might fail if there are more than 50k patients
    Thanks

    • @SFDCFacts
      @SFDCFacts  Před 4 lety +2

      You are correct on both points Luciano and we have discussed both of these point at the end of part 2 of this interview. We have also discussed the alternative approaches, trade offs etc.

  • @meghajha7807
    @meghajha7807 Před 2 lety

    Thanks alot. God bless you

  • @vinodazure2676
    @vinodazure2676 Před 4 lety

    Super duper , great

  • @srutisagarsahu1223
    @srutisagarsahu1223 Před 4 lety +1

    Awesome

  • @PrabhpreetDhillon
    @PrabhpreetDhillon Před 4 lety +2

    Hi Manish,
    What about when a patient record is deleted/undeleted. Don't we have to adjust the average field on Area record?

    • @SFDCFacts
      @SFDCFacts  Před 4 lety

      We discussed this in the video Prabhdeep, as per the problem statement, the deletion of a patient record is not allowed.

  • @ranjitmishra6890
    @ranjitmishra6890 Před 4 lety +1

    Nice video manish..but i think if you are making this video for google coding round ..i would suggest to increase the complexity of the problem as these seems pretty simple rollup summary field implementation of finding the average functionality in lookup relationships.

  • @saimohan8323
    @saimohan8323 Před 3 lety

    How can I go as a fresher as a salesforce developer fresher has lless opportunities can I wait my gap is so long what can I do

  • @hemantghaturkar8595
    @hemantghaturkar8595 Před 4 lety

    can i get job as a fresher if yes how should i apply for that and if no please help me what should i do.

  • @mausamsingh7943
    @mausamsingh7943 Před 3 lety

    Very Helpful Video

  • @mangeshabhang2607
    @mangeshabhang2607 Před 2 lety

    Why not masterdetail relationship and a formula field on patient and then rollup summary on area

  • @saimohan8323
    @saimohan8323 Před 3 lety

    I have gap 2 years how can I go as a fresher for salesforce developer less opportunities for freshers what can I do

  • @rakeshrockb
    @rakeshrockb Před 4 lety

    at 7:36, you mentioned that for 10 patients an average would be 15 (considering some patients take 10 days and some 20). Shouldn't we consider the total number of patients while calculating average? ex: (sum of recovery days) / (total number of patients)...instead of total days /2

    • @SFDCFacts
      @SFDCFacts  Před 4 lety +3

      That is what I meant.
      10 patients
      5 patients with recovery days 10= 50 days
      5 patients with recovery days 20 = 100 days
      150/10 (sum/total patients)= 15 😂

  • @sanjaybhati7876
    @sanjaybhati7876 Před 3 lety

    Instead of writing avg logic in trigger we can create formula field on patient object and using trigger we can directly sum the time and set the Avg on parent object

  • @jyotilankapati9501
    @jyotilankapati9501 Před 8 měsíci

    Very helpful for the preparation of my next interview.

  • @DA_Couple
    @DA_Couple Před 4 lety +1

    Can you guide how to improve more on Trigger logics and approach .

  • @oct13saurabh
    @oct13saurabh Před 3 lety

    I think Formula fields on Patient to calculate recovery days and fatality days and two roll up summary fields to calculate average of recovery days and fatality days would work. we don't need trigger for that.

  • @manojkumar-jt3fw
    @manojkumar-jt3fw Před 2 lety

    Sir ,should i learn core java , befor i lean Apex

  • @ArkaBhattacharjee-hx9lc

    Is this google interview question or general interview?

  • @anirudhbandi8665
    @anirudhbandi8665 Před 4 lety +1

    Ranjan directly subtract date..it won't work..we have to use daysbetween() method to calculate days...apart from that 👍

  • @jkgarg1890
    @jkgarg1890 Před 3 lety

    He can get that count from the size of that list of integers

  • @gaganpathak1897
    @gaganpathak1897 Před 4 lety

    can u Show w some project examples coding

  • @mnz3211
    @mnz3211 Před 2 lety

    Since its a lookup can we not use aggregateresult?

    • @hariharannatarajan7208
      @hariharannatarajan7208 Před rokem

      we can use in any kinda relationship , in look up relationships we cannot create roll up summaries

  • @ravikant2878
    @ravikant2878 Před 4 lety +14

    Is it true that product based companies like Google and Amazon etc take a Data Structure coding first and then Salesforce interview later?
    Please let me know whether this is myth or fact.
    Thanks 😊

  • @hemantghaturkar8595
    @hemantghaturkar8595 Před 4 lety +1

    please share scenario based interview question on sharing and workflow as well others.

  • @shaswatsinha8095
    @shaswatsinha8095 Před 3 lety +1

    The second question is incorrect logically, An area can have multiple patients but a patient cannot be from multiple areas.

  • @lokeshkumar3163
    @lokeshkumar3163 Před 4 lety +3

    I see a big gap in the approach. @ranjan has not considered about the existing patients. His code will only work for the patients whose state changes and i can see the average will be messed.
    I liked the approach through he should have first written the psedu code first.

    • @saikrishna9298101861
      @saikrishna9298101861 Před 4 lety

      Agree with you on the case of existing patients (Y)

    • @SFDCFacts
      @SFDCFacts  Před 4 lety +1

      Good point Lokesh, but I think this approach will work even for existing patient records as well, as Ranjan is getting the parent area records first and then getting all patient records of these areas (including existing records).
      So while calculating the average, all patient records will be considered.
      Also, in part 2 (will be publicly available tomorrow), we have discussed other approaches as well, like having a batch in place to update these records.

    • @lokeshkumar3163
      @lokeshkumar3163 Před 4 lety

      If you observe the SOQL written in the service class has a set of Patient IDs that are updated but not all the existing patients. In order to calculate the average we have to sum the time value of each patient and divide by total number of cured patient. This will also help incase patient State changed from cured to fatal.
      By the way I liked your question and awareness towards COVID 19.
      Keep it up 👍

    • @anirudhbandi8665
      @anirudhbandi8665 Před 4 lety

      @@lokeshkumar3163 in that soql he took set of all patients related to area.

  • @spicytechInc786
    @spicytechInc786 Před 3 lety +2

    Bro simply create a formula field on child object and use aggregate result function using avg it is 4 line of code do not do all this step

    • @manasakunareddy8879
      @manasakunareddy8879 Před 2 lety

      Hii..Once pls share the code with formula field on child object..

  • @arpitsrivastava2438735
    @arpitsrivastava2438735 Před 4 lety +2

    Title is totally misleading.Have you been interviewed with Google? (they never ask this type of question)

    • @aby00007
      @aby00007 Před 4 lety

      So what do they ask?

    • @SFDCFacts
      @SFDCFacts  Před 4 lety +1

      Hi Arpit, yes, I have been interviewed and have many friends in Google, and this is precisely the type of questions they ask. Please share your experience as well if you have been interviewed or working at Google, I would love to share that with everyone.

    • @arpitsrivastava2438735
      @arpitsrivastava2438735 Před 4 lety

      They don’t ask these type of question like you asked, they asked mostly algorithms related question which we need to solve.If you have seen video people posted on youtube or go to leetcode or geeksforgeeks or interviewcup, you will get to know what is the question generally they ask at high level

    • @arpitsrivastava2438735
      @arpitsrivastava2438735 Před 4 lety

      And also related to system design, it’s not straightforward question basically they expect you to come out with high level design and then deep dive into it

    • @SFDCFacts
      @SFDCFacts  Před 4 lety +5

      Yeah, true. But if you apply for a Salesforce Developer Position (the video title also has it), then the questions are different, they test your algorithms and DS knowledge on Salesforce platform.
      If you apply for a software engineer role (backend engineer, or front end engineer), then they test you with more generic algorithms which you can also find on leetcode, interviewbit etc.
      So as the title says, this video is for Salesforce Developer position at Google.
      And just for the reference, I have gone through the complete interview process at Google, Amazon and Salesforce, and sharing only genuine details here.