This is a C++ question. Implement a class StockMarket in C++ that has the two following functions: class StockMarket { public: void addTrade(string stockName, int share); - This function keeps track the number of shares transacted for a stock by adding the trade information void printTop(int numberOfStock); - This function prints the top numberOfStock stocks that has the highest number of transacted shares } And here's a sample calling sequence that uses the above class: StockMarket stockMarket; stockMarket.addTrade("GOOGLE", 50); stockMarket.addTrade("APPLE", 150); stockMarket.addTrade("GOOGLE", 100); stockMarket.addTrade("MSFT", 250); stockMarket.addTrade("GOOGLE", 200); stockMarket.printTop(2); Expected output: GOOGLE 350 MSFT 250
Software Senior Interview Questions
75,773 software senior interview questions shared by candidates
Which two types of compilation can be used in Angular
Question on creating an array of first names and ordinal number combination from the input and sorting the String array chronologically, if duplicate first names found, sort based on the ordinal number (roman numerals). There were a few constraints mentioned for the sorting to be done. Another question on writing the various XPaths for a given XML files
1. Design a queue with a getMin() function
Given a class List with some virtual methods, how would I implement a sorted list?
was asked to write code in any language to go through array and find duplicate integers.
Calculate how much income tax a person would need to pay for the year.
Given stream of number find all the pairs of numbers that have sum as target sum. Given a list of banks with start and end time, check whether the test order will be handled by any of the bank or combination of the bank.
Write a function which returns true if is called more than 3 times in 3 seconds.
An agent forwarded my resume and set up an interview date. There was about a 2 week wait for the interview which was telephonic. 2 interviewers in a conference call, grilled theoretical Questions.If your underlying theory is good, you can get through. But that means you have to brush up all the basics. Not much emphasis on practical knowledge.
Viewing 2411 - 2420 interview questions