1. Factors of 3 and 5
An ideal number is a positive integer with only 3 and 5 as prime divisors. It can be expressed in the form of 3^x * 5^y, where x and y are non-negative integers. For example, 15, 45, and 75 are ideal numbers but 6, 70, and 27 are not. Find the number of ideal integers within the given segment [low, high] inclusive. For instance, in the range [200, 405], there are 4 ideal integers: 225 (3^2 * 5^2), 243 (3^5), 375 (3^1 * 5^3), and 405 (3^4 * 5^1). Write a function 'getIdealNums' that returns the number of ideal integers in the inclusive range specified by 'low' and 'high'.
2. Longest Even Length Word
Consider a string, sentence, of words separated by spaces where each word is a substring consisting of English alphabetic letters only. Find the first word in the sentence that has a length which is both an even number and greater than or equal to the length of any other word of even length in the sentence. If there are multiple words meeting the criteria, return the one which occurs first in the sentence. For example, given the sentence 'Time to write great code', the longest even length words are 'Time' and 'code'. The one that occurs first is 'Time', which is the answer to return. Write a function 'longestEvenWord' that returns the first occurrence of a word with maximal even number length, or the string '00' if there are no even length words.
3. Design an Instagram-like Photo Sharing Service
Design a system for uploading and sharing photos similar to Instagram. Discuss the expected number of users, frequency of use, storage space estimations, and the database requirements. Consider using Amazon S3 for photo storage, SQL database for photo metadata, a load balancer in front of the backend, and multiple read-only databases. Discuss how to handle high-profile users' photos, propose adding an image cache, and suggest storing metadata in memory and pre-storing thumbnail images in the cache for faster user load times without accessing S3 or the database. Additionally, discuss system crash scenarios, such as automatic server failover in Amazon Cloud and global data center distribution to handle regional outages. Finally, consider the need for a feed subsystem that pre-prepares and pushes data to each client periodically.
4. Rearranging a Word to the Next Alphabetically Greater String
Given a word, return the next alphabetically greater string that can be formed by rearranging its letters. If no such rearrangement is possible, return 'no answer'.
5. Is It Possible to Convert a Pair of Integers
Given a pair of integers (a, b), you can perform any of the following operations zero or more times: (a, b) -> (a + b, b) or (a, b) -> (a, a + b). Determine if it is possible to convert the pair (a, b) into another pair (c, d) by performing these operations. If it is possible, return 'Yes'; otherwise, return 'No'.