# LeetCode — Squares of a sorted array

Given an integer array sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.

Example 1:

`Input: nums = [-4,-1,0,3,10]Output: [0,1,9,16,100]Explanation: After squaring, the array becomes [16,1,0,9,100].After sorting, it becomes [0,1,9,16,100].`

Example 2:

`Input: nums = [-7,-3,2,3,11]Output: [4,9,9,49,121]`

Constraints:

• is sorted in non-decreasing order.

Solution:

Time complexity: O(n)

# LeetCode — Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list’s nodes (i.e., only nodes themselves may be changed.)

Example 1:

`Input: head = [1,2,3,4]Output: [2,1,4,3]`

Example 2:

`Input: head = []Output: []`

Example 3:

`Input: head = [1]Output: [1]`

Constraints:

• The number of nodes in the list is in the range .

Solution:

# 5. Micron 美光

1. What is webAPI?

2. What is the difference between Rest vs Restful?

3. What is the difference between class and object?

4. 使用偽代碼調取table row裡面沒有value的欄位

5. 寫出斐波那契數的演算法(使用你擅長的tech stack)

6. What is the difference between i++ vs ++i?

# 面試心得總結：

1. 上面試趣找 or 比薪水平台尋有曾經面試過相關公司及職位的人，看他們的經驗分享。不想要花錢買積分，可以選擇在討論壇上找幾個自己有興趣且自信的文章回覆發表意見後，累積好100分即可閱覽公司面試經驗。

# LeetCode — Spiral Order

Given an , return all elements of the in spiral order.

Example 1:

`Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]Output: [1,2,3,6,9,8,7,4,5]`

Example 2:

# LeetCode — Maximum Number of Balloons

Given a string , you want to use the characters of to form as many instances of the word "balloon" as possible.

You can use each character in at most once. Return the maximum number of instances that can be formed.

Example 1:

`Input: text = "nlaebolko"Output…`

# LeetCode — Remove Duplicates from Sorted list

Given the of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.

Example 1:

`Input: head = [1,1,2]Output: [1,2]`

Example 2:

# LeetCode — Shifting Letters

You are given a string of lowercase English letters and an integer array of the same length.

Call the of a letter, the next letter in the alphabet, (wrapping around so that becomes ).

• For example, , , and .

# LeetCode — Reverse Linked List

Given the of a singly linked list, reverse the list, and return the reversed list.

Example 1:

`Input: head = [1,2,3,4,5]Output: [5,4,3,2,1]`

Example 2:

# LeetCode — Find Minimum in Rotated Sorted Array

Suppose an array of length sorted in ascending order is rotated between and times. For example, the array might become:

• if it was rotated times.
• if it was rotated times.

Notice that rotating an array

# LeetCode — Sum of Root to Leaf Binary Numbers

You are given the of a binary tree where each node has a value or . Each root-to-leaf path represents a binary number starting with the most significant bit. …

## Steven Lu

Dell Technologies — VxRail Software Engineer 👨‍💻

Get the Medium app