রাস্ট (Rust) — MCQ প্রশ্ন
আইটি ও প্রোগ্রামিং MCQ (ওপেন) · আইটি ও প্রোগ্রামিং। এই অধ্যায়ে মোট 250টি প্রশ্ন আছে। নিচে প্রথম 10টি প্রশ্ন ও অপশন দেওয়া হলো; সঠিক উত্তর সার্ভারে যাচাই হয়।
এই অধ্যায়ে সব প্রশ্নে অনুশীলন করুন
What keyword is used to define an asynchronous function in Rust?
- async fn
- await fn
- future fn
- concurrent fn
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which trait must a type implement to be awaitable in Rust?
- Future
- Async
- Awaitable
- Concurrent
উত্তর যাচাই করতে প্র্যাকটিসে যান।
What does the `.await` syntax do in Rust async programming?
- Blocks the thread until the Future finishes
- Polls the Future and yields control if not ready
- Runs the Future immediately
- Declares a Future
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which of the following crates is commonly used as an async runtime in Rust?
- tokio
- serde
- rand
- regex
উত্তর যাচাই করতে প্র্যাকটিসে যান।
What is the purpose of the 'Send' trait in Rust's concurrency context?
- Ensures a type can be safely sent to another thread
- Allows shared mutable access
- Defines an async function
- Prevents data races automatically
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which Rust feature allows multiple tasks to run concurrently without using OS threads?
- Async/await with futures
- Thread::spawn
- Mutexes
- Channels
উত্তর যাচাই করতে প্র্যাকটিসে যান।
In Rust's async model, what drives a future to completion?
- An executor or runtime
- The CPU directly
- The async keyword
- The compiler
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which mechanism does Rust use for safe shared mutable state in async code?
- Mutex<T>
- Arc<T>
- RefCell<T>
- UnsafeCell<T>
উত্তর যাচাই করতে প্র্যাকটিসে যান।
What enables multiple tasks to communicate asynchronously in Rust?
- Channels
- Mutexes
- Atomic types
- Threads
উত্তর যাচাই করতে প্র্যাকটিসে যান।
How do you spawn an asynchronous task on the Tokio runtime?
- tokio::spawn(async { /* code */ })
- std::thread::spawn(async { /* code */ })
- async fn spawn_task() { /* code */ }
- spawn(async { /* code */ })
উত্তর যাচাই করতে প্র্যাকটিসে যান।