Google Coding Interview P1 | By Salesforce Engineer

Поділитися
Вставка
  • Опубліковано 7 жов 2024
  • #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.co...
    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

КОМЕНТАРІ • 73

  • @SFDCFacts
    @SFDCFacts  4 роки тому +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 3 роки тому

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

  • @sfdccoder3928
    @sfdccoder3928 4 роки тому +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 11 місяців тому

      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 4 роки тому +1

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

  • @AshishSharma-mn6uc
    @AshishSharma-mn6uc 4 роки тому +7

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

  • @ranjitmishra6890
    @ranjitmishra6890 4 роки тому +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.

  • @jyotilankapati9501
    @jyotilankapati9501 11 місяців тому

    Very helpful for the preparation of my next interview.

  • @luchomarchese
    @luchomarchese 4 роки тому +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  4 роки тому +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.

  • @akshay9467
    @akshay9467 4 роки тому +1

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

  • @SINADINO
    @SINADINO 4 роки тому +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.

  • @sanjaybhati7876
    @sanjaybhati7876 3 роки тому

    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

  • @maddipatirenu7894
    @maddipatirenu7894 2 роки тому

    Thanks for sharing the live coding interview.

  • @DrunkenEngineer
    @DrunkenEngineer 4 роки тому +1

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

    • @SFDCFacts
      @SFDCFacts  4 роки тому

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

  • @HumbleNishachar
    @HumbleNishachar 4 роки тому +2

    thanks manish for wonderful coding interview session

  • @ADITYA5777
    @ADITYA5777 4 роки тому

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

  • @anirudhbandi8665
    @anirudhbandi8665 4 роки тому +1

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

  • @meghajha7807
    @meghajha7807 3 роки тому

    Thanks alot. God bless you

  • @oct13saurabh
    @oct13saurabh 4 роки тому

    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.

  • @sumanbai8238
    @sumanbai8238 3 роки тому +2

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

  • @DA_Couple
    @DA_Couple 4 роки тому +1

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

  • @srutisagarsahu1223
    @srutisagarsahu1223 4 роки тому +1

    Awesome

  • @ravikant2878
    @ravikant2878 4 роки тому +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 😊

    • @Techyy_gaming360
      @Techyy_gaming360 3 роки тому

      True, yes dsa and algo is the initial round there

  • @vinodazure2676
    @vinodazure2676 4 роки тому

    Super duper , great

  • @mangeshabhang2607
    @mangeshabhang2607 2 роки тому

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

  • @siddhumca34
    @siddhumca34 4 роки тому

    Thank-you sooo much

  • @mausamsingh7943
    @mausamsingh7943 4 роки тому

    Very Helpful Video

  • @spicytechInc786
    @spicytechInc786 3 роки тому +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 2 роки тому

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

  • @rdash3804
    @rdash3804 4 роки тому

    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.

  • @ArkaBhattacharjee-hx9lc
    @ArkaBhattacharjee-hx9lc 3 місяці тому

    Is this google interview question or general interview?

  • @lokeshkumar3163
    @lokeshkumar3163 4 роки тому +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 4 роки тому

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

    • @SFDCFacts
      @SFDCFacts  4 роки тому +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 4 роки тому

      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 4 роки тому

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

  • @rakeshrockb
    @rakeshrockb 4 роки тому

    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  4 роки тому +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 😂

  • @PrabhpreetDhillon
    @PrabhpreetDhillon 4 роки тому +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  4 роки тому

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

  • @shaswatsinha8095
    @shaswatsinha8095 4 роки тому +1

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

  • @vidyutdevam9204
    @vidyutdevam9204 4 роки тому

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

  • @jkgarg1890
    @jkgarg1890 3 роки тому

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

  • @arpitsrivastava2438735
    @arpitsrivastava2438735 4 роки тому +2

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

    • @aby00007
      @aby00007 4 роки тому

      So what do they ask?

    • @SFDCFacts
      @SFDCFacts  4 роки тому +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 4 роки тому

      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 4 роки тому

      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  4 роки тому +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.

  • @saimohan8323
    @saimohan8323 3 роки тому

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

  • @manojkumar-jt3fw
    @manojkumar-jt3fw 2 роки тому

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

  • @hemantghaturkar8595
    @hemantghaturkar8595 4 роки тому +1

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

  • @saimohan8323
    @saimohan8323 3 роки тому

    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

  • @gaganpathak1897
    @gaganpathak1897 4 роки тому

    can u Show w some project examples coding

  • @hemantghaturkar8595
    @hemantghaturkar8595 4 роки тому

    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.

  • @mnz3211
    @mnz3211 3 роки тому

    Since its a lookup can we not use aggregateresult?

    • @hariharannatarajan7208
      @hariharannatarajan7208 2 роки тому

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