You are given an integer N and an integer M. You are supposed to write a method void findBestCoinsThatMinimizeAverage(int N, int M) that prints the best collection of N coins that minimize the average number of minimum coins needed to generate values from 1 to M. So, if M = 100, and N = 4, then if we use the set {1, 5, 10, 25} to generate each value from 1 to 100, so that for each value the number of coins are minimized, i.e. 1 = 1 (1 coin), 2 = 1 + 1 (2 coins),..., 6 = 1 + 5 (2 coins), ..., 24 = 5 + 5 + 5 + 5 + 1 + 1 + 1 + 1 (8 coins), and we take the average of these coins, we would see that the average comes out to ~5.7. But if we instead use {1, 5, 18, 25}, the average would come out to be 3.7. We are to find that set of N coins, and print them, that produce the minimum average.
Ingegnere Interview Questions
Ingegnere Interview Questions
Gli ingegneri sono responsabili della progettazione e della realizzazione di prodotti. Durante un colloquio di lavoro, aspettati di ricevere domande sulle tue competenze tecniche e di essere valutato per la tua capacità di lavorare in team alla creazione e realizzazione di oggetti. Le domande specifiche che ti verranno poste dipenderanno dal tipo di ruolo tecnico per il quale ti stai candidando, ad esempio una specifica disciplina ingegneristica come software engineer, ingegnere elettrico o ingegnere meccanico.
Domande tipiche dei colloqui per Ingegnere e come rispondere
Domanda 1: Qual è il progetto di ingegneria più impegnativo al quale hai partecipato e come sei riuscito a garantirne il successo?
Domanda 2: Nel tuo ruolo attuale, quali misure adotti per evitare di commettere errori?
Domanda 3: Descrivi una volta in cui hai dovuto gestire un cliente o un interlocutore difficile.
375,371 ingegnere interview questions shared by candidates
Interview question was given a grid of 9x9 sudoku with numbers filled in already, you have to check if it's a valid suoku.
Basically the interview questions were data structure. The first one was just a simple data structure question, but the second one was mathematical question. I hadn't expected that kind of questions would be asked, so I got really confused. The questions was to prove that Y is a multiple of six, where there are consecutive three numbers X, Y, Z and X and Z are a prime number. I was totally stuck at the point and couldn't make it.
Given a coin with probability x (= U[0, 1] showing head at each flip, what is the probability that you got a second head after getting the first one.
Find the integer pairs in an integer array, so that they sum up to a specific number n.
Given a list of strings, write a function to calculate the longest common prefix (LCP) of all those strings.
Given a binary tree, write a function to find the length of the longest path in the tree.
Write a function that computes log2() using sqrt().
Create a linked list with 3 char (A,B,C) in it and print the list in reverse.
Write a C function to return the number of set bits in an integer.
Viewing 201 - 210 interview questions