HomePrevious QuestionDeloitte Coding Questions 2024 | Deloitte Coding Questions and Answers

Deloitte Coding Questions 2024 | Deloitte Coding Questions and Answers

- Advertisement -
Telegram Group Join Now
Instagram Page Join Now
5/5 - (3 votes)

Deloitte Coding Questions 2024 | Deloitte Coding Questions and Answers | Deloitte NLA coding questions: If you are looking for Deloitte Coding Questions and Answers or this year then you land on right page. Check below Deloitte Coding question which was asked in Deloitte Online Exam.

We have provided a video solution also for Deloitte NLA coding questions. Below question will give you an idea about difficulty level of Deloitte Coding Questions 2024.

Deloitte National level assessment(NLA) Apply Link:

Deloitte apply link for BE/BTech, ME/MTech, MCAClick Here
Deloitte apply link for BSC/BCAClick Here
πŸ”΄Deloitte NLA Exam Pattern & SyllabusClick Here
πŸ”΄Deloitte Associate Analyst Exam Pattern & SyllabusClick Here
Follow Instagram Job Page Link:Join Here

Deloitte Coding Questions and Answers:

Problem Statement :

Every decimal number can be changed into its binary form. Suppose your computer has it’s own CoronaVirus, that eats binary digits from the right side of a number. Suppose a virus has 6 spikes, it will eat up 6 LSB binary digits in your numbers.
You will have a bunch of numbers, and your machine will have a virus with n spikes, you have to calculate what will be the final situation of the final numbers.

Input Format:
First line, a single Integer N
Second line N space separated integers of the bunch of values as array V
Third line a single integer n, the number of spikes in Corona for Computer

Output Format:
Single N space separated integers denoting the final situation with the array v.

Sample Input:
5
1 2 3 4 5
2

Output:
0 0 0 1 1

Explanation:
5 is 101 in binary, when you cut the last two binary digits, its 1.

Solution in JAVA:

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        for (int i: arr) {
            System.out.print((i >> k));
            System.out.print(" ");
        }
    }

}

Solution in C++:

#include <bits/stdc++.h>

using namespace std;

int main() {
  int N, n;
  cin >> N;
  vector < int > v(N);
  for (int i = 0; i < N; i++) cin >> v[i];
  cin >> n;
  for (auto i: v)
    cout << (i >> n) << " ";
}

Solution in Python:

N=int(input())
a=list(map(int,input().split()))
n=int(input())
s=""
for i in a:
    s+=str(i>>n)+" "
print(s)

Check Other Deloitte Question: Click Here

Deloitte Question Link 3: Click Here

Video Solution of Deloitte Coding Questions 2024:

Deloitte Coding Question

For Daily Jobs & Internship Update Follow Us:

Join Telegram (Must)Click Here
Join Experienced Job TelegramClick Here
Follow Instagram Job Page Link:Join Here
RELATED ARTICLES

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular