0+ Learners

ONE STOP Learning Platform For TECH Interviews

Learn DSA, System Design, and Core CS Subjects with personalised roadmaps, expert videos, and practice built for results.

Curated sheets designed for a better learning experience.

Detailed videos and editorials to help you master every problem.

Stay consistent with streaks and leaderboard competition.

AI-powered instant doubt support for faster learning.

Strivers A2Z DSA Sheet

Run
1// Traverse the array once and maintain a running total by adding each element,2// ensuring an efficient and straightforward way to compute the final sum.3 4public class Main {5    public static void main(String[] args) {6        int[] arr = {1, 2, 3, 4, 5};7 8        int sum = 0;9        for (int num : arr) {10            sum += num;11        }12 13        System.out.println(sum); // Output: 1514    }15}
Problem

The Number of Ways to Make the Sum

Medium

Companies

Hints

Given an array arr of size n, your task is to efficiently compute the total sum of all elements in the array by iterating through each value.

Example 1

Input: n= 5, arr = [1, 2, 3, 4, 5]
Output: 15
Explanation: Sum of all elements is 1+2+3+4+5 = 15

Example 2

Input: n= 5, arr = [1, 2, 3, 4, 5]
Output: 15
Explanation: Sum of all elements is 1+2+3+4+5 = 15

Now your turn

Validate
Input: n= 3, arr = [13, 1, 1]
Output:
1
2
3
4

Constraints:

1 ≤ n ≤ 105

Hints:

Hint 1

Hint 1

Frequently Asked Questions:

Question 1

Question 2

Company

Interview Followup Questions:

Question 1

Question 2

Everything You Need To Crack Tech Interviews

A single platform that combines structured learning, real practice, and expert guidance so you can master coding, system design, and core CS subjects with confidence.

COMPANY-SPECIFIC INTERVIEW PREP

Target your dream job with practice sets curated for companies like Google, Amazon, Microsoft, and more. Train with their most frequently asked questions to build confidence and precision.

Google
Amazon
Stripe
Netflix
Apple
Facebook
Microsoft
Tesla
Adobe
Uber
Airbnb
LinkedIn
X
Salesforce
Oracle
Spotify
Dropbox
Meta
Intel
Pinterest

PERSONALIZED ROADMAPS

Create a custom learning path based on your schedule and skill level. Whether you have 2 months or 12, get a clear step-by-step roadmap that keeps you focused.

Structured Learning

Focused Practise

Expert Feedback

Dream Offer

Master DSA, System Design, and Core CS

Build a rock-solid foundation with 1000+ DSA problems, 100+ system design challenges, and complete coverage of DBMS, OS, and CN to ace every coding interview.

Longest Increasing Subsequence

25 min.
Medium
Dynamic Programming

Two Sum

15 min.
Easy
Arrays

Best Time to Buy and Sell Stock

20 min.
Easy
Arrays

Merge Intervals

30 min.
Medium
Intervals

Binary Search

20 min.
Easy
Binary Search

Ace Interviews with Shared Experiences

Read verified stories from real candidates. Learn what to expect in interviews, common questions, and proven strategies to perform your best.

Amazon

Software Development Engineer 1

5 rounds

6 coding problems

Community Support

Join 1.2M+ coders worldwide, share progress, ask questions, and accelerate learning through an active, supportive global network.

Biweekly Sessions

Attend live sessions every two weeks, interact with experts, receive personalized feedback, and strengthen coding and interview preparation.

Mock Tests & Contests

Sharpen your speed, accuracy, and problem-solving stamina by competing in realistic, high-pressure scenarios that prepare you for assessments.

Striver Coach

Software Engineer III @ Google

Worked at Amazon

Founder & CEO, takeUforward

Your Coach, Not Just A Creator

Hey, I'm Raj, Founder & CEO of takeUforward, formerly known as Striver.

I began my journey at Media.net, moved to Google, and spent three incredible years there before choosing a different path; building something of my own. Today, I run takeUforward full-time, a platform born from passion, persistence, and the desire to make learning truly accessible.


Remember:

You don't need a perfect background to build a great future.
You just need direction, discipline, and the courage to start.

Let's move forward, one step, one skill, one leap at a time.

Get Started Now

Coders that turned around their careers

0+ Learners!

Frequently Asked
Questions