Tell us how would you implement hash in ruby internally?
Answer / Vishwa Natri
The internal implementation of a Hash in Ruby is based on a Hash table (an array of linked lists). When a new key-value pair is added, the key is hashed using the SHA256 digest algorithm. The resulting integer value is used as an index to access the appropriate bucket within the array. If multiple keys have the same hash value, they are stored in a linked list.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a symbol in ruby?
Explain about Class variable and global variable?
Tell me what does ruby name refers to?
Explain the difference in scope for these two variables: @@name and @name?
What is sysread method in Ruby?
mention what is the difference between a single quote and double quote?
What's the difference in scope for these two variables: @name and @@name?
Tell me how you define instance variable, global variable and class variable in ruby?
Explain about the command line options?
What is mvc and why do we use it?
Tell me what is the role of sub-directory app/controllers and app/helpers?
Explain ruby strings.