Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- questions were mostly about different Facebook features and apps.
- Projects
- core java and db questions
- How sorting in database works? - merge sort/external sort depending on memory
- What is a linked list?
- 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.
- Behavioral questions
- Basic OOD questions
- Why Walmart
- 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.
- Would you rather be an individual contributor or work in a team?
- Where do you see yourself in 5 years
- 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.
- System design: please design TinyURL.
- Course schedule
- FizzBuzz
- Searching an element in BST, Design Questions mostly, Stock Price question,
- public Node search(Node root, int key)
- {
- // Base Cases: root is null or key is present at root
- if (root==null || root.key==key)
- return root;
- // val is greater than root's key
- if (root.key > key)
- return search(root.left, key);
- // val is less than root's key
- return search(root.right, key);
- }
- Restful web services
- implement a reservation algorithm
- implement some sort algorithm
- Validate BST
- Get max width of a binary tree
- • Get the maximum profit if the shares can be bought and sold on any day Answer Question
- • Write an hash function to generate values between 20-100 1 Answer
- • Find the missing number in a randomly sorted array Answer Question
- • Generate all possible ip address given an ip address Answer Question
- • Given all robotic directions.. Give the shortest distance to reach the same destination
- • OOP -Conceptual
- • pattern matching question
- Subtree of a tree
- Print the matrix in zigzag form. – spiral and diagonal traversal
- Notes about each data structure
- All runtimes
- hanoi tower puzzle
- Explain how and when Cassandra and other No-SQL databases take advantage to SQL databases like Oracle, DB2, MS-SQLServer etc.
- Median in incoming stream of number.
- Longest Increasing subsequence.
- Dictionary word problem,
- K reversal of link list.
- Max area under Histogram.
- Various type of caching techniques.
- Linear and logistic regression.
- Trashing in OS.
- How can you avoid trashing.
- Deadlock avoidance.
- 1.An array in which each element occurs in pairs except one. How can u find it?
- 2.Check whether a given binary tree is binary search tree or not?
- 3.How to check whether a given point lies in a triangle or not?
- 4. Implement a stack using 2 queues.
- 5. What is paging? Difference b/w paging and segmentation?
- 6. Different types of memories.(primary,secondary)
- 7. How will u search in a rotated array in minimum time complexity?
- 8. Print all the pairs which make sum x in an array of n integers?
- 9. Print all nodes in a binary tree in zigzag format.
- 1.Dynamic programming( longest increasing sequence)
- 2.dynamic programming (longest ap sequence)
- 3. how can generate a different string every time.
- 4. how can you compare 2 elements without using any relational operator?
- 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)
- 6. LRU cache data structure implementation.
- 7. some questions on my project.
- 8.BFS,DFS
- 1.How are some sites blocked in a particular place?
- Fibonacci series,Project explanation, tree traversal.
- Basic Computer Science algorithm and data structures questions about stacks, queues, binary trees, linked lists and hash tables, graphs
- 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.
- JVM and optimisations.
- SOA vs rest
- 1. Questions on Java Strings, Arraylist & Hashmap Implementation.
- 2. Question Based on Stream of words like Trending Tweets and some designed based questions.
- 3.discussion about hashmap and internal implementation
- 4. discussion about hashcode() and equal method in java.
- 5. questions on java collections
- asked system design question- design Facebook
- Difference between Abstract Class and Interface in Java
- In managerial round asked some questions about database and asked me to design Walmart database (system design)
- What feature of Twitter would you like to change?
- 5. Give us a way to schedule tweets right from Twitter
- 4. Make it easy to switch between Twitter accounts
- 2. Make it possible to arrange my Twitter Lists
- Topological Sort, Spiral Matrix traversal, SQL questions, Linux commands, Data structures
- 1)Reverse a String
- 2)While-infinity loop error condition
- 3)Array example
- 4)Some object oriented programming questions.
- Find Minimum in Rotated Sorted Array II.
- java dependency inject, database union all and union difference, c, which join
- union all – bring in all the rows based on the required query condition
- union – bring distinct
- SELECT col1
- FROM table1
- UNION ALL
- SELECT col2
- FROM table2;
- SELECT col1
- FROM table1
- UNION
- SELECT col2
- FROM table2;
- 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.
- Atomic: Transaction must be treated as an atomic unit.All the transactions should happen or none should happen.
- 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.
- Insolation. Same as above
- Durability. The database should be durable enough to hold all its latest updates even if the system fails or restarts.
- 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?
- 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)
- and then the third brother asked the principle of the hashmap, it seems to be often asked.
- 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.
- 2. Give the range and output the Fibonacci number column.
- 3. 3Sum variant, summing the smallest but greater than the target combination
- 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.
- 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.
- Make notes for projects
- Go through HR Doc
- Why Walmart
- Questions for interviewrs
- Query query = session.createQuery(“from Stock where stockCode = :code “);
- query.setParameter(“code”, “7277");
- List list = query.list();
- We have event driver microservices
- 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
- We picked RabbitMQ because it was easy to deploy
- 1. remove duplicate in linked list (write code)
- 2. first non repeating char in string (code)
- 2. First unique character in a stream
- 3. Walmart List
- 4. Top 145
- 5. Sort linked list
- 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.
- 7. Pascals trianle I & ii
- 8. https://leetcode.com/problems/longest-consecutive-sequence/description/
- 9. https://leetcode.com/problems/longest-increasing-subsequence/description/
- 10. Least common ancestor + valid parenthesis + length of longest Fibonacci subsequence
- 11. Simple binary tree left and right subtree inversion
- 12. Amicable number
- 13. Inorder tree traversal
- 14. fizzbuzz
- 4) Program to Implement queue using two stacks
- 5) Write a program to Sort version numbers
- 15. stack using arraylist and linkedlist
- SQL, singleton mode, database basics.
- Remembered are HashMap, LinkedList, BST, Binary Search, ArrayList, JVM, Tree Traversal, BFS, DFS, Stack, Queue. . . . .
- JRE, Garbage Collector, Singleton, Wrapper class, stack memory vs heap Memory.
- 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
- 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.
- Sort linked list n long
- • Spring helps in the creation of loosely coupled applications because of Dependency Injection.
- • 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.
- 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.
- 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.
- • 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.)
- • By DI, the responsibility of creating objects is shifted from our application code to the Spring container; this phenomenon is called IOC.
- • Dependency Injection can be done by setter injection or constructor injection.
- Twitter allows you to interact with its data i.e tweets and several other attributes using Twitter APIs. - Import Tweepy and import sparksteaming
- I have used tweepy in python to fetch the tweets.
- Kafka is a used for building real time data pipelines and streaming apps.
- Kafka stores streams of tweets in categories called topics.
- In Kafka, reach record has a key value and timestamp.
- key is the tweet id
- value is the tweet
- timestamp is when it was posted
- I have used 3 of Kafka has 3 APIs
- Producer, Consumer, Streams API
- Producer sends a msg to a kafka cluster(topics), consumer reads msgs from this topic.
- Kafka is free and useful for stream processing
- Start zookeeper for Kafka to work.
- Start kafka. Create a topic.
- Start producer console and Consumer console
- Spark is an open source processing engine built around speed and performance.
- Two python scripts,
- 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.
- It will create a text file and output all tweets being read.
- Second script –
- This script reads the messages from the topics using the kafkautils.create directstream.
- Spark streaming will read these tweets in real time in a batch interval of 5secs.
- Each tweet will be split into words and using sentiwordnet in python, all these words are given a score.
- Scores of each word will be aggregated for a sentence.
- We will set a threshold for this score, based on the threshould it be classified as positive or negative.
- 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.
- 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