Sign in to unlock

Get unlimited access to all questions and answers

checked

Get lifetime access

checked

Track progress

checked

Save time

đź‘‹

Hi! Please sign in to edit.

You will receive an email notification when your contribution is accepted.

The fastest way to prepare
for a tech interview

Check our curated list of full-stack, data structures & software architecture interview questions and answers for developers

* If it's yours original answer, you can add a link to your social media account or personal website.
Ruby interview questions

Ruby interview questions.

Only challenges
Topic progress: 0%
1.

Is there an equivalent of “continue” in Ruby?

premium question
completed

Answer:

2.

Which core object includes the "Kernel" module?

premium question
completed

Answer:

3.

What is an object?

premium question
completed

Answer:

4.

What can you say about an identifier that begins with a capital letter?

premium question
completed

Answer:

5.

What are rubygems?

premium question
completed

Answer:

6.

What is a class?

premium question
completed

Answer:

7.

What is the highest level in the object model?

premium question
completed

Answer:

8.

Is everything in Ruby an object?

premium question
completed

Answer:

9.

Why Ruby is known as a language of flexibility?

premium question
completed

Answer:

10.

How might you specify a default value for a hash?

premium question
completed

Answer:

11.

Explain some differences between Ruby and Python

premium question
completed

Answer:

12.

Are instance methods public or private?

premium question
completed

Answer:

13.

Are class variables inherited?

premium question
completed

Answer:

14.

Can you call a private method outside a Ruby class using its object?

premium question
completed

Answer:

15.

There are three ways to invoke a method in ruby. Can you give me at least two?

premium question
completed

Answer:

16.

What is the return value for ...

premium question
completed

Answer:

17.

What is the difference between private and protected methods?

premium question
completed

Answer:

18.

What is the difference between an Instance Variable and a Class Variable?

premium question
completed

Answer:

19.

Is Ruby a strongly typed or a weakly typed language?

premium question
completed

Answer:

20.

Explain redo statement in Ruby

premium question
completed

Answer:

21.

What is duck typing and how does it pertain to Ruby?

premium question
completed

Answer:

22.

Why are symbols typically used as hash keys instead of strings?

premium question
completed

Answer:

23.

Explain each of the following operators and how and when they should be used

premium question
completed

Answer:

24.

Why might you use #each instead of for/in?

premium question
completed

Answer:

25.

What is a predicate in the context of Ruby method naming conventions?

premium question
completed

Answer:

26.

What is the difference between a class variable and a class instance variable?

premium question
completed

Answer:

27.

What is a module? Can you tell me the difference between classes and modules?

premium question
completed

Answer:

28.

Is Ruby a statically typed or a dynamically typed language?

premium question
completed

Answer:

29.

Why might you use Hash#fetch over Hash#[] when querying values in a hash?

premium question
completed

Answer:

30.

What are two uses of the splat operator?

premium question
completed

Answer:

31.

What is a DSL and how does it pertain to Ruby?

premium question
completed

Answer:

32.

What does it mean to coerce an object? Why would you do it?

premium question
completed

Answer:

33.

Which of the expressions listed below will result in "false"?

premium question
completed

Answer:

34.

What is the difference between #== and #===?

premium question
completed

Answer:

35.

What is the difference between nil and false in Ruby?

premium question
completed

Answer:

36.

Check if a value exists in an array in Ruby

premium question
completed

Answer:

37.

Write a function that sorts the keys in a hash by the length of the key as a string.

premium question
completed

Answer:

38.

What will be the values of ...

premium question
completed

Answer:

39.

How do you remove nil values in array using ruby?

premium question
completed

Answer:

40.

What are two uses of ranges?

premium question
completed

Answer:

41.

What are some disadvantages of a case statement versus repeated elsif statements?

premium question
completed

Answer:

42.

What is an iterator?

premium question
completed

Answer:

43.

How is the invocation of a private method different than the invocation of a public method from within its defining class?

premium question
completed

Answer:

44.

Describe a closure in Ruby

premium question
completed

Answer:

45.

What is the difference between calling "super" and calling "super()"

premium question
completed

Answer:

46.

What is the main difference between procs and lambdas?

premium question
completed

Answer:

47.

Explain this ruby idiom: a ||= b

premium question
completed

Answer:

48.

What is a Proc?

premium question
completed

Answer:

49.

What is the difference between throw/catch and raise/rescue?

premium question
completed

Answer:

50.

When might you use the do/end syntax versus using the curly bracket syntax for a block?

premium question
completed

Answer:

51.

How does block invocation differ from method invocation?

premium question
completed

Answer:

52.

What is the difference between Module#remove_method and Module#undef_method?

premium question
completed

Answer:

53.

Why might you want to avoid using string literals within loops?

premium question
completed

Answer:

54.

Why can you safely use a string as a hash key, even though a string is mutable?

premium question
completed

Answer:

55.

What is the difference between Kernel#require and Kernel#load?

premium question
completed

Answer:

56.

