3 ms·
I find graphs and trees are common 'exercises' that people do when they try out a new language, but you usually won't be implementing stuff like this day to day
by leshow 9y ago
I find graphs and trees are common 'exercises' that people do when they try out a new language, but you usually won't be implementing stuff like this day to day. You'd be using a well tested library, not cooking one up yourself.
My advice would be to try and write some 'real world' code instead of programming kattas to get a feel for the language.
- bulldoa 9y agoyeah, but another thing I am worried is that if I want to get a rust job, I should be able to do interview problems in rust, which mostly consist of linked list, tree and graph.
- mmstick 9y agoI landed a job w/ Rust, and the programming challenge I was given was a simple C programming challenge to implement a parser to parse gzip headers, to which I did it in both C and Rust. Nobody hiring for a position that's largely Rust is going to ask you to write linked lists, trees, and graphs. They're going to want you to build something more complex & practical.
- steveklabnik 9y agoI would argue that's a terrible interview, as anyone who's in the position to give a Rust job should know this about Rust.
- baq 9y agoyou'd use a cell/refcell/box or just wouldn't get this excercise as everyone who got past it in rust know it's not easy and critically it's not supposed to be easy. it's difficult in rust because recurrent data structures are super hard to reason about in general in terms of borrowing and ownership when AOT compiling and you unfortunately must know this to be efficient at rust; this realization is one of the stages of learning the language.
- deleted 9y ago[deleted]