Yamaha Motors Coding Questions
About Coding Questions of Yamaha Motors
In Yamaha Motors Coding Questions page you will find out all the details related to Hiring process of Yamaha Motors including Online Aptitude and Coding Assessments question, Interview process, Job Profile , Salary, Job Location and other related details.
About Yamaha Motors Solutions India Pvt. Ltd.
Yamaha Motor Solutions is the integrated part of the worldwide famous automobile company Yamaha. This company is a subsidiary of Yamaha Motor Solutions Group, Japan. They provide a wide variety of IT-related services.
Other than that the company plays a significant role in manufacturing and marketing of motorcycles, Robotics stuffs, Financial services, Support services, assistance on various software systems, Remote Data centers and Marine products.
About Yamaha Motors Hiring Process
This Hiring process consists of following steps :
- Online Assessment [ Aptitude and Technical based MCQ’s ]
- Technical and HR Interview
We have even tabulated some more information for your reference and understanding about specific Job Profile
Points | Related Informations |
---|---|
Position : |
|
Course : |
|
Eligibility Criteria / Academic Qualification Required : |
|
Cost to Company (CTC) |
|
Selection Process : |
|
Joining Location : |
|
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Yamaha Motors Coding Questions
Question 1 : Salary Breakdown
Problem Statement :
For people who are doing job, Gross Salary = Basic Salary +HRA+DA
You will be given the basic salary you have to implement it according the given rules :
- If basic salary < 1000, then HRA =15% of basic salary and DA=70% of basic salary.
- If basic salary>=1000 , then HRA =20% of basic salary and DA=80% of basic salary
Input : Output :
1200 2400
Explanation :
Since sal = 1200 >= 1000
- HRA = 1200*20/100 = 240
- DA = 1200*80/100 = 960
- Gross Salary=1200+240+960 = 2400
Thus , output is 2400
#include <iostream> using namespace std; int main() { int sal, gross = 0; cin >> sal; if (sal < 1000) gross = sal + sal * 15 / 100 + sal * 70 / 100; else gross = sal + sal * 20 / 100 + sal * 80 / 100; cout << gross; }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Sal: "); int sal = sc.nextInt(); int gross = 0; if (sal < 1000) gross = sal + sal * 15 / 100 + sal * 70 / 100; else gross = sal + sal * 20 / 100 + sal * 80 / 100; System.out.println(gross); } }
sal = int(input()) gross = 0 if sal < 1000: gross = sal + sal * 15 // 100 + sal * 70 // 100 else: gross = sal + sal * 20 // 100 + sal * 80 // 100 print(gross)
Question 2 : Sum of K Farthest items
Problem Statement :
You are given an array of length “len” ,another item called k and an integer value x. Your job is to find the sum of k farthest items in the array from x.
First line has len, k and x respectively
2nd line has the array
Example :
Input :
- 5 3 20
- 21 4 15 17 11
Output :
- 30
4, 15 and 11 are farthest from 20. Thus, their sum will be the answer.
#include <bits/stdc++.h> using namespace std; int main() { int len; cin >> len; int k; cin >> k; int x; cin >> x; vector < int > arr; for (int i = 0; i < len; i++) { int t; cin >> t; arr.push_back(t); } int max = INT_MIN; int sum = 0, index = -1; for (int i = 0; i < k; i++) { max = INT_MIN; for (int j = 0; j < len; j++) { if (arr[j] == INT_MIN) continue; int temp = abs(x - arr[j]); if (max < temp) { max = temp; index = j; } } //System.out.println(arr[index]); sum = sum + arr[index]; arr[index] = INT_MIN; } cout << sum; return 0; }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int len = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); int arr[] = new int[len]; for (int i = 0; i < len; i++) arr[i] = sc.nextInt(); int max = Integer.MIN_VALUE; int sum = 0, index = -1; for (int i = 0; i < k; i++) { max = Integer.MIN_VALUE; for (int j = 0; j < len; j++) { if (arr[j] == Integer.MIN_VALUE) continue; int temp = (int) Math.abs(x - arr[j]); if (max < temp) { max = temp; index = j; } } sum = sum + arr[index]; arr[index] = Integer.MIN_VALUE; } System.out.println(sum); } }
len, k, x = map(int, input().split()) arr = list(map(int, input().split())) sum, index = 0, -1 for i in range(k): max = -9999999 for j in range(len): if arr[j] == -9999999: continue temp = abs(x - arr[j]) if max < temp: max = temp index = j sum = sum + arr[index] arr[index] = -9999999 print(sum)
Question 3 : Profit balance
Problem Statement :
Anand and Brijesh got a bunch of profit in their business. Now it’s time to divide the profit between themselves. Anand being the one with the calculator was the one who could decide who will get how much. But as he was one hell of an honest guy, he can’t cheat on Brijesh to get some extra money. So he decided to divide them in such a way where they can get almost the same amount possible. Although, it is sometimes impossible to divide the profit into two, because the profits must be written in their production managed copy in a way where you cannot share the profit of a single thing, A single Profit will be held by a single person.
you are the one who is called to mitigate the problem. Given an array of profit, find out in the process, what can be the minimum difference between them in terms of income.
Constraints:
- 1<=N<=10^3
- 0<=Profits<=100
Input Format:
- First line contains an integer N, number of profits.
- Next line, N space separated Integers denoting the i-th Profit.
Output:
- A single integer denoting minimum possible difference between the total profits.
Sample Input:
4
1 2 3 4
Output:
0
Explanation:
He will take 1 and 4, so his profit will be 5, so the difference will be 0.
#include<bits/stdc++.h> using namespace std; vector < int > arr; int n, s; map < int, map < int, int >> m; int MinDif(int i, int ss) { if (m[i][ss]) return m[i][ss]; if (i == n) return m[i][ss] = abs(s - 2 * ss); if (ss >= s / 2) return m[i][ss] = abs(s - 2 * ss); return m[i][ss] = min(MinDif(i + 1, ss + arr[i]), MinDif(i + 1, ss)); } int main() { cin >> n; int a; s = 0; for (int i = 0; i < n; i++) { cin >> a; arr.push_back(a); s += a; } cout << MinDif(0, 0); }
import java.util.HashMap; 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; int arr[] = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); s += arr[i]; } HashMap < Integer, HashMap < Integer, Integer >> m = new HashMap < > (); System.out.println(minDiff(0, 0, s, n, m, arr)); } private static int minDiff(int i, int j, int s, int n, HashMap < Integer, HashMap < Integer, Integer >> m, int[] arr) { if (m.containsKey(i)) { if (m.get(i).containsKey(j)) return m.get(i).get(j); } if (i == n) { HashMap < Integer, Integer > z = new HashMap < > (); z.put(j, Math.abs(s - 2 * j)); m.put(i, z); return m.get(i).get(j); } if (j >= s / 2) { HashMap < Integer, Integer > z = new HashMap < > (); z.put(j, Math.abs(s - 2 * j)); m.put(i, z); return m.get(i).get(j); } int temp = Math.min(minDiff(i + 1, j + arr[i], s, n, m, arr), minDiff(i + 1, j, s, n, m, arr)); HashMap < Integer, Integer > z = new HashMap < > (); z.put(j, temp); m.put(i, z); return m.get(i).get(j); } }
from collections import defaultdict m = defaultdict(lambda: defaultdict(int)) def MinDif(i, ss, a, n, m): global s if m[i][ss] != 0: return m[i][ss] if i == n: m[i][ss] = abs(s - (2 * ss)) return m[i][ss] if ss >= s // 2: m[i][ss] = abs(s - (2 * ss)) return m[i][ss] m[i][ss] = min(MinDif(i + 1, ss + a[i], a, n, m), MinDif(i + 1, ss, a, n, m)) return m[i][ss] n = int(input()) a = list(map(int, input().split())) s = sum(a) print(MinDif(0, 0, a, n, m))
Question 4 :Sentence counter
Problem Statement :
We know sentences are terminated with certain punctuations like ‘.’,’!’,’?’, whereas there are several punctuations which don’t terminate the punctuations. Given for a paragraph, write a code to find out how many sentences are there.
Note that, ‘…’,’,’,’-‘ these don’t terminate a sentence.
Constraints:
- Number of words in the paragraph<=10^8
Input Format:
- Paragraph ended with an enter.
Output Format:
- Single Integer denoting number of sentences.
Sample Input:
- Hello! How are you? Last time I saw you… you were nervous.
Sample Output:
- 3
Explanation:
- The three sentences are:
- hello!
- How are you?
- Last time I saw you… you were nervous.
#include <bits/stdc++.h> using namespace std; int SentenceCount(string s) { istringstream ss(s); int ans = 0; while (ss) { string w; ss >> w; if (w == "") break; if (w[w.length() - 1] == '!' || w[w.length() - 1] == '?') ans++; else if (w == ".") ans++; else if (w.length() > 1) if (w[w.length() - 1] == '.' && w[w.length() - 2] != '.') ans++; } return ans; } int main() { string s; getline(cin, s); cout << SentenceCount(s); }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); System.out.println(sentenceCount(s)); } private static int sentenceCount(String s) { String[] w = s.trim().split("\\s+"); int ans = 0; for (int i = 0; i < w.length; i++) { String k = w[i]; int len = k.length(); if (k.lastIndexOf('!') == (len - 1) || k.lastIndexOf('?') == (len - 1)) { ans++; } else if (k.equals(".")) { ans++; } else if (len > 1) { if (k.charAt(len - 1) == '.' && k.charAt(len - 2) == '.') { ans++; } } else {} } return ans; } }
def SentenceCount(L): ans = 0 for w in L: if w[len(w) - 1] == "!" or w[len(w) - 1] == "?": ans += 1 elif w == ".": ans += 1 elif len(w) > 1: if w[len(w) - 1] == "." and w[len(w) - 2] != ".": ans += 1 return ans def main(): L = list(map(str, input().split())) result = SentenceCount(L) print(result) if __name__ == "__main__": main()
Question 5 :Class Monitor
Problem Statement :
After JEE Mains, some students got admission into an engineering college. Now there is a class consisting of such n students, and the HOD came to say it is time to select the class monitor. But He never gets all of them at one time. So he brought a register, every time he gets someone with less rank than the previous time he cut the name and wrote the name of the student and the rank.
For a given number of ranks he gets each time, you have to predict how many names are cut in the list.
Constraints:
- Number of Visiting<=10^9
- ranks <=10000
Input Format:
- Number of Visiting N in their first line
- N space separated ranks the HOD gets each time
Output Format:
Number of ranks cut in the list
Sample Input:
- 6
- 4 3 7 2 6 1
Sample Output:
- 3
#include <bits/stdc++.h> using namespace std; int main() { int n, p, m = INT_MAX, ans = 0; cin >> n; vector < int > a(n); for (int i = 0; i < n; i++) { cin >> p; if (p < m) { m = p; ans++; } } cout << ans - 1; }
import java.util.Scanner; public class Main { public static void main(String[] args) { int n, p, ans = 0, m = Integer.MAX_VALUE; Scanner sc = new Scanner(System.in); n = sc.nextInt(); for (int i = 0; i < n; i++) { p = sc.nextInt(); if (p < m) { m = p; ans++; } } System.out.print(ans - 1); } }
n = int(input()) a = list(map(int, input().split())) m = a[0] ans = 0 for i in range(1, n): if a[i] < m: m = a[i] ans += 1 print(ans - 1)
FAQs on Yamaha Motors Coding Questions
Question 1: What is the minimum qualification required to apply for a job at Yamaha Motors?
B.E / B.Tech Graduates with Minimum 70% or equivalent percentage throughout the academics can apply for the Yamaha Motors Recruitment Process.
Question 2: Does Yamaha Motors provide training and development opportunities to its employees in India?
Yes, Yamaha Motors in India provides training and development opportunities to its employees to enhance their skills and knowledge and help them grow in their careers.
Question 3: What kind of benefits does Yamaha Motors offer to its employees?
Yamaha Motors offers a range of benefits to its employees in India, including health insurance, life insurance, paid time off, employee discounts, retirement plans, and other perks.
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment