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?
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.
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.
Yeah I do that too now. But just an unnecessary burden on an already stressful one hour
Perl6
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”
C++
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
This is exactly what I do. I've seen zero interviewers being concerned about Go.
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.
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
Does Golang not have standard collections in its library such as stack, queue, and heap???
No.Go doesn't have generics, so they don't have these implemented.
java is the worst for interviews. don’t
Because it's verbose or for some other reason? Just curious
It's verbose, but the standard library has a very rich set of collections and generics. I'd go with Java in case if an Interviewer doesn't like Go.
Python is the way to go.
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