What is the primary advantage of real-time web applications?
A. They provide instantaneous updates and interactions without the need for page reloads.
B. They offer better performance for static content delivery.
C. They simplify server-side processing.
D. They reduce the need for client-side scripting.
Answer: A
Which technology is commonly used for real-time communication in ASP.NET applications?
A. SignalR
B. WebSockets
C. AJAX
D. Server-Sent Events
Answer: A
What is a common use case for real-time web applications?
A. Chat applications and live notifications
B. Static web page hosting
C. Server-side data processing
D. Traditional form submission
Answer: A
In real-time web applications, what does the term “push” refer to?
A. The server sending updates to clients without them requesting the information.
B. Clients requesting updates from the server.
C. Storing data in the browser’s local storage.
D. Sending large files from client to server.
Answer: A
Which of the following protocols is essential for real-time web applications?
A. WebSocket
B. HTTP
C. FTP
D. SMTP
Answer: A
What does the Hub
class in SignalR represent?
A. A server-side component for managing real-time communication between clients and the server.
B. A client-side component for managing HTTP requests.
C. A configuration class for SignalR.
D. A database access class.
Answer: A
Which SignalR method allows clients to send messages to the server?
A. SendAsync()
B. ReceiveAsync()
C. Broadcast()
D. PushMessage()
Answer: A
What is a “HubConnection” in SignalR?
A. An object that manages the connection between the client and the SignalR Hub.
B. A server-side method for handling incoming messages.
C. A configuration setting for SignalR.
D. A class for managing client-side data.
Answer: A
How do real-time web applications benefit from WebSockets?
A. WebSockets provide a full-duplex communication channel that allows continuous data exchange between client and server.
B. WebSockets enhance the security of data transmission.
C. WebSockets simplify HTTP request handling.
D. WebSockets are used for file storage on the server.
Answer: A
What is the purpose of OnConnectedAsync
in a SignalR Hub?
A. It handles logic when a client successfully connects to the Hub.
B. It manages reconnection attempts.
C. It processes messages from clients.
D. It initializes the Hub’s configuration.
Answer: A
Which SignalR feature allows a server to broadcast messages to all connected clients?
A. Clients.All.SendAsync()
B. BroadcastToAll()
C. SendToClients()
D. PushToAll()
Answer: A
In a real-time web application, what does the term “subscribing” generally refer to?
A. Clients registering to receive specific types of updates or messages from the server.
B. Clients sending data to the server.
C. Server-side data processing.
D. Handling HTTP requests.
Answer: A
How can you ensure message delivery reliability in a real-time web application using SignalR?
A. By using the SendAsync()
method and implementing retry logic as needed.
B. By configuring SSL/TLS for secure communication.
C. By using custom transport protocols.
D. By optimizing server-side processing.
Answer: A
What does IHubContext<T>
allow you to do in an ASP.NET Core SignalR application?
A. Send messages to clients from outside of a Hub class.
B. Configure Hub services.
C. Manage server-side connections.
D. Handle client-side scripts.
Answer: A
Which method is used to configure real-time services in the Startup
class of an ASP.NET Core application?
A. AddSignalR()
B. ConfigureSignalR()
C. UseSignalR()
D. SignalRConfig()
Answer: A
How does SignalR handle client reconnections?
A. By using automatic reconnection policies and handling disconnection events.
B. By manually reconnecting clients through JavaScript.
C. By restarting the server on client disconnection.
D. By using HTTP long polling.
Answer: A
What is the role of the ScriptManager
in an AJAX-enabled ASP.NET page?
A. To manage client-side scripts and enable partial page updates.
B. To handle server-side authentication.
C. To configure database connections.
D. To manage static content delivery.
Answer: A
How can you implement real-time notifications in an ASP.NET Core application?
A. By using SignalR to push updates to clients in real-time.
B. By sending periodic HTTP requests to check for updates.
C. By using email notifications.
D. By using server-side rendering only.
Answer: A
What is a “message bus” in the context of real-time web applications?
A. A system for distributing messages to different parts of an application or to various clients.
B. A database for storing messages.
C. A protocol for client-server communication.
D. A web service for managing user sessions.
Answer: A
Which of the following is a benefit of using SignalR over traditional HTTP polling?
A. SignalR provides lower latency and real-time communication without the need for frequent requests.
B. SignalR reduces server-side processing time.
C. SignalR simplifies static content delivery.
D. SignalR eliminates the need for client-side scripting.
Answer: A
How does SignalR support scaling out in a distributed environment?
A. By using a backplane to synchronize messages across multiple servers.
B. By deploying multiple instances of the SignalR service.
C. By using a single server to handle all connections.
D. By configuring client-side connection management.
Answer: A
What is a “group” in SignalR and how is it used?
A. A collection of clients that can receive messages sent to that group.
B. A method for managing client-side data.
C. A configuration setting for SignalR.
D. A database table for storing messages.
Answer: A
How can you use SignalR to implement a real-time chat application?
A. By creating a Hub with methods to send and receive messages between clients.
B. By using static file servers for chat data.
C. By implementing form submission for chat messages.
D. By using traditional HTTP requests for communication.
Answer: A
What does the Groups.AddToGroupAsync()
method do in SignalR?
A. Adds a connection to a specified group.
B. Removes a connection from a group.
C. Sends a message to all members of a group.
D. Creates a new group for connections.
Answer: A
Which method in SignalR is used to handle messages from clients on the server side?
A. On()
B. Receive()
C. Send()
D. Invoke()
Answer: D
What is a “hub pipeline” in SignalR?
A. A series of components that process Hub invocations and messages.
B. A method for managing client connections.
C. A protocol for real-time communication.
D. A configuration setting for SignalR.
Answer: A
Which of the following can be a real-time web application feature enabled by SignalR?
A. Live data updates and notifications
B. Static content caching
C. Traditional form validation
D. Server-side data storage
Answer: A
What does the IHubCallerContext
provide in SignalR?
A. Context information about the caller, such as connection ID and user identity.
B. Configuration settings for the Hub.
C. Data for managing client-side scripts.
D. Methods for handling server-side requests.
Answer: A
How does SignalR ensure that messages are delivered to specific clients?
A. By using connection IDs and groups to target messages.
B. By using database queries.
C. By relying on server-side sessions.
D. By using HTTP headers for identification.
Answer: A
What is the HubConnectionBuilder
used for in SignalR?
A. To create and configure a HubConnection
instance.
B. To manage multiple Hub connections.
C. To configure server-side Hub methods.
D. To handle client-side script integration.
Answer: A
Which method is used to configure a real-time update interval in SignalR?
A. SignalR does not have a built-in method for update intervals; updates occur in real-time.
B. SetUpdateInterval()
C. ConfigureUpdateRate()
D. SetRealTimeInterval()
Answer: A
What is the IHubLifetimeManager
interface used for in SignalR?
A. To manage the lifetime and scaling of Hubs.
B. To configure client-side connections.
C. To handle message serialization.
D. To manage server-side data storage.
Answer: A
Which of the following is NOT a feature of SignalR?
A. Support for real-time communication
B. Built-in database management
C. Connection management
D. Group messaging
Answer: B
How do you handle client disconnections in SignalR?
A. By using the OnDisconnectedAsync
method in the Hub.
B. By implementing custom client-side reconnection logic.
C. By configuring server-side timeout settings.
D. By handling HTTP status codes.
Answer: A
What is the HubConnection
class used for in SignalR?
A. To manage and interact with a SignalR Hub from the client-side.
B. To configure server-side Hub methods.
C. To handle server-side data processing.
D. To manage database connections.
Answer: A
How can you integrate SignalR with a front-end framework like Angular or React?
A. By using the SignalR JavaScript client library to interact with SignalR Hubs.
B. By using custom HTTP requests for communication.
C. By embedding SignalR components directly in the front-end framework.
D. By configuring server-side APIs for integration.
Answer: A
What is the purpose of the IConnectionBuilder
interface in SignalR?
A. To configure and build connections to SignalR Hubs.
B. To manage client-side data.
C. To handle server-side message processing.
D. To manage authentication.
Answer: A
How does SignalR handle authentication and authorization?
A. By integrating with ASP.NET Core Identity and using authorization policies.
B. By managing user credentials directly in the Hub.
C. By using custom authentication schemes only.
D. By configuring client-side authentication mechanisms.
Answer: A
What is the role of IHubProtocol
in SignalR?
A. To handle the serialization and deserialization of messages between the client and server.
B. To manage Hub lifecycle events.
C. To configure client-side settings.
D. To handle connection management.
Answer: A
Which method is used to broadcast messages to a specific group of clients in SignalR?
A. Clients.Group().SendAsync()
B. SendToGroup()
C. BroadcastMessage()
D. PushToGroup()
Answer: A
What does the On()
method do in a SignalR Hub?
A. It registers a method that handles messages sent from clients to the Hub.
B. It configures Hub settings.
C. It manages client connections.
D. It handles server-side events.
Answer: A
How can you scale SignalR applications across multiple servers?
A. By using a backplane such as Redis or Azure SignalR Service to synchronize messages.
B. By deploying additional instances of the SignalR service.
C. By using load balancers only.
D. By modifying client-side connection logic.
Answer: A
What is the HubLifetimeManager
responsible for in SignalR?
A. Managing the lifecycle of Hub instances and scaling across servers.
B. Configuring Hub methods.
C. Handling client-side scripts.
D. Managing database connections.
Answer: A