Leetcode strategy in javascript for frontend engineer interview

Amazon / Eng
amazon_em

Go to company page Amazon Eng

amazon_em
Oct 12, 2020 12 Comments

Hi,
I am preparing from Leetcode for Google frontend engineering position using Javascript language.
But Javascript doesn't have common implementations of useful stuff like Priority queues, Treemaps etc that's there in Java.

In Java the solution becomes very short as I don't need to reimplement the Treemap implementation, but with Javascript my solution size will increase considerably.

So how should I prepare?

1. Should I switch to Java in interview?
2. Can I write pseudocode in javascript instead of actually reimplementing stuff like Priority queues, Treemaps etc

TC: 20LPA
YOE: 4

#leetcode
#interview
#google
#frontend

comments

Want to comment? LOG IN or SIGN UP
TOP 12 Comments
  • Yeah I had a recent Google frontend interview and I could assume that a TreeNode class existed and use it.
    Oct 12, 2020 3
    • I had five rounds which consisted of 2 algo/ds interviews, 2 frontend coding interviews, and 1 behavioral (googleyness) interview.

      Can’t share the exact questions due to NDA but the algo/ds interviews were Leetcode-type questions, one of which was LC hard. In the frontend coding interviews, I was asked to implement some widget using HTML/CSS/javascript that involved DOM interactions and other frontend concepts, and also asked to implement a javascript API.

      I would suggest study up on whatever you feel less confident about. If it is algo/ds, do more Leetcode. If it’s frontend development, practice implementing a small web app.
      Oct 13, 2020
    • Amazon / Eng
      amazon_em

      Go to company page Amazon Eng

      amazon_em
      OP
      Thanks a lot again
      Oct 13, 2020
  • Google

    Go to company page Google

    Why not commit to Java? This will make it less confusing for your interviewer
    Oct 12, 2020 1
    • Amazon / Eng
      amazon_em

      Go to company page Amazon Eng

      amazon_em
      OP
      Since I am a frontend engineer and mostly work with Javascript. Even in backend I previously used NodeJS, which again is based on Javascript
      Oct 12, 2020
  • Google / Eng
    6Feet6Inch

    Go to company page Google Eng

    6Feet6Inch
    Don’t worry about it. Just switch to Java if you think JS doesn’t have the required data structure, e.g. PriorityQueue. Tbh, the chances of you getting a question where you have to use one of those data structures is less, but no interviewer would mind if you switch the language.
    Oct 12, 2020 0
  • Walmart
    scci60

    Go to company page Walmart

    scci60
    If you have to use a heap ask the interviewer if you can assume a heap implementation. If he/she says no. Write the code for a simple one... it’s what you would have to do on the job right? I feel like g won’t ask a heap question because they are too easy or too popular and thus banned. I would also consider alternative implementations that you believe requires treemap. Honestly completed hundreds of problems myself rarely did I need to use it.. See what other leetcoders submitted for top performing JavaScript solutions.
    Oct 12, 2020 0
  • New
    hypertext

    New

    hypertext
    I think your knowledge of when and how to use those types of structures should be more important to an interviewer than actually implementing them, so I would imagine pseudocode would suffice for front end. But some interviewers can be dicks about it. Idk why you would ask someone to do something in JS that you wouldn’t ever actually do.
    Oct 12, 2020 0