Implement a function rotateArray(vector<int> arr, int r) which rotates the array by r places. Eg 1 2 3 4 5 on being rotated by 2 gives 4 5 1 2 3.
Softwareentwickler Cc Interview Questions
511,996 softwareentwickler cc interview questions shared by candidates
1. Phone interview - Sort the characters in string by frequency and then by their alphabetical order. Example - bbaaccc -> cccaabb 2. The question that screwed me - given array is [0,1,1,0,1,1,1] ; output should be [0,1,1,0,1,2,3] ie., for every non-zero element in array, find its distance to the nearest zero in O(n) time. i would definitely encourage the candidates who read this post to share their solution for this question. 3. In order traversal of Binary search tree related (the solution is to start from right sub tree).
If your are given an Integer Singly linked list. Print it backwards. Constraints: 1. Do not manipulate the list. (example: do not make it a doubly linked list, do not add or delete elements, do not change any memory location of any element) 2. O(n) < time < O(n^2) 3. O(1) < space < O(n)
You're given a string, and you want to split it into as few strings as possible such that each string is a palindrome.
If I put you in a sealed room with a phone that had no dial tone, how would you fix it?
Aptitude questions were from the topics like Discounts, Profit or loss, Boats and streams, Work ,Pipes,Finding X and Y, Numbers, Ratio and Proportion. And all the programming questions were only from C language.
They just emailed me a word document with interview questions and after I sent it back, they said will contact me after an hour and sent me an email saying they will hire me and send the details soon.
Given a set of numbers -50 to 50, find all pairs that add up to a certain sum that is passed in. What's the O notation for what you just wrote? Can you make it faster? Can you find an O(n) solution? Implement the O(n) solution
Find a sequence with max sum in an array of negative and positive real numbers.
Given a list of n objects, write a function that outputs the minimum set of numbers that sum to at least K. FOLLOW UP: can you beat O(n ln n)?
Viewing 41 - 50 interview questions