# ActionCable & WebSockets (Ruby on Rails) > Real-time features, channels, subscriptions, broadcasting, cable.yml configuration, Redis adapter - 18 interview questions - Mid-Level - [Interview Questions: Ruby on Rails](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions.md) ## 1. What is ActionCable in Ruby on Rails? **Answer** ActionCable is a framework built into Rails that enables real-time features via WebSockets. It provides a server-side abstraction in Ruby and a client-side abstraction in JavaScript to establish persistent bidirectional connections between the browser and the server. ActionCable integrates naturally with the rest of the Rails application, allowing access to models and other components. ## 2. Which configuration file defines the adapter used by ActionCable for pub/sub? **Answer** The cable.yml file located in config/ defines the pub/sub adapter used by ActionCable. This file specifies different adapters per environment: async for development (in-memory, single-process), redis or postgresql for production (enabling communication across multiple processes/servers). The configuration typically includes the Redis server URL and the channel to use. ## 3. In which directory are ActionCable server-side channels typically placed? **Answer** ActionCable server-side channels are placed in app/channels/. This directory contains ApplicationCable::Connection (connection management and authentication) and ApplicationCable::Channel (base class for all channels). Custom channels inherit from ApplicationCable::Channel and define the business logic for each type of real-time communication. ## 15 more questions available - Which method should be used in a channel to subscribe to a message stream identified by a string? - What is the difference between stream_from and stream_for in ActionCable? Sign up for free: https://sharpskill.dev/en/login ## Other Ruby on Rails interview topics - [Ruby Basics](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/ruby-basics.md): 25 questions, Junior - [Ruby Object-Oriented Programming](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/ruby-oop.md): 20 questions, Junior - [Rails Fundamentals](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-fundamentals.md): 18 questions, Junior - [Routing & Controllers](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/routing-controllers.md): 22 questions, Junior - [ActiveRecord Basics](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/active-record-basics.md): 25 questions, Junior - [Views & ERB Templates](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/views-erb-templates.md): 20 questions, Junior - [ActiveRecord Associations](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/active-record-associations.md): 24 questions, Mid-Level - [Advanced ActiveRecord Queries](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/active-record-queries.md): 28 questions, Mid-Level - [Rails Forms](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-forms.md): 20 questions, Mid-Level - [Authentication & Authorization](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/authentication-authorization.md): 22 questions, Mid-Level - [Modern Asset Pipeline & Frontend](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-asset-pipeline.md): 18 questions, Mid-Level - [Rails API Mode](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-api-mode.md): 20 questions, Mid-Level - [Testing with RSpec](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-testing-rspec.md): 24 questions, Mid-Level - [ActiveJob & Background Jobs](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/active-job-background-jobs.md): 20 questions, Mid-Level - [ActionMailer](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/action-mailer.md): 18 questions, Mid-Level - [ActiveStorage](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/active-storage.md): 20 questions, Mid-Level - [Caching Strategies](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/caching-strategies.md): 20 questions, Mid-Level - [Advanced Migrations](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/database-migrations-advanced.md): 20 questions, Mid-Level - [Rails Engines & Modular Apps](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-engines-modular-apps.md): 18 questions, Senior - [Performance Optimization](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/performance-optimization.md): 26 questions, Senior - [Rails Design Patterns](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-design-patterns.md): 22 questions, Senior - [Ruby Metaprogramming](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/ruby-metaprogramming.md): 20 questions, Senior - [Rails Security](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-security.md): 22 questions, Senior - [GraphQL with Rails](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/graphql-rails.md): 20 questions, Senior - [Deployment & Production](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-deployment-production.md): 20 questions, Senior - [Monitoring & Logging](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/monitoring-logging.md): 20 questions, Senior - [Rails Upgrade Strategies](https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/rails-upgrade-strategies.md): 18 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/en/technologies/ruby-on-rails/interview-questions/action-cable-websockets