The question was: Given a text written in some language where the alphabets are represented with 1 byte or 2 byte. But the one byte alphabets always have their MSB 1 and the 2 byte charecters always have their MSB 0. Now when at some point user presses a back space how many bytes are to be deleted to erase the alphabet?
Softwareentwickler Php Interview Questions
513,242 softwareentwickler php interview questions shared by candidates
Q: In an array that has one value for more than half of its elements, how can you find that value?
You've a singly linked list where every node in the list has a field "random" which points to other node in the same list. Write a function to clone this list (create a new copy of the same). Don't use extra space (just the pointer variables are fine).
Find if given number matched sum of two elements in sorted array.
Given a sentence input : helloworld output: HelloWorld YOu should make use of a dictionary available with you. Capitalize the dictionary words in the sentence
your given 2 ordered list A and list B. B has enough space to hold its existing numbers plus all the numbers in A. Add the numbers from A in B. Make sure B is ordered. Whats the fastest way to do this?
''' We want to implement a feature to suggest to users the cheapest hotel that is more popular than the one they are looking at. Write a function that given an array of hotels, sorted by their popularity returns a map from the hotel ids that associates each hotel with the cheapest hotel that is more popular than the one in question. if there is no hotel that is cheaper and more popular than the one with that id, then it shouldn't be put in the map. You can assume that hotel ids and prices are integers and that hotels have the following format: struct hotel{ int id; int price; } Example 1: input = [ { id => 123, price => 200 }, # Most popular { id => 55, price => 150 }, # Second most popular { id => 17, price => 70 }, # Third most popular { id => 18, price => 500 }, # ... { id => 27, price => 270 }, { id => 101, price => 230 } # Least popular ] output = { 18 : 17, 27 : 17, 101 : 17 }
Logic based questions. Scenarios. Code reviews
Problem solving # 1 : (9 marks) Input is [1,34,3,98,9,76,45,4] and the output should be 998764543431
Write a function that returns the longest palindrome in a string. Not just the first one or any palindrome, but the longest. The String is a long sequence of characters, spaces included.
Viewing 2351 - 2360 interview questions