1. What is the difference between a stored procedure and a function?
2. Write a program to validate an IPv4 address. An IPv4 address is said to be valid if it satisfies the following conditions: 1. It should contain four octets separated by dots. 2. Each octet should be an integer between 0 and 255 (inclusive). 3. It should not contain any leading zeros. For example, "192.168.1.1" is a valid IPv4 address, while "0.0.0.0", "255.255.255.255", and "10.10.10." are not.
3. Longest Palindromic Substring Problem Statement You are provided with a string STR of length N. The goal is to identify the longest palindromic substring within this string. In cases where multiple palindromic substrings have maximum lengths, return the substring which begins at the smaller index. Input: The first line consists of an integer 'T', indicating the number of test cases.Each test case contains one line, a string 'STR'. Output: For each test case, print the longest palindromic substring on a separate line.If there is more than one, choose the one with the smallest start index. Example: Input: T = 1STR = "ababc" Output: "aba" Explanation: The longest palindromic substring of "ababc" is "aba". Although "bab" is also a palindrome of the same length (3), "aba" starts earlier. Constraints: 1 <= T <= 10 0 <= N <= 10^3 Each 'STR' is composed of lowercase English letters. Time Limit: 1 second
4. Given a linked list, determine if it contains a loop. Return true if there is a loop, otherwise return false.
5. Sort By Kth Bit Given an array or list ARR of N positive integers and an integer K, your task is to rearrange all elements such that those with the K-th bit (considering the rightmost bit as '1st' bit) equal to 0 are followed by those with the K-th bit equal to 1. Input: The first line contains a single integer T, the number of test cases. Each test case consists of: - A line with two space-separated integers, N and K. - A line with N space-separated integers representing the elements of ARR. Output: For each test case, return the modified array where all elements with the K-th bit 0 come first, maintaining their relative order, followed by those with the K-th bit 1, also in their original relative order. Example: Input: ARR = {1, 2, 3, 4}, K = 1 Output: Result = {2, 4, 1, 3} Explanation: The first bit (rightmost) of {2, 4} is 0, and the first bit of {1, 3} is 1. Constraints: 1 <= T <= 10 1 <= N <= 10^4 1 <= ARR[i] <= 10^9 1 <= K <= 31 Note: The relative order inside both the groups should remain as it was in the input. You don’t need to print anything; it has already been taken care of. Just implement the given function. Follow Up: Can you do it in linear time?
Browse through a variety of job opportunities tailored to your skills and preferences. Filter by location, experience, salary, and more to find your perfect fit.
We have sent an OTP to your contact. Please enter it below to verify.