Eduversity.bd — Learn with Us, Achieve Your Dreams

রাস্ট (Rust) — MCQ প্রশ্ন

আইটি ও প্রোগ্রামিং MCQ (ওপেন) · আইটি ও প্রোগ্রামিং। এই অধ্যায়ে মোট 250টি প্রশ্ন আছে। নিচে প্রথম 10টি প্রশ্ন ও অপশন দেওয়া হলো; সঠিক উত্তর সার্ভারে যাচাই হয়।

এই অধ্যায়ে সব প্রশ্নে অনুশীলন করুন

  1. What keyword is used to define an asynchronous function in Rust?

    1. async fn
    2. await fn
    3. future fn
    4. concurrent fn

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  2. Which trait must a type implement to be awaitable in Rust?

    1. Future
    2. Async
    3. Awaitable
    4. Concurrent

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  3. What does the `.await` syntax do in Rust async programming?

    1. Blocks the thread until the Future finishes
    2. Polls the Future and yields control if not ready
    3. Runs the Future immediately
    4. Declares a Future

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  4. Which of the following crates is commonly used as an async runtime in Rust?

    1. tokio
    2. serde
    3. rand
    4. regex

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  5. What is the purpose of the 'Send' trait in Rust's concurrency context?

    1. Ensures a type can be safely sent to another thread
    2. Allows shared mutable access
    3. Defines an async function
    4. Prevents data races automatically

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  6. Which Rust feature allows multiple tasks to run concurrently without using OS threads?

    1. Async/await with futures
    2. Thread::spawn
    3. Mutexes
    4. Channels

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  7. In Rust's async model, what drives a future to completion?

    1. An executor or runtime
    2. The CPU directly
    3. The async keyword
    4. The compiler

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  8. Which mechanism does Rust use for safe shared mutable state in async code?

    1. Mutex<T>
    2. Arc<T>
    3. RefCell<T>
    4. UnsafeCell<T>

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  9. What enables multiple tasks to communicate asynchronously in Rust?

    1. Channels
    2. Mutexes
    3. Atomic types
    4. Threads

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

  10. How do you spawn an asynchronous task on the Tokio runtime?

    1. tokio::spawn(async { /* code */ })
    2. std::thread::spawn(async { /* code */ })
    3. async fn spawn_task() { /* code */ }
    4. spawn(async { /* code */ })

    উত্তর যাচাই করতে প্র্যাকটিসে যান।

← আগের অধ্যায়পরের অধ্যায় →