Do you use Golang in algo interviews?

Jan 19 26 Comments

I used to use Java extensively, now I use Go at work. I love the simplicity of the language and the speed it provides.

But for interviewing though, it is very frustrating to write a stack/queue/priority queue every time you have to use it. Like I know it's easy with slices, but the extra cognitive burden and time makes it more work, especially you are interviewing with companies who ask 2 questions in 40 mins (like FB). Was wondering how do you deal with this in interviews?

comments

Want to comment? LOG IN or SIGN UP
TOP 26 Comments
  • Paychex 0x2badc0de
    Python is the way to go.
    Jan 19 1
    • OP
      Yeah I know, python is probably the best language for interviews, but I have not used it much before. And I thought it is better to use the language you use every day
      Jan 19
  • Google TeelaBrown
    Use whatever you can write the best idiomatic code in. An interviewer can grade on a curve if you're writing C++ and they asked you a String manipulation question. But if you aren't familiar with the language's best practices, that's bad.
    Jan 19 0
  • New DvVM00
    java is the worst for interviews. don’t
    Jan 19 7
    • Capital One da2de2se
      If you like the richness of Java libraries but hate the verbosity of the language, you should look into Scala. It has its very own rich set of collections and generics that are very similar to Java, and yet the syntax is succinct like Python.
      Jan 20
    • Axon 40w range
      If you code in Scala you will probably get rejections because the interviewer won't know functional programming and thinks your code doesn't work.
      Jan 20
    • Capital One da2de2se
      Axon - that’s not true at all! I use Scala for interviews, and have never been explicitly asked to use something else. On the contrary, many interviewers have appreciated Scala’s syntax. I never go overboard with functional semantics and paradigms with Scala, rather I try to keep my code fairly imperative. This way, the way the code is structured is still familiar to the interviewer, and you can code faster because it’s not verbose.
      Jan 20
    • Axon 40w range
      Why bother to interview in Scala if you're going to do it in an imperative manner? It might as well be Java at that point.
      Jan 21
    • Capital One da2de2se
      To escape the verbosity and boilerplate
      Jan 21
  • Palantir tnAV55
    Solve the problem and using procedural abstraction implement the data structure that you need last. In other words, use the concept of a Golang interface heavily.
    Jan 19 1
    • OP
      This is a great suggestion. I think I'll start doing this, helps me focus on the core solution and worry about implementing the data structure for after
      Jan 19
  • New ynvc88
    The problem with go is you'll have to know how to implement you data structures from scratch not a bad thing but more work
    Jan 19 1
    • This is exactly what I do. I've seen zero interviewers being concerned about Go.
      Feb 24
  • SAP Sfhf75
    Yes I have been! Stack queue manually implement with substring. Haven’t done much for priority queue but lol just calling generic functions as if it exists. Lot of companies pseudo code is fine too.
    Jan 19 1
    • OP
      Yeah I do that too now. But just an unnecessary burden on an already stressful one hour
      Jan 19
  • Goldman Sachs Two Ligma
    by not using Go
    Jan 19 0
  • Apple xUEdsjT
    Stack and queue are easy with slicing in go. The main issue is priorityqueue/heap, and some string processing stuff. My personal experience coming from a Go role, interviewing for a role that uses Go, requested to use Go, they said “just use Python”
    Jan 19 0
  • Brightcove gbYh57numa
    I use go. Many less things to get wrong. That said I remember a google interviewer once hee and haw about me starting to code using go and went on a tirade about it. that really ticked me off, and just to really screw with that dickbag I wrote the rest of the thing in assembly. Boy did his eyes glaze over. Got up. Told the next interviewer to cancel the rest of the rounds and walked away.
    Till today makes me mad that a person can be that unprofessional.
    Jan 19 2
    • OP
      So much for the interviews being language agonistic. And go is very much readable, I might have to coding in Java too just in case. Don't want to be in the middle of the interview worrying about syntax.
      Jan 19
    • Brightcove gbYh57numa
      It totally depends on the question. Ask me to do something with heaps and I'll use priority queue. Otherwise it's generally easier to think about it in go. The pointers also help keep things clear.
      Jan 19
  • Capital One da2de2se
    Does Golang not have standard collections in its library such as stack, queue, and heap???
    Jan 19 1
    • OP
      No.Go doesn't have generics, so they don't have these implemented.
      Jan 19
  • F5 Networks rfLu65
    C++
    Jan 19 0
  • Zillow Group Sr. Troll
    Perl6
    Jan 19 0

Salary
Comparison

    Real time salary information from verified employees