Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a program to implement a sliding window algorithm to find the maximum sum of a subarray of fixed size.

Hard

Problem Statement

Create a program to implement a sliding window algorithm to find the maximum sum of a subarray of fixed size.

Sample Input

Array: [1, 3, 2, 5, 1, 1, 2, 3], Window Size: 3

Sample Output

Maximum Sum: 10

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
using System; class SlidingWindow { static void Main() { // Implement a sliding window algorithm to find the maximum sum } }
Log in or sign up to run or submit your code.Log inSign up
Input
Array: [1, 3, 2, 5, 1, 1, 2, 3], Window Size: 3
Expected Output
Maximum Sum: 10