본문 바로가기

Amazon

235. Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).” Given binary search tree: root = [6,2,8,0,4,7,9,null,null,3,5] __.. 더보기
206. Reverse Linked List Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? .java /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class Solution { public ListNode reverseList(ListNode head) { L.. 더보기
5. Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example 2: Input: "cbbd" Output: "bb" class Solution { public String longestPalindrome(String s) { if(s == null || s.length() < 2) return s; boolean[][] isPalindrome = new boolean[s.length()][s.length()]; i.. 더보기
535. Encode and Decode TinyURL Note: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design the encode and decode methods for the TinyURL service. There is no restriction on how your encode/decode algorithm should work. You just n.. 더보기
Here is how you can ace these Amazon technical interview questions and answers When it comes to tech, no one’s doing it better than the world’s top internet retailer by revenue: Amazon. Founded in 1994 by Jeff Bezos, a former hedge fund manager, Amazon is now – apart from being a retailer of household goods - an entertainment company, a publisher, the creator of a home assistant and a newly minted grocer. But first and foremost, it’s a company that relies on technology. Be.. 더보기
Must Read: Amazon interview questions for software engineers answered! You may be an engineer with a genius for software, but that may not be enough to help you join the Amazon ranks. For the retail giant’s interview questions for a software engineer span the gamut – taking into account your technical skills for sure, but also looking at other facets of your personality. Sobit Akhmedov, a software engineer who was recently contacted by a technical recruiter from Am.. 더보기
Improve your performance: Tips to answer Amazon behavioural interview questions Amazon behavioural interview questions You may think you know it all- and perhaps you do- but just knowledge and skill set won’t help you land that coveted job at Amazon. Like most American companies, the retail biggie relies on behavioural interview questions to find the candidate who’s the perfect fit for the company and the job. But what are behavioural interview questions? On her blog, Pamela Skillings, co-founder of Big Intervie.. 더보기
Top Amazon interview tips will help you land the job of your dreams Founded in July 1994 by Jeff Bezos, Amazon is today the largest Internet retailer in the world - by revenue and market cap. The American retail behemoth recently invested $5 billion in India, in addition to the $260 million earlier this year. The latest investment makes it clear that Amazon is betting big on the India story. No wonder that landing a job at Amazon is a dream for many freshers as .. 더보기