Jobs
Interviews
Interview Questions for LifeSight

1. Sliding Window Maximum Problem Statement You are given an array/list of integers with length 'N'. A sliding window of size 'K' moves from the start to the end of the array. For each of the 'N'-'K'+1 possible windows, return the maximum element. Input: First line: Single integer ‘T’ indicating number of test cases.Each test case consists of:- First line: Two space-separated integers ‘N’ and ‘K’ (number of elements and window size).- Second line: ‘N’ space-separated integers (array elements). Output: For each test case, return the output array containing the maximum elements of each sliding window, on separate lines. Example: Input: T = 1N = 8, K = 3Array = [1, 3, -1, -3, 5, 3, 6, 7] Output: [3, 3, 5, 5, 6, 7] Explanation: The sliding maximums for each window of size 'K' are [3, 3, 5, 5, 6, 7]. Constraints: 1 <= T <= 50 1 <= N <= 10^4 1 <= K <= N 0 <= ARR[i] <= 10^5 Time Limit: 1 sec

2. Combination Sum Problem Statement Given an array of distinct positive integers ARR and a non-negative integer 'B', find all unique combinations in the array where the sum is equal to 'B'. Numbers can be chosen multiple times from ARR. Ensure that elements in each combination are presented in non-decreasing order. Input: The first line contains an integer 'T', the number of test cases.Each test case consists of:- An integer 'N', the number of elements in the array, and an integer 'B', the target sum, on the first line.- An array of 'N' space-separated integers on the second line. Output: For each test case, output all possible combinations that sum up to 'B'. Each combination should be printed on a separate line. Combinations should be in non-decreasing order, but they can be printed in any sequence. Example: Input: ARR = [1, 2, 3], B = 5 Output: (1, 1, 1, 1, 1)(1, 1, 1, 2)(1, 1, 3)(1, 2, 2)(2, 3) Constraints: 1 <= T <= 5 1 <= N <= 15 1 <= B <= 20 1 <= ARR[i] <= 20 Time Limit: 1 second Note: There is no need to print the output; you only need to implement the solution in the function provided.

3. Longest Substring with K Distinct Characters You are provided with a string S of length N, consisting of lowercase English alphabet letters, and a positive integer K. Your task is to determine the maximum length of a substring of S that contains at most K distinct characters. Example: Input: S = "bacda"K = 3 Output: 4 Explanation: The substrings that have at most 3 distinct characters include: "bac", "acd", "acda". The longest one is "acda" with a length of 4, hence the result is 4. Constraints: 1 <= T <= 10 1 <= K <= 26 1 <= N <= 10^4 All characters in the string are lowercase English alphabet letters. Time Limit: 1 sec

4. Write an SQL query to join tables

cta

Start Your Job Search Today

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.

Job Application AI Bot

Job Application AI Bot

Apply to 20+ Portals in one click

Download Now

Download the Mobile App

Instantly access job listings, apply easily, and track applications.

Job Titles Overview