Skip to main content

Featured

Anthropic MCQ : Deep Dive into AI Evaluation, Architecture, and Anthropic Safety Frameworks

As artificial intelligence models advance at an unprecedented pace, understanding how these systems are trained, evaluated, and secured is more critical than ever. Whether you are prepping for an AI certification exam or keeping up with frontier safety policies, this comprehensive Q&A guide breaks down key industry benchmarks, machine learning architectures, and Anthropic’s safety protocols. Q1: What does the SWE-bench evaluation framework directly test? Answer: Bug fixing in real projects. SWE-bench evaluates an AI agent’s capability to resolve end-to-end, real-world software engineering problems. Instead of testing isolated code snippets, it drops the model into a large, existing open-source GitHub repository alongside a human-written issue description. The agent must independently navigate the codebase, write a functional git patch, and pass the repository's containerized unit tests to verify the fix. Q2: What is Claude 3.5 Sonnet's official baseline performance o...

Myntra Software Development Engineer - Coding Question

Problem Description:

You are given a sequence X of length N + M, which is a permutation of 1 ... N + M.


An operation constitutes the following:

Pick i such that 1 <= i <= N, and j such that 1 <= j <= M. Then, swap X[i] and X[N + j].

You need to sort X in ascending order by applying the above mentioned operation any number of times.

Find what is the minimum number of swap operations needed to do so.


Constraints:

1 <= N, M <= 110

1 <= X[i] <= N + M


Input Format:

N M

X[1] X[2] ... X[N + M]


Output Format:

Print minimum number of swap operations that can be applied to X to sort it in ascending order.


Example:

N = 3 M = 2

X = [2 1 5 4 3]

For the above example, the minimum number of swaps required = 4


Explanation:

Following operations can be applied - 

1. i = 3, j = 2, X = [2 1 3 4 5]

2. i = 2, j = 1, X = [2 4 3 1 5]

3. i = 1, j = 1, X = [1 4 3 2 5]

4. i = 2, j = 1, X = [1 2 3 4 5]


Test Cases:

Input:

N = 3 M = 2

X = [2 1 5 4 3]


Output:

4


Input:

N = 1 M = 1

X = [1 1]


Output:

0

Comments