LINE Coding Interview Questions
25 LINE coding interview problems with full optimal solutions — 12 easy, 10 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 LINE interviewer values, and a FAQ section.
Showing 25 problems of 25
- #1easyfoundational
1. Two Sum
Find two indices in an array whose values sum to a target — LINE warms up new grads with this before chat-server design.
- #2easyfoundational
2. Valid Parentheses
Validate a string of brackets — LINE uses it to check whether you reach for a stack instantly when a chat message body has nested formatting.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list — LINE uses this as a proxy for merging two ordered chat timelines.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Dedup a sorted array in place — LINE uses this when discussing how to compact dedup'd message IDs in an offline outbox.
- #5easyfoundational
5. Remove Element
Remove all instances of a value from an array in place — LINE uses this as a stand-in for purging muted-user messages from a feed buffer.
- #6easyfoundational
6. Search Insert Position
Find where to insert a value in a sorted array — LINE uses this to gauge whether you spot binary search opportunities in sorted message-timestamp lookups.
- #7easyfoundational
7. Same Tree
Decide if two binary trees are structurally identical and have equal values at every node — LINE uses this to test recursion clarity before moving into chat-tree replication design.
- #8easyfoundational
8. Maximum Depth of Binary Tree
Return the maximum depth of a binary tree — LINE asks this to gauge whether you instinctively reach for recursion before BFS when the input is a tree.
- #9easyfoundational
9. Pascal's Triangle
Generate the first n rows of Pascal's triangle — LINE uses this to check that you can build up tabular data without off-by-one errors before moving into sticker-pack pagination.
- #10easyfoundational
10. Best Time to Buy and Sell Stock
Find the maximum profit from one buy and one sell — LINE uses this to see if you spot the running-minimum trick, the same primitive behind their payment-reconciliation min-balance scan.
- #11easyfoundational
11. Valid Palindrome
Determine if a string is a palindrome when ignoring non-alphanumeric characters and case — LINE uses this to test two-pointer fundamentals before any chat-search problem.
- #12easyfoundational
12. Single Number
Find the element that appears exactly once when every other element appears twice — LINE uses this to test whether you reach for XOR before a hash map, the same shape as deduping read-receipt acks.
- #13mediumfoundational
13. LRU Cache
Design a least-recently-used cache with O(1) get and put — LINE uses this to gauge how cleanly you wire a hash map to a doubly linked list, the exact shape behind their chat-message read-state cache.
- #14mediumfoundational
14. Number of Islands
Count the number of distinct islands in a 2D grid of land and water — LINE uses this to gauge whether you reach for clean DFS/BFS flood-fill before more exotic structures.
- #15mediumfoundational
15. Kth Largest Element in an Array
Return the k-th largest element in an unsorted array — LINE uses this to see whether you reach for a min-heap of size k, the same shape as picking the top-k most-active chat rooms.
- #16mediumfoundational
16. Product of Array Except Self
For each index, return the product of every other element without using division — LINE uses this to test prefix/suffix-pass thinking, the same backbone of their read-receipt aggregation.
- #17mediumfoundational
17. Coin Change
Find the fewest coins that make up an amount — LINE uses this to test DP intuition before they push you into LINE Pay reconciliation problems.
- #18mediumfoundational
18. Top K Frequent Elements
Return the k most frequent elements from an array — LINE uses this to gauge whether you reach for bucket sort by frequency, the same shape behind top-k sticker ranking.
- #19mediumfoundational
19. Find All Anagrams in a String
Return all start indices of substrings in s that are anagrams of p — LINE uses this to verify your sliding-window character-count instincts before chat-search problems.
- #20mediumfoundational
20. Subarray Sum Equals K
Count contiguous subarrays whose sum equals k — LINE uses this to test prefix-sum + hash-map reflexes, the engine behind their transaction-rollup audit jobs.
- #21mediumfoundational
21. Daily Temperatures
For each day, find how many days until a warmer temperature — LINE uses this to gauge whether you reach for a monotonic stack, the same primitive behind their next-read-receipt scan.
- #22mediumfoundational
22. Design Underground System
Design a system that records check-ins and check-outs and reports average travel time between stations — LINE uses this to test event-pairing and rolling-average design, the same shape as their delivery-receipt latency tracker.
- #23hardfoundational
23. Find Median from Data Stream
Support adding numbers to a stream and reporting the running median — LINE uses this to test two-heap thinking, the same shape as their median-latency dashboards for chat delivery.
- #24hardfoundational
24. Sliding Window Maximum
Return the maximum value in every window of size k as it slides across the array — LINE uses this to gauge whether you reach for a monotonic deque, the same primitive behind peak-presence detection.
- #25hardfoundational
25. Sum of Subarray Ranges
Return the sum of (max - min) across every contiguous subarray — LINE uses this to push you past naive O(n^2) and into monotonic-stack contributions for max and min separately.