Deloitte NLA Coding Question 2024 | Deloitte online exam coding questions: If anyone have Deloitte company exam in next upcoming days and you are looking for Deloitte NLA programming questions with solution for practice then you are on right page.
We have provided a Deloitte online exam coding questions solution in Java, Python and C++ Coding language also. Below Previous year question will give you an idea about difficulty level of Deloitte online exam coding questions.
Deloitte National level assessment(NLA) Exam Pattern, Syllabus Apply Link:
Deloitte apply link for BE/BTech, ME/MTech, MCA | Click Here |
Deloitte apply link for BSC/BCA | Click Here |
🔴Deloitte NLA Exam Pattern & Syllabus | Click Here |
🔴Deloitte Associate Analyst Exam Pattern & Syllabus | Click Here |
Follow Instagram Job Page Link: | Join Here |
Deloitte NLA Coding Question 2024:
Problem Statement :
Ratul made a linked list, a list made of n nodes, where every node has two variables, the velocity and the mass of a particle.
Since all the particles have the velocity in the same direction, find the total momentum of the entity made by the particles from the linked list.
Constraints :
1<=n<=10000
1<=m,v<=100
Input format:
First line containing n, number of nodes
Then n lines containing the mass and the velocity space separated.
Output Format:
Single integer denoting the momentum
Sample Input:
4
1 3
2 4
2 3
4 5
Sample Output:
37
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 s = 0;
for (int i = 0; i < n; i++) {
int m = sc.nextInt();
int v = sc.nextInt();
s += (m * v);
}
System.out.println(s);
}
}
Solution in C++:
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, s = 0, m, v;
cin >> n;
for (int i = 0; i < n; i++) { cin >> m >> v;
s += (m * v);
}
cout << s;
}
Solution in Python:
n = int(input())
s = 0
for i in range(n):
m, v = map(int, input().split())
s += m * v
print(s)
Question 2: Deloitte Coding Questions and Answers Click Here
For Daily Jobs & Internship Update Follow Us:
Join Telegram (Must) | Click Here |
Join Experienced Job Telegram | Click Here |
Follow Instagram Job Page Link: | Join Here |