Is it reasonable to expect the interviewer, to ask me to implement a data structure in a programming interview? [closed]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
-1
down vote
favorite
I am preparing for an interview for a company at the silicon valley. I am brushing up my data structures. I am just curious to know, is it reasonable to expect the interviewer to expect me to write code for something like, a remove operation on a splay tree?
At a conceptual level I know how these work, but I am not sure if I could write code to achieve that in a 1 hour interview if the interview was today.
interviewing
closed as primarily opinion-based by Jim G., Dawny33, paparazzo, gnat, Rory Alsop May 30 '16 at 7:37
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
suggest improvements |Â
up vote
-1
down vote
favorite
I am preparing for an interview for a company at the silicon valley. I am brushing up my data structures. I am just curious to know, is it reasonable to expect the interviewer to expect me to write code for something like, a remove operation on a splay tree?
At a conceptual level I know how these work, but I am not sure if I could write code to achieve that in a 1 hour interview if the interview was today.
interviewing
closed as primarily opinion-based by Jim G., Dawny33, paparazzo, gnat, Rory Alsop May 30 '16 at 7:37
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
What kind of job are you applying to? The likelihood of them asking about these data structures might depend on that.
– Brandin
May 30 '16 at 7:17
Could happen. In my area, you should know what an array, a dictionary, and a set are, and what their performance characteristics are, and how you use them. Any knowledge about implementation would show that you are interested. Being able to implement them would be pointless for most jobs.
– gnasher729
May 30 '16 at 11:36
It's reasonable to expect this, but I'd say it's unreasonable for an interviewer to ask these questions. Few software devs are implementing data structures. They are instead writing, debugging, and maintaining code. Questions should focus on these topics. Interviewers that ask you to implement data structures are being lazy.
– user2023861
May 31 '16 at 16:03
suggest improvements |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I am preparing for an interview for a company at the silicon valley. I am brushing up my data structures. I am just curious to know, is it reasonable to expect the interviewer to expect me to write code for something like, a remove operation on a splay tree?
At a conceptual level I know how these work, but I am not sure if I could write code to achieve that in a 1 hour interview if the interview was today.
interviewing
I am preparing for an interview for a company at the silicon valley. I am brushing up my data structures. I am just curious to know, is it reasonable to expect the interviewer to expect me to write code for something like, a remove operation on a splay tree?
At a conceptual level I know how these work, but I am not sure if I could write code to achieve that in a 1 hour interview if the interview was today.
interviewing
asked May 29 '16 at 22:40
Foo
501269
501269
closed as primarily opinion-based by Jim G., Dawny33, paparazzo, gnat, Rory Alsop May 30 '16 at 7:37
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as primarily opinion-based by Jim G., Dawny33, paparazzo, gnat, Rory Alsop May 30 '16 at 7:37
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
What kind of job are you applying to? The likelihood of them asking about these data structures might depend on that.
– Brandin
May 30 '16 at 7:17
Could happen. In my area, you should know what an array, a dictionary, and a set are, and what their performance characteristics are, and how you use them. Any knowledge about implementation would show that you are interested. Being able to implement them would be pointless for most jobs.
– gnasher729
May 30 '16 at 11:36
It's reasonable to expect this, but I'd say it's unreasonable for an interviewer to ask these questions. Few software devs are implementing data structures. They are instead writing, debugging, and maintaining code. Questions should focus on these topics. Interviewers that ask you to implement data structures are being lazy.
– user2023861
May 31 '16 at 16:03
suggest improvements |Â
What kind of job are you applying to? The likelihood of them asking about these data structures might depend on that.
– Brandin
May 30 '16 at 7:17
Could happen. In my area, you should know what an array, a dictionary, and a set are, and what their performance characteristics are, and how you use them. Any knowledge about implementation would show that you are interested. Being able to implement them would be pointless for most jobs.
– gnasher729
May 30 '16 at 11:36
It's reasonable to expect this, but I'd say it's unreasonable for an interviewer to ask these questions. Few software devs are implementing data structures. They are instead writing, debugging, and maintaining code. Questions should focus on these topics. Interviewers that ask you to implement data structures are being lazy.
– user2023861
May 31 '16 at 16:03
What kind of job are you applying to? The likelihood of them asking about these data structures might depend on that.
– Brandin
May 30 '16 at 7:17
What kind of job are you applying to? The likelihood of them asking about these data structures might depend on that.
– Brandin
May 30 '16 at 7:17
Could happen. In my area, you should know what an array, a dictionary, and a set are, and what their performance characteristics are, and how you use them. Any knowledge about implementation would show that you are interested. Being able to implement them would be pointless for most jobs.
– gnasher729
May 30 '16 at 11:36
Could happen. In my area, you should know what an array, a dictionary, and a set are, and what their performance characteristics are, and how you use them. Any knowledge about implementation would show that you are interested. Being able to implement them would be pointless for most jobs.
– gnasher729
May 30 '16 at 11:36
It's reasonable to expect this, but I'd say it's unreasonable for an interviewer to ask these questions. Few software devs are implementing data structures. They are instead writing, debugging, and maintaining code. Questions should focus on these topics. Interviewers that ask you to implement data structures are being lazy.
– user2023861
May 31 '16 at 16:03
It's reasonable to expect this, but I'd say it's unreasonable for an interviewer to ask these questions. Few software devs are implementing data structures. They are instead writing, debugging, and maintaining code. Questions should focus on these topics. Interviewers that ask you to implement data structures are being lazy.
– user2023861
May 31 '16 at 16:03
suggest improvements |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
In past interviews, I have been asked to implement:
- A linked list
- A BST
- A hashtable/hashmap
- A trie
- A k-d tree
More importantly, I've been asked to implement data structures that augmented the basic structures mentioned above (e.g. a hashmap with a constraint on the number of entries, with evictions based on LRU status).
The point of these questions was not to see if I had memorized the precise implementation details; when implementing the hashmap I did not bother trying to rehash when the number of entries crossed a threshold. Rather, it was to verify that:
- As a programmer, I at least have a familiarity with these structures
- As an engineer who is going to need to solve a problem, I can utilize and extend these structures in order to fit the needs of the solution
If you can describe the operations that occur on accessing a node in a splay tree, you can probably write passable code to implement them. What's much more important, though, would be to be able to speak intelligently about why you would be using a splay tree in the first place: what shape of data and patterns of data access would lead you to choose the structure, and what features of a splay tree would enable good performance in relevant metrics where other solutions would not.
suggest improvements |Â
up vote
1
down vote
It's definitely a reasonable question. I've never been asked about splay trees before...but I've definitely had similar questions about Binary Search Trees, HashMaps/Tables, Arrays, Linked Lists, and most notably an alphabitrie.
What I have found though is that most interviewers don't care if your implementation is runnable and absolutely correct (especially in a whiteboard interview)...they mostly want to see you reason about the data structure in question. I would start by explaining what you know about the structure on a conceptual level and then start writing stuff. Talk out loud, use a lot of first-person plural pronouns (What if WE did this, do you this thing would work for US). It usually prompts your interviewer to want to solve the problem with you and give you some hints. They care more about how you can work towards a solution together than if you memorized data structure operations in the weeks leading up to your interview.
good luck. :)
suggest improvements |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
In past interviews, I have been asked to implement:
- A linked list
- A BST
- A hashtable/hashmap
- A trie
- A k-d tree
More importantly, I've been asked to implement data structures that augmented the basic structures mentioned above (e.g. a hashmap with a constraint on the number of entries, with evictions based on LRU status).
The point of these questions was not to see if I had memorized the precise implementation details; when implementing the hashmap I did not bother trying to rehash when the number of entries crossed a threshold. Rather, it was to verify that:
- As a programmer, I at least have a familiarity with these structures
- As an engineer who is going to need to solve a problem, I can utilize and extend these structures in order to fit the needs of the solution
If you can describe the operations that occur on accessing a node in a splay tree, you can probably write passable code to implement them. What's much more important, though, would be to be able to speak intelligently about why you would be using a splay tree in the first place: what shape of data and patterns of data access would lead you to choose the structure, and what features of a splay tree would enable good performance in relevant metrics where other solutions would not.
suggest improvements |Â
up vote
3
down vote
In past interviews, I have been asked to implement:
- A linked list
- A BST
- A hashtable/hashmap
- A trie
- A k-d tree
More importantly, I've been asked to implement data structures that augmented the basic structures mentioned above (e.g. a hashmap with a constraint on the number of entries, with evictions based on LRU status).
The point of these questions was not to see if I had memorized the precise implementation details; when implementing the hashmap I did not bother trying to rehash when the number of entries crossed a threshold. Rather, it was to verify that:
- As a programmer, I at least have a familiarity with these structures
- As an engineer who is going to need to solve a problem, I can utilize and extend these structures in order to fit the needs of the solution
If you can describe the operations that occur on accessing a node in a splay tree, you can probably write passable code to implement them. What's much more important, though, would be to be able to speak intelligently about why you would be using a splay tree in the first place: what shape of data and patterns of data access would lead you to choose the structure, and what features of a splay tree would enable good performance in relevant metrics where other solutions would not.
suggest improvements |Â
up vote
3
down vote
up vote
3
down vote
In past interviews, I have been asked to implement:
- A linked list
- A BST
- A hashtable/hashmap
- A trie
- A k-d tree
More importantly, I've been asked to implement data structures that augmented the basic structures mentioned above (e.g. a hashmap with a constraint on the number of entries, with evictions based on LRU status).
The point of these questions was not to see if I had memorized the precise implementation details; when implementing the hashmap I did not bother trying to rehash when the number of entries crossed a threshold. Rather, it was to verify that:
- As a programmer, I at least have a familiarity with these structures
- As an engineer who is going to need to solve a problem, I can utilize and extend these structures in order to fit the needs of the solution
If you can describe the operations that occur on accessing a node in a splay tree, you can probably write passable code to implement them. What's much more important, though, would be to be able to speak intelligently about why you would be using a splay tree in the first place: what shape of data and patterns of data access would lead you to choose the structure, and what features of a splay tree would enable good performance in relevant metrics where other solutions would not.
In past interviews, I have been asked to implement:
- A linked list
- A BST
- A hashtable/hashmap
- A trie
- A k-d tree
More importantly, I've been asked to implement data structures that augmented the basic structures mentioned above (e.g. a hashmap with a constraint on the number of entries, with evictions based on LRU status).
The point of these questions was not to see if I had memorized the precise implementation details; when implementing the hashmap I did not bother trying to rehash when the number of entries crossed a threshold. Rather, it was to verify that:
- As a programmer, I at least have a familiarity with these structures
- As an engineer who is going to need to solve a problem, I can utilize and extend these structures in order to fit the needs of the solution
If you can describe the operations that occur on accessing a node in a splay tree, you can probably write passable code to implement them. What's much more important, though, would be to be able to speak intelligently about why you would be using a splay tree in the first place: what shape of data and patterns of data access would lead you to choose the structure, and what features of a splay tree would enable good performance in relevant metrics where other solutions would not.
answered May 29 '16 at 22:59
dlev
1312
1312
suggest improvements |Â
suggest improvements |Â
up vote
1
down vote
It's definitely a reasonable question. I've never been asked about splay trees before...but I've definitely had similar questions about Binary Search Trees, HashMaps/Tables, Arrays, Linked Lists, and most notably an alphabitrie.
What I have found though is that most interviewers don't care if your implementation is runnable and absolutely correct (especially in a whiteboard interview)...they mostly want to see you reason about the data structure in question. I would start by explaining what you know about the structure on a conceptual level and then start writing stuff. Talk out loud, use a lot of first-person plural pronouns (What if WE did this, do you this thing would work for US). It usually prompts your interviewer to want to solve the problem with you and give you some hints. They care more about how you can work towards a solution together than if you memorized data structure operations in the weeks leading up to your interview.
good luck. :)
suggest improvements |Â
up vote
1
down vote
It's definitely a reasonable question. I've never been asked about splay trees before...but I've definitely had similar questions about Binary Search Trees, HashMaps/Tables, Arrays, Linked Lists, and most notably an alphabitrie.
What I have found though is that most interviewers don't care if your implementation is runnable and absolutely correct (especially in a whiteboard interview)...they mostly want to see you reason about the data structure in question. I would start by explaining what you know about the structure on a conceptual level and then start writing stuff. Talk out loud, use a lot of first-person plural pronouns (What if WE did this, do you this thing would work for US). It usually prompts your interviewer to want to solve the problem with you and give you some hints. They care more about how you can work towards a solution together than if you memorized data structure operations in the weeks leading up to your interview.
good luck. :)
suggest improvements |Â
up vote
1
down vote
up vote
1
down vote
It's definitely a reasonable question. I've never been asked about splay trees before...but I've definitely had similar questions about Binary Search Trees, HashMaps/Tables, Arrays, Linked Lists, and most notably an alphabitrie.
What I have found though is that most interviewers don't care if your implementation is runnable and absolutely correct (especially in a whiteboard interview)...they mostly want to see you reason about the data structure in question. I would start by explaining what you know about the structure on a conceptual level and then start writing stuff. Talk out loud, use a lot of first-person plural pronouns (What if WE did this, do you this thing would work for US). It usually prompts your interviewer to want to solve the problem with you and give you some hints. They care more about how you can work towards a solution together than if you memorized data structure operations in the weeks leading up to your interview.
good luck. :)
It's definitely a reasonable question. I've never been asked about splay trees before...but I've definitely had similar questions about Binary Search Trees, HashMaps/Tables, Arrays, Linked Lists, and most notably an alphabitrie.
What I have found though is that most interviewers don't care if your implementation is runnable and absolutely correct (especially in a whiteboard interview)...they mostly want to see you reason about the data structure in question. I would start by explaining what you know about the structure on a conceptual level and then start writing stuff. Talk out loud, use a lot of first-person plural pronouns (What if WE did this, do you this thing would work for US). It usually prompts your interviewer to want to solve the problem with you and give you some hints. They care more about how you can work towards a solution together than if you memorized data structure operations in the weeks leading up to your interview.
good luck. :)
answered May 29 '16 at 22:48
Veg
544149
544149
suggest improvements |Â
suggest improvements |Â
What kind of job are you applying to? The likelihood of them asking about these data structures might depend on that.
– Brandin
May 30 '16 at 7:17
Could happen. In my area, you should know what an array, a dictionary, and a set are, and what their performance characteristics are, and how you use them. Any knowledge about implementation would show that you are interested. Being able to implement them would be pointless for most jobs.
– gnasher729
May 30 '16 at 11:36
It's reasonable to expect this, but I'd say it's unreasonable for an interviewer to ask these questions. Few software devs are implementing data structures. They are instead writing, debugging, and maintaining code. Questions should focus on these topics. Interviewers that ask you to implement data structures are being lazy.
– user2023861
May 31 '16 at 16:03