Klarna Coding Interview Questions
25 Klarna coding interview problems with full optimal solutions — 11 easy, 11 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Klarna interviewer values, and a FAQ section.
Showing 25 problems of 25
- #1easyfoundational
1. Two Sum
Given an array of integers and a target, return indices of the two numbers that sum to the target.
- #2easyfoundational
2. Valid Parentheses
Determine if a string of brackets is balanced and properly nested.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list by splicing nodes.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Remove duplicates from a sorted array in place and return the new length.
- #5easyfoundational
5. Remove Element
Remove all occurrences of a value in an array in place and return the new length.
- #6easyfoundational
6. Climbing Stairs
Count distinct ways to climb a staircase taking 1 or 2 steps at a time.
- #7easyfoundational
7. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy-sell pair over a price series.
- #8easyfoundational
8. Contains Duplicate
Detect whether an array contains any duplicate value.
- #9easyfoundational
9. Single Number
Find the one element that appears exactly once in an array where every other element appears twice.
- #10easyfoundational
10. Missing Number
Find the single missing number from an array containing 0..n.
- #11easyfoundational
11. Reverse Linked List
Reverse a singly linked list in place.
- #12mediumfoundational
12. Add Two Numbers
Add two non-negative integers represented as reversed linked lists, digit per node.
- #13mediumfoundational
13. Longest Substring Without Repeating Characters
Find the length of the longest substring with all distinct characters.
- #14mediumfoundational
14. Container With Most Water
Find two vertical lines that, together with the x-axis, form a container holding the most water.
- #15mediumfoundational
15. 3Sum
Find all unique triplets in an array that sum to zero.
- #16mediumfoundational
16. Group Anagrams
Group strings that are anagrams of each other.
- #17mediumfoundational
17. Maximum Subarray
Find the contiguous subarray with the largest sum.
- #18mediumfoundational
18. Spiral Matrix
Return all elements of a matrix traversed in spiral order.
- #19mediumfoundational
19. Jump Game
Decide if you can reach the last index starting from index 0 using each cell's max jump length.
- #20mediumfoundational
20. Merge Intervals
Merge all overlapping intervals into a minimal disjoint set.
- #21mediumfoundational
21. Unique Paths
Count the number of unique paths from the top-left to bottom-right of an m x n grid, moving only right or down.
- #22mediumfoundational
22. Coin Change
Find the fewest coins needed to make a target amount, or -1 if impossible.
- #24hardfoundational
24. Median of Two Sorted Arrays
Find the median of two sorted arrays in logarithmic time.
- #25hardfoundational
25. Trapping Rain Water
Compute how much rain water can be trapped between bars of varying heights.
- #26hardfoundational
26. Merge k Sorted Lists
Merge k sorted linked lists into one sorted list.