What is the difference between Array#map and Array#each?

premium question
completed

Answer:

57.

What will be the value of ...

premium question
completed

Answer:

58.

What is the difference between #== and #eql??

premium question
completed

Answer:

59.

Why might you want to alias a method?

premium question
completed

Answer:

60.

What is the difference between #== and #equal??

premium question
completed

Answer:

61.

What does a bang ! at the end of a method signify?

premium question
completed

Answer:

62.

What will val1 and val2 equal after the code below is executed? Explain your answer.

premium question
completed

Answer:

63.

Can you tell me the three levels of method access control for classes and modules? What do they imply about the method?

premium question
completed

Answer:

64.

Which operator must be defined in order to implement the Comparable module?

premium question
completed

Answer:

65.

What does self mean?

premium question
completed

Answer:

66.

Explain redo vs. retry usage

premium question
completed

Answer:

67.

What is the difference between Proc invocation and lambda invocation?

premium question
completed

Answer:

68.

Explain the difference between

premium question
completed

Answer:

69.

What is the value of the variable "upcased" in the below piece of code?

premium question
completed

Answer:

70.

What happens if a block is passed two arguments but only accepts one argument?

premium question
completed

Answer:

71.

Why doesn't Ruby support method overloading?

premium question
completed

Answer:

72.

What is an eigenclass?

premium question
completed

Answer:

73.

What is the difference between Object#dup and #clone?

premium question
completed

Answer:

74.

What is the difference between BasicObject#instance_eval and BasicObject#instance_exec?

premium question
completed

Answer:

75.

When might you encounter a LocalJumpError?

premium question
completed

Answer:

76.

What is the primary difference in these two code snippets?

premium question
completed

Answer:

77.

How exactly does it work?

premium question
completed

Answer:

78.

Is a block an object?

premium question
completed

Answer:

79.

Is a method an object?

premium question
completed

Answer:

80.

What happens to a constant which is not assigned?

premium question
completed

Answer:

81.

What will be the result of each of the following lines of code

premium question
completed

Answer:

82.

What is the differnece between extend and include in ruby?

premium question
completed

Answer:

83.

Write a single line of Ruby code that prints the Fibonacci sequence of any length as an array.

premium question
completed

Answer:

84.

Is the line of code below valid Ruby code? If so, what does it do?

premium question
completed

Answer:

Reverse Tech Interview: Questions to Stump an Interviewer

Few people want to get into an uncomfortable environment or an unprofitable company with no prospects. If you’re wondering how to get a real feel for a company during an interview, you’re welcome. I’ll give a list of questions that interviewers don’t usually expect...

How to become a programmer, move to the US, and get a dream job

Are you curious about what you need to do to earn more than $15.000 a month, drive a Tesla, live in sunny California, and work at Google, Apple, Facebook, or Amazon?

11 Reactive Systems interview questions and answers for software engineers . Reactive Systems

Reactive systems are an architectural style that allows multiple individual applications to blend into one unit, reacting to their environment, while staying aware of each other. Here is a list of coding interview questions on Reactive Systems to help you get ready...

34 Microservices interview questions and answers for software engineers

Microservice architecture – a variant of the service-oriented architecture structural style – arranges an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. Here is a list of coding intervie...

. Microservices
7 Layering & Middleware interview questions for developers

Middleware in the context of distributed applications is software that provides services beyond those provided by the operating system to enable the various components of a distributed system to communicate and manage data. Middleware supports and simplifies complex distributed application...

. Layering & Middleware
55 Docker interview questions and answers for software engineers

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Here is a list of coding interview questions on Docker to help you get ready for your next data structures interview in 2021.

. Docker
23 Databases interview questions and answers for software engineers

A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques. Here is a list of coding interview questions on Databases to help you g...

. Databases
21 Concurrency interview questions and answers for software engineers

In computer science, concurrency is the ability of different parts or units of a program, algorithm, or problem to be executed out-of-order or in partial order, without affecting the final outcome. Here is a list of coding interview questions on Concurrency to help you get ready for your n...

. Concurrency
13 CAP Theorem interview questions and answers for software engineers

In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: Consistency: Every read receives the ...

. CAP Theorem
18 Caching interview questions and answers for software engineers

Caching is a technique that stores a copy of a given resource and serves it back when requested. Here is a list of coding interview questions on Caching to help you get ready for your next data structures interview in 2021.

. Caching
Load more posts

Features

folder icon

Access all answers

Get the inside track on what to expect in your next tech interview. We offer you a collection of high quality technical interview questions to help you prepare for your next coding interview.

graph icon

Track progress

A smart interface helps you track your progress and focus on the topics you need. You can search through questions or sort them by difficulty or type.

clock icon

Save time

Save tens of hours searching for information on hundreds of low-quality sites designed to drive traffic and make money from advertising.

Land a six-figure job at one of the top companies.

amazon logo facebook logo google logo microsoft logo uber logo
Prepare for a technical interview

Get hired with our
tech interview questions & answers