Advertisement
Guest User

walmart

a guest
Nov 20th, 2019
3,738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.54 KB | None | 0 0
  1. questions were mostly about different Facebook features and apps.
  2. Projects
  3. core java and db questions
  4. How sorting in database works? - merge sort/external sort depending on memory
  5. What is a linked list?
  6. It is a linear data structure that stores data and a referenced to another node (also known as next). It does not store nodes in contiguous memory locations. As in they are not continuous. Like in an array.
  7. Behavioral questions
  8. Basic OOD questions
  9.  
  10. Why Walmart
  11. Being a vivd Walmart shopper myself, I have thoruoughly agree with Walmart’s mission of “save people money so they can live better.” Being at Walmart would give me an opportunity to impact millions of lives and almost every household goes to Walmart or uses the app or the website.
  12.  
  13.  
  14. Would you rather be an individual contributor or work in a team?
  15.  
  16. Where do you see yourself in 5 years
  17. I see myself owning various applications and having in depth knowledge of at least two technologies and hopefully start exposing myself with more new technologies and maybe mentoring a few new grads on interns like myself.
  18.  
  19.  
  20. System design: please design TinyURL.
  21. Course schedule
  22. FizzBuzz
  23. Searching an element in BST, Design Questions mostly, Stock Price question,
  24. public Node search(Node root, int key)
  25. {
  26. // Base Cases: root is null or key is present at root
  27. if (root==null || root.key==key)
  28. return root;
  29.  
  30. // val is greater than root's key
  31. if (root.key > key)
  32. return search(root.left, key);
  33.  
  34. // val is less than root's key
  35. return search(root.right, key);
  36. }
  37.  
  38. Restful web services
  39. implement a reservation algorithm
  40. implement some sort algorithm
  41. Validate BST
  42.  
  43. Get max width of a binary tree
  44. • Get the maximum profit if the shares can be bought and sold on any day Answer Question
  45. • Write an hash function to generate values between 20-100 1 Answer
  46. • Find the missing number in a randomly sorted array Answer Question
  47. • Generate all possible ip address given an ip address Answer Question
  48. • Given all robotic directions.. Give the shortest distance to reach the same destination
  49. • OOP -Conceptual
  50. • pattern matching question
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Subtree of a tree
  59. Print the matrix in zigzag form. – spiral and diagonal traversal
  60. Notes about each data structure
  61. All runtimes
  62. hanoi tower puzzle
  63. Explain how and when Cassandra and other No-SQL databases take advantage to SQL databases like Oracle, DB2, MS-SQLServer etc.
  64.  
  65.  
  66. Median in incoming stream of number.
  67. Longest Increasing subsequence.
  68. Dictionary word problem,
  69. K reversal of link list.
  70. Max area under Histogram.
  71. Various type of caching techniques.
  72. Linear and logistic regression.
  73. Trashing in OS.
  74. How can you avoid trashing.
  75. Deadlock avoidance.
  76.  
  77. 1.An array in which each element occurs in pairs except one. How can u find it?
  78. 2.Check whether a given binary tree is binary search tree or not?
  79. 3.How to check whether a given point lies in a triangle or not?
  80. 4. Implement a stack using 2 queues.
  81. 5. What is paging? Difference b/w paging and segmentation?
  82. 6. Different types of memories.(primary,secondary)
  83. 7. How will u search in a rotated array in minimum time complexity?
  84. 8. Print all the pairs which make sum x in an array of n integers?
  85. 9. Print all nodes in a binary tree in zigzag format.
  86. 1.Dynamic programming( longest increasing sequence)
  87. 2.dynamic programming (longest ap sequence)
  88. 3. how can generate a different string every time.
  89. 4. how can you compare 2 elements without using any relational operator?
  90. 5. You need to deliver goods to n different places, you have fuel constraint and a delivery time limit for each of the n places. Design a algo to deliver the goods efficiently. (combination of 2 graph algorithms)
  91. 6. LRU cache data structure implementation.
  92. 7. some questions on my project.
  93. 8.BFS,DFS
  94. 1.How are some sites blocked in a particular place?
  95. Fibonacci series,Project explanation, tree traversal.
  96.  
  97. Basic Computer Science algorithm and data structures questions about stacks, queues, binary trees, linked lists and hash tables, graphs
  98.  
  99. The interviewer asked me questions based on my projects. I was questioned on GET and POST methods of HTTP. Then he asked my favourite subjects and questioned me on hashmaps and multi-threading in OS.
  100.  
  101.  
  102.  
  103. JVM and optimisations.
  104. SOA vs rest
  105.  
  106. 1. Questions on Java Strings, Arraylist & Hashmap Implementation.
  107. 2. Question Based on Stream of words like Trending Tweets and some designed based questions.
  108.  
  109.  
  110. 3.discussion about hashmap and internal implementation
  111. 4. discussion about hashcode() and equal method in java.
  112. 5. questions on java collections
  113.  
  114.  
  115. asked system design question- design Facebook
  116. Difference between Abstract Class and Interface in Java
  117.  
  118. In managerial round asked some questions about database and asked me to design Walmart database (system design)
  119.  
  120. What feature of Twitter would you like to change?
  121. 5. Give us a way to schedule tweets right from Twitter
  122.  
  123. 4. Make it easy to switch between Twitter accounts
  124.  
  125. 2. Make it possible to arrange my Twitter Lists
  126. Topological Sort, Spiral Matrix traversal, SQL questions, Linux commands, Data structures
  127. 1)Reverse a String
  128. 2)While-infinity loop error condition
  129. 3)Array example
  130. 4)Some object oriented programming questions.
  131. Find Minimum in Rotated Sorted Array II.
  132.  
  133.  
  134.  
  135.  
  136. java dependency inject, database union all and union difference, c, which join
  137.  
  138. union all – bring in all the rows based on the required query condition
  139. union – bring distinct
  140.  
  141.  
  142. SELECT col1
  143. FROM table1
  144. UNION ALL
  145. SELECT col2
  146. FROM table2;
  147.  
  148. SELECT col1
  149. FROM table1
  150. UNION
  151. SELECT col2
  152. FROM table2;
  153. The SQL LEFT JOIN returns all rows from the left table, even if there are no matches in the right table. This means that if the ON clause matches 0 (zero) records in the right table; the join will still return a row in the result, but with NULL in each column from the right table.
  154.  
  155. Atomic: Transaction must be treated as an atomic unit.All the transactions should happen or none should happen.
  156. Consistency: The database must remain in a consistent state after any transaction. Transactions must be done in isolation. One transaction after another to maintain consistency.
  157. Insolation. Same as above
  158. Durability. The database should be durable enough to hold all its latest updates even if the system fails or restarts.
  159.  
  160. Why use celery and rabbitmq? Is there any other way to implement asynchronous queues in python? What database, sql and non-sql difference used to know?
  161. Then I asked for a java project: How do you use multithreading? (After answering threadpool, future, bolckingqueue or something) deadlock know? What do the multi-threaded data structures know? (say a semophore)
  162. and then the third brother asked the principle of the hashmap, it seems to be often asked.
  163. 1. Give a string and output the char frequency. I started by asking all the lowercase letters and I did it with an array[26]. After that, I don’t know which characters are included in the input, so I use hashmap.
  164. 2. Give the range and output the Fibonacci number column.
  165. 3. 3Sum variant, summing the smallest but greater than the target combination
  166. 4. Design questions: Each product has a corresponding list of recommended products, design a class to store, and ask to find the last recommended product list according to the input product ID (here, the output product has no recommended products). I thought about it and said that it would work like Trie, and the product[] in the product indicates the recommended list. Finally, write and write the key part of the code.
  167. 5. Give a product a dependency and ask for a possible output order. (For example, the goods A, B, C, D, give [[A, B], [B, C], [C, D]]] A depends on B. The answer is to use the Topological sort, traverse it again. Save a map<String, String[]>, then a dependency int[], look for it from 0dependency. Finally, just write the key part.
  168.  
  169. Make notes for projects
  170. Go through HR Doc
  171. Why Walmart
  172. Questions for interviewrs
  173. Query query = session.createQuery(“from Stock where stockCode = :code “);
  174. query.setParameter(“code”, “7277");
  175. List list = query.list();
  176. We have event driver microservices
  177. We use RabbitMQ as our messaging system. It’s responsible for distributing events to the services that listen for them. Tasks also go through RabbitMQ so it can balance load across multiple instances of an application
  178. We picked RabbitMQ because it was easy to deploy
  179.  
  180.  
  181.  
  182.  
  183.  
  184. 1. remove duplicate in linked list (write code)
  185. 2. first non repeating char in string (code)
  186. 2. First unique character in a stream
  187. 3. Walmart List
  188. 4. Top 145
  189. 5. Sort linked list
  190. 6. In the second technical round, I was expected to write down code for lowest common ancestor for binary tree as well as binary search tree on paper.
  191. 7. Pascals trianle I & ii
  192. 8. https://leetcode.com/problems/longest-consecutive-sequence/description/
  193. 9. https://leetcode.com/problems/longest-increasing-subsequence/description/
  194. 10. Least common ancestor + valid parenthesis + length of longest Fibonacci subsequence
  195. 11. Simple binary tree left and right subtree inversion
  196. 12. Amicable number
  197. 13. Inorder tree traversal
  198. 14. fizzbuzz
  199. 4) Program to Implement queue using two stacks
  200. 5) Write a program to Sort version numbers
  201. 15. stack using arraylist and linkedlist
  202.  
  203.  
  204. SQL, singleton mode, database basics.
  205. Remembered are HashMap, LinkedList, BST, Binary Search, ArrayList, JVM, Tree Traversal, BFS, DFS, Stack, Queue. . . . .
  206.  
  207. JRE, Garbage Collector, Singleton, Wrapper class, stack memory vs heap Memory.
  208. Walmart : Last week, there was no result yet~~~ There were two interviewers who had a video session and talked for an hour. An interviewer introduced the situation in the group and asked a code. I forgot what question. But the difficulty of easy is very simple, you have to write on your own IDE, share screen to show him. The rest is another interviewer asked SQL, the basics of Machine Learning
  209.  
  210. Asked the oop basics, hashmap vs hashtable, unexpectedly asked a lot of rest, spring had a problem, did not respond to it, did not expect him to ask what, and later thought that he should be asking notnull min and so on to check the input of the annotation. The coding asks for the difference between the minimum and maximum values in an array. The number entered by the followup is how to change the string, and directly converts the string into an integer. Overall, it feels very simple, but my interview experience is still very tight, and I am a good man.
  211.  
  212. Sort linked list n long
  213.  
  214. • Spring helps in the creation of loosely coupled applications because of Dependency Injection.
  215. • In Spring, objects define their associations (dependencies) and do not worry about how they will get those dependencies. It is the responsibility of Spring to provide the required dependencies for creating objects.
  216. For example: Suppose we have an object Employee and it has a dependency on object Address. We would define a bean corresponding to Employee that will define its dependency on object Address.
  217. When Spring tries to create an Employee object, it will see that Employee has a dependency on Address, so it will first create the Address object (dependent object) and then inject it into the Employee object.
  218. • Inversion of Control (IOC) and Dependency Injection (DI) are used interchangeably. IOC is achieved through DI. DI is the process of providing the dependencies and IOC is the end result of DI. (Note: DI is not the only way to achieve IOC. There are other ways as well.)
  219. • By DI, the responsibility of creating objects is shifted from our application code to the Spring container; this phenomenon is called IOC.
  220. • Dependency Injection can be done by setter injection or constructor injection.
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. Twitter allows you to interact with its data i.e tweets and several other attributes using Twitter APIs. - Import Tweepy and import sparksteaming
  231.  
  232. I have used tweepy in python to fetch the tweets.
  233.  
  234. Kafka is a used for building real time data pipelines and streaming apps.
  235. Kafka stores streams of tweets in categories called topics.
  236.  
  237. In Kafka, reach record has a key value and timestamp.
  238. key is the tweet id
  239. value is the tweet
  240. timestamp is when it was posted
  241.  
  242. I have used 3 of Kafka has 3 APIs
  243. Producer, Consumer, Streams API
  244.  
  245. Producer sends a msg to a kafka cluster(topics), consumer reads msgs from this topic.
  246.  
  247. Kafka is free and useful for stream processing
  248. Start zookeeper for Kafka to work.
  249. Start kafka. Create a topic.
  250. Start producer console and Consumer console
  251.  
  252.  
  253. Spark is an open source processing engine built around speed and performance.
  254.  
  255.  
  256. Two python scripts,
  257.  
  258. First script - it will prompt you to search for the word and number of tweets. All the tweets will be pushed to kafka topic using kafka producer.
  259.  
  260. It will create a text file and output all tweets being read.
  261.  
  262. Second script –
  263. This script reads the messages from the topics using the kafkautils.create directstream.
  264. Spark streaming will read these tweets in real time in a batch interval of 5secs.
  265. Each tweet will be split into words and using sentiwordnet in python, all these words are given a score.
  266. Scores of each word will be aggregated for a sentence.
  267. We will set a threshold for this score, based on the threshould it be classified as positive or negative.
  268.  
  269.  
  270. Run the second script before the first script, so that we are in a ready state to read the tweets as and when they come. Once that script is up and running we can run the first script.
  271.  
  272. Kibana is used for viz. So we have created a bar chart, with positive and negative vs number of such tweets.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement