Computer Architecture & Low Level Interview Questions
- 0of 0 votes
AnswersDesign a distributed key-value store that can perform the following
- neer.1304 May 27, 2020 in United States
Store a set of attributes (value) against a particular key (k)
Fetch the value stored against a particular key (k)
Delete a key (k)
- Perform a secondary index scan to fetch all key along with their attributes where one of the attribute values is v.
Key can have a value consisting of multiple attributes.
Each attribute will have name, type associated (primitive types - boolean, double, integer, string) & type has to be identified at run time.
Ex -
1) Key = delhi has 2 attributes ( pollution_level & population)
2) Key = jakarta has 3 attributes (latitude, longitude, pollution_level)
3) Key = bangalore has 4 attributes (extra - free_food)
4) Key = india has 2 attributes (capital & population)
5) Key = crocin has 2 attributes (category & manufacturer)
Example of Secondary index:
Get all keys (cities) where pollution_level is high. Get all medicines by manufacturer (GSK)
So, in a nutshell, value must be strongly typed when defined.
Attribute
1. Attribute is uniquely identified by its name (latitude, longitude etc.
2. Data type of the attribute is defined at the first insert. (i.e. data type of pollution_level is set when key = delhi is inserted)
3. Once data type is associated with a particular attribute, it cannot be changed.
(i.e. free_food when defined takes type = boolean, hence, any key when using the attribute - free_food must allow only boolean values on subsequent inserts/updates)
Non-functional requirements
Highly scalable - Support for high throughput with very low latency
Highly available
Shared nothing architecture i.e. Support for Multiple nodes and each node is independent & self-sufficient.
Stretch - Smart client i.e. clients being aware of available servers & makes smart routing based on that available information.| Report Duplicate | Flag | PURGE
Amazon Principal Software Engineer Computer Architecture & Low Level - 0of 0 votes
AnswersDesign twitter trending topics feature to show trending topics in past 24 hours.
- neer.1304 May 24, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Computer Architecture & Low Level - 0of 0 votes
AnswersWe tend to use computer to solve practical problems that actually earns or save dollars. Here is something that happens across the stock exchanges : people buy and sell stocks.
- NoOne October 15, 2016 in India
We generally use automated intelligent systems to buy and sell stocks. That part is too much mathematics, and beyond scope of this interview. There is another part. Suppose the system issues a buy order : buy 1000 Microsoft stock. Now, there are more than 1 ( in fact 10 ) active exchanges from where we can buy MSFT. There is a slight price delta, which keeps changing over time. There is another problem. In each stock exchange, prices are stacked, that is :
1. For first 100 stocks prices are 55$.
2. Next 200 stocks, prices are 55.2$.
... etc, and you got the idea. Even this stacks are changing over time.
Thus, here is the problem to solve. Design and implement a system such that one can buy n stocks with minimal price.
Also, in the same spirit, the same system should be able to sell n stocks with maximum payoff possible.
This is a non trivial problem, for Quant systems.
There are always k no of exchanges to hit.| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Algorithm Cache Computer Architecture & Low Level Computer Science Distributed Computing Large Scale Computing Math & Computation Software Design - 0of 0 votes
AnswersNone actually understands how garbage collection works, albeit people ask this in the interviews. Nonetheless, we are going to ask you something very similar. Here is the problem.
Take an array of bytes, perhaps 1MB in size.
Implement these two operations:ptr_structure = alloc ( amount_of_storage ) freeed = free ( ptr_structure )
Now, here is your problem. alloc must allocate contiguous storage. If it is not possible, you need to compact ( defragment ) memory. So, you need to implicitly write a :
defragment() // defragments memory
Worse is coming. Even imagining you have written a stop the world defragmenter, after you reallocate, how the ptr_structures would actually work?
- NoOne October 14, 2016 in India
Solve this whole problem.
Time allocated was 1 hour. Face to face, panel with 2 interviewers.| Report Duplicate | Flag | PURGE
SDET Algorithm Assembly Computer Architecture & Low Level Computer Science Data Structures - 0of 0 votes
AnswerAn instruction pipeline has the speedup factor 10 while operation with 80% efficiency. What could be the number of stages in the pipeline?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Computer Architecture & Low Level - 0of 0 votes
AnswerConsider a four stage pipeline with the respective delays t1=60nSeconds, t2=70nSeconds, t3=100nSeconds, t4=80nSeconds and the latch delay of 10nSeconds. What is the approximate speedup when the very large number of instructions on pipeline?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Computer Architecture & Low Level - 0of 0 votes
AnswersSuppose that a system taken 90% of the computation can be parallelized, What is the maximum speedup we can except from 8 processors according to the Amdahl’s law?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Computer Architecture & Low Level - 0of 0 votes
AnswersThe following is the design question I was asked.
- gopi.komanduri July 26, 2016 in India
Design a dash board.
Should be very realistic.
Should be scalabe .
Should have very less latency .
Can expect millions of updates per second.
Dash board should show :
for each day :
1. city name ,
2.total trips in that city for that day ,
3.total fare it could collect in that city on that day,
4. fare collected from old clients
5. fare collected from new clients (new client is the client who is having his first ride in Uber after registration)
Input : we get two strings s1 , s2.
the format of s1 : trip_id , client_id , city , datetime
the format of s2 : trip_id , fare.
Could you please suggest how to proceed for this kind of question?| Report Duplicate | Flag | PURGE
StartUp Analyst Algorithm Business Question Cache Computer Architecture & Low Level Data Structures Distributed Computing Hash Table Ideas System Design - 0of 0 votes
AnswersHow can you read from disc such that you optimize the latency of the data read/writes?
- Ray November 21, 2015 in United States| Report Duplicate | Flag | PURGE
Google SDE1 Computer Architecture & Low Level - 0of 0 votes
AnswersSuppose we have two CPUs, each has an L1 cache associated with it. An L2 cache is shared by the two CPUs, and it requests data from DRAM:
- lou October 27, 2015 in United States
|CPU0| |CPU1|
|L1Cache0| |L1Cache1|
|Shared L2C|
|DRAM|
Let's say CPU0 and CPU1 send out a write signal at the same time:
- At timestamp 0, CPU0 sends a wr request - write address A to 0;
- Also at timestamp 0, CPU1 sends a wr request - write address A to 1;
- At timestamp 0, all of the L1/L2 caches are empty, i.e. write req will result in a miss in the cache;
- At timestamp 0, data in address A in DRAM is 100;
- Cache coherency protocol is MOESI.
What will the values be after these two writes complete? In L1, L2 and DRAM? and what are the states in each cache?| Report Duplicate | Flag | PURGE
Google Systems Design Engineer Computer Architecture & Low Level - 0of 0 votes
Answersyou wrote a c++ program and your processor change (eg. from intel to ARM or anything ) then what are thing needs to be change in compiler to get the same behavior of program in different (eg. ARM ) architecture machine.
- NEO November 01, 2014 in India| Report Duplicate | Flag | PURGE
Motorola SDE1 Compiler Computer Architecture & Low Level - 0of 2 votes
AnswersDesign a system like friend's functionality in facebook. should have all features of facebook's friends functionality. like for each person , he can have any number of friends , he will get suggestions for new firends , showing common friends if we visits any other profile . algo should be scalable , robust .
- gopi.komanduri August 02, 2014 in United States| Report Duplicate | Flag | PURGE
Computer Scientist Algorithm Android Application / UI Design Arrays Bit Manipulation C# C++ Cache Coding Computer Architecture & Low Level Data Mining Data Structures Database Distributed Computing Dynamic Programming Hash Table Java Large Scale Computing Linked Lists Math & Computation Object Oriented Design Problem Solving Sorting SQL Stacks System Design Trees and Graphs XML - 0of 0 votes
AnswersDesign a phone book such that fields are searchable with name , with number. Later enhanced teh question asking searchable with address as well.
- gopi.komanduri July 22, 2014 in India| Report Duplicate | Flag | PURGE
Analyst Algorithm Arrays Bit Manipulation Brain Teasers C# C++ Cache Coding Computer Architecture & Low Level Data Mining Data Structures - 1of 3 votes
AnswersDesign a telephone directory for large ppl (he gave example like design for India). fields will be , first name , last name , number . this should be searchable with first name , last name , number as welll.
- gopi.komanduri July 04, 2014 in India
later added more complexity like do the same for organisation where even it contains designations. so this should be searchable with designations.| Report Duplicate | Flag | PURGE
Analyst Algorithm Arrays C C++ Cache Coding Computer Architecture & Low Level Data Mining Data Structures Dynamic Programming Hash Table Ideas Large Scale Computing Linked Lists Object Oriented Design Problem Solving Trees and Graphs - 0of 0 votes
AnswerI was asked to design a trading system, where there will be no of buyers and sellers will transact. The system need to have low latency, the buyers will quote no of shares, company name, price they want to buy, the sellers will quote the price they want to sell for given company, and no of shares. The system has to match the buyers and sellers and transact. This is more of design question.
- softwaregeek June 09, 2014 in India
I was thinking in terms of a hashmap kind a structure where the key will hash to the given company, and then there will be buckets for no of shares for buyers, with different buckets for prices, the idea is to look up in memory sellers, if a match is found then make the transaction. If the in memory data exceeds a limit implement a caching, and push the older data to the persistent store. The guy was'nt convinced this was a good design. Can someone suggest how is real time trading systems implemented, do they go for low latency queues.| Report Duplicate | Flag | PURGE
InMobi Developer Program Engineer Computer Architecture & Low Level - 0of 0 votes
AnswersWrite a piece of code to find out if the system is x86 architecure of Sparc
- gjp February 24, 2014 in United States| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer Intern C Computer Architecture & Low Level - 1of 1 vote
AnswersCould you replace the CPU cache with an SRAM? If you can what would be an advantage and disadvantage
- sambangi.ramesh86 November 27, 2013 in United States| Report Duplicate | Flag | PURGE
Computer Architecture & Low Level - 4of 4 votes
AnswersYou have written a memory manager and after using it your coworker complains that he is facing severe issues of fragmentation. What could be the reason(s) and how can you fix it
- vik October 04, 2013 in United States| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer Computer Architecture & Low Level Debugging Operating System - 1of 1 vote
AnswersDescribe the design of a low latency distributed environment where multiple processes( or threads) need to access shared data structure or a database for a fast ( speaking of a fraction of a milisecond) read or update. You have to process tons of request very quickly ( you can think of market price data as an example, etc). How would you build such an environment in the most efficient way? Describe the solution in details(a few sentences).
- curious September 06, 2013 in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Senior Software Development Engineer Computer Architecture & Low Level - -3of 3 votes
AnswersHow to monitor health of the system?
- testcareercup June 26, 2013 in United States for Mobile| Report Duplicate | Flag | PURGE
Samsung Quality Assurance Engineer Computer Architecture & Low Level - 0of 0 votes
AnswersOpen two instances of Microsoft Word and print to printer simultaneously. How would the underlying printer driver work? How would you design the printer driver?
- masrur.macece June 26, 2013 in United States for Windows Hyper-V| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Computer Architecture & Low Level - -5of 7 votes
Answersneed to implement a weather report functionality. user will provide the city name , need to return the weather report.
- gopi.komanduri May 29, 2013 in India
if weather station exists n functioning properly , will return the weather report of that station .
else ,
will return the nearest available weather station report.
interviewer looking for optimized manner.
looking for datastructures to stores the cities n algo to return the report.| Report Duplicate | Flag | PURGE
Mentor Graphics Analyst Algorithm Arrays Bit Manipulation Brain Teasers C C# C++ Cache Coding Computer Architecture & Low Level Data Mining Data Structures Dynamic Programming General Questions and Comments Graphics Hash Table Ideas Linked Lists Math & Computation Object Oriented Design Problem Solving Sets Sorting Stacks String Manipulation Terminology & Trivia Threads Trees and Graphs XML - 2of 2 votes
AnswersWhat is the difference between a computers heap and it's stack?
- brighama March 29, 2013 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Computer Architecture & Low Level - 2of 2 votes
AnswersDuring boot, after the BIOS performs a successful power-on-self-test, describe everything that occurs until the console is presented to the user.
- longbelly March 21, 2013 in United States| Report Duplicate | Flag | PURGE
Google Site Reliability Engineer Computer Architecture & Low Level - 0of 2 votes
AnswersHow can you tell if your system is little endian or big endian?
- vikaskupushkar March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Qualcomm Developer Program Engineer Computer Architecture & Low Level - 1of 1 vote
AnswersSequence of steps that happen in CPU, cache, TLB, VM, HDD leading to execution of “x = 7” which isn’t present in cache or sysmem nor translation in TLB. Also specify if any intrs, exceptions or faults are generated.
- ANKSCIRCLE October 20, 2012 in United States| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer Computer Architecture & Low Level - 0of 0 votes
AnswerDesign a system for the customer to review a product. It should be able to incorporate web-services. Describe the entire flow from the client to the database.
- Naveen Reddy Mandadi August 30, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Applications Developer Computer Architecture & Low Level Data Structures Application / UI Design - 0of 0 votes
AnswersAt the Kernel level, if you want to write a memory leak analyzer, how will you implement it?
- snehaldesh1 June 26, 2012 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Computer Architecture & Low Level - 0of 0 votes
AnswersWhat is a process.
- Terry April 21, 2012 in United States
What is a stack.
How many stacks can a process have.
What is a thread.
How many threads can a process have.
Do the threads have their own stacks, or share the process stack(s), or both?| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Computer Architecture & Low Level