1. Highly Profitable Months The stocks of a company are being surveyed to analyze the net profit of the company over a period. For an analysis parameter � k, an interval of � k consecutive months is said to be highly profitable if the values of the stock prices are strictly increasing for those months. Given the stock prices of the company for � n months and the analysis parameter � k, find the number of highly profitable intervals. Example stockPrices = [5, 3, 5, 7, 8] � = 3 k=3 These are the intervals of � k months in which the stock prices are strictly increasing: [Visual representation of the intervals in a bar graph] Hence the answer is 2. Note: If the interval length is 1, each subarray of length 1 is highly profitable The problem statement in the image is as follows: 2. Rearranging a Word Given word, return the next alphabetically greater string in all permutations of that word. If there is no greater permutation, return the string 'no answer' instead. Example word = 'baca' The string 'baca' has the following permutations in alphabetical order: 'aabc', 'aacb', 'abac', 'abca', 'acab', 'acba', 'baac', 'baca', 'bcaa', 'caab', 'caba', and 'cbaa'. The next alphabetically greater permutation of the original string is 'bcaa'. Function Description Complete the function rearrangeWord in the editor, rearrangeWord has the following parameter(s): string word: the string to analyze Returns string: Return the next alphabetically greater permutation of the string. If no such string exists, return the string 'no answer'.
Data Associate Interview Questions
2,703 data associate interview questions shared by candidates
What projects have you worked on during academics?
Time when you had to resolve a conflict in your team?
Basic Tableau Queries and SQL Basics
How many people in NYC on a normal Sunday day will drink coffee?
Can you tell me if the log diff between two stock prices is stationary based on graph.
Quick Phone interview, resume, recent activities
Just talk a lot about leadership that's all they care about since they promote almost exclusively from within
Why do you want to join P&G and move to Cincinnati?
How do you prevent over-fitting a model?
Viewing 2431 - 2440 interview questions