🖥️
Sunil Notebook
Interview Preparation
  • 📒Notebook
    • What is this about ?
  • System Design
    • 💡Key Concepts
      • 🌐Scalability
      • 🌐Latency Vs Throughput
      • 🌐Databases
      • 🌐CAP Theorem
      • 🌐ACID Transactions
      • 🌐Rate limiting
      • 🌐API Design
      • 🌐Strong Vs eventual consistency
      • 🌐Distributed tracing
      • 🌐Synchronous Vs asynchronous Communication
      • 🌐Batch Processing Vs Stream Processing
      • 🌐Fault Tolerance
    • 💎Building Blocks
      • 🔹Message
      • 🔹Cache
      • 🔹Load Balancer Vs API Gateway
    • 🖥️Introduction to system design
    • ⏱️Step By Step Guide
    • ♨️Emerging Technologies in System Design
    • ☑️System design component checklist
      • 🔷Azure
      • 🔶AWS
      • ♦️Google Cloud
    • 🧊LinkedIn feed Design
    • 🏏Scalable Emoji Broadcasting System - Hotstar
    • 💲UPI Payment System Design
    • 📈Stock Broker System Design - Groww
    • 🧑‍🤝‍🧑Designing Instagram's Collaborative Content Creation - Close Friends Only
    • 🌳Vending Machines - Over the air Systems
    • Reference Links
  • DSA
    • Topics
      • Introduction
      • Algorithm analysis
        • Asymptotic Notation
        • Memory
      • Sorting
        • Selection Sort
        • Insertion Sort
        • Merge Sort
        • Quick Sort
        • Quick'3 Sort
        • Shell Sort
        • Shuffle sort
        • Heap Sort
        • Arrays.sort()
        • Key Points
        • Problems
          • Reorder Log files
      • Stacks and Queues
        • Stack Implementations
        • Queue Implementations
        • Priority Queues
        • Problems
          • Dijkstra's two-stack algorithm
      • Binary Search Tree
        • Left Leaning Red Black Tree
          • Java Implementations
        • 2-3 Tree
          • Search Operation - 2-3 Tree
          • Insert Operation - 2-3 Tree
        • Geometric Applications of BST
      • B-Tree
      • Graphs
        • Undirected Graphs
        • Directed Graphs
        • Topological Sort
      • Union Find
        • Dynamic Connectivity
        • Quick Find - Eager Approach
        • Quick Find - Lazy Approach
        • Defects
        • Weighted Quick Union
        • Quick Union + path comparison
        • Amortized Analysis
      • Convex Hull
      • Binary Heaps and Priority Queue
      • Hash Table vs Binary Search Trees
  • Concurrency and Multithreading
    • Introduction
    • Visibility Problem
    • Interview Questions
    • References
      • System design
  • Design Patterns
    • ℹ️Introduction
    • 💠Classification of patterns
    • 1️⃣Structural Design Patterns
      • Adapter Design Pattern
      • Bridge Design Pattern
      • Composite Design Pattern
      • Decorator Design Pattern
      • Facade Design Pattern
      • Flyweight Design Pattern
      • Private Class Data Design Pattern
      • Proxy Design Pattern
    • 2️⃣Behavioral Design Patterns
      • Chain Of Responsibility
      • Command Design Pattern
      • Interpreter Design Pattern
      • Iterator Design Pattern
      • Mediator Design Pattern
      • Memento Design Pattern
      • Null Object Design Pattern
      • Observer Design Pattern
      • State Design Pattern
      • Strategy Design Pattern
      • Template Design Pattern
    • 3️⃣Creational Design Patterns
      • Abstract Factory Design Pattern
      • Builder Design Pattern
      • Factory Method Design Pattern
      • Object Pool Design Pattern
      • Prototype Design Pattern
      • Singleton Design Pattern
    • Java Pass by Value or Pass by Reference
  • Designing Data-Intensive Applications - O'Reilly
    • Read Me
    • 1️⃣Reliable, Scalable, and Maintainable Applications
      • Reliability
      • Scalability
      • Maintainability
      • References
    • 2️⃣Data Models and Query Languages
      • Read me
      • References
    • Miscellaneous
  • Preparation Manual
    • Disclaimer
    • What is it all about?
    • About a bunch of links
    • Before you start preparing
    • Algorithms and Coding
    • Concurrency and Multithreading
    • Programming Language and Fundementals
    • Best Practices and Experience
  • Web Applications
    • Typescript Guidelines
  • Research Papers
    • Research Papers
      • Real-Time Data Infrastructure at Uber
      • Scaling Memcache at Facebook
  • Interview Questions
    • Important links for preparation
    • Google Interview Questions
      • L4
        • Phone Interview Questions
      • L3
        • Interview Questions
      • Phone Screen Questions
  • Miscellaneous
    • 90 Days Preparation Schedule
    • My Preparation for Tech Giants
    • Top Product Based Companies
  • Links
    • Github
    • LinkedIn
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Interview Questions
  2. Google Interview Questions
  3. L4

Phone Interview Questions

PreviousL4NextL3

Last updated 10 months ago

Was this helpful?

  • There is stream of float values (-inf, inf) which is coming as input and an integer D.

We need to find a set of 3 values which satisfy condition - |a - b| <= D, |b - c| <= D, |a - c| <= D, assuming a,b,c are 3 float values. Print these 3 values and remove them and continue ....

Constraints - All values in stream will be unique. D -> [0, inf)

Eg: Input stream - [1,10,7,-2,8,....], d = 5 Output - (when 8 comes, then print "7 8 10" and remove them and continue)

class Solution {
	private int D;
	void init(int d) {
		this.D = d;
	void func(float item) {
		// implement
	}
}

What data structure should be used here, and what approach can be applied? ()

  • Given one struct of time interval with using that i have to return in bool that are they overlapping 2 intervals or not. struct TimeInterval{ int id ; int startTime; int endTime; }; bool overlapping( TimeInterva t1, TimeInterva t2){} ()

  • Given stream of time interval tell that min how many cars will be used to book for all timeintervals;

    Given : {{1,3}, {2,5},{6,8},{7,10},{9,10}} output : car1 : {1,3},{6,8},{9,10} car2 : {2,5},{7,10} ()

  • Imagine we have google drive in Some other country and your code is running in another country.

    struct FilesFolders {
    	vector<string> files;
    	vector<string> folders;
    }
    
    FilesFolders FindAllFilesAndFolders(path) {
    	// network call in google drive which fetches all files and folders inside this path.
    	return FilesFolders;
    }
    
    // Implement Search method which return any path which has sub_string in it.
    string Search(string path, string sub_string) {
    
    }
    
    Expectation: -> Implement this Search method and give time complexity according to network latency for google drive.
    Solution -> A recurrence and focus on Time Complexity.
    
    Follow up ->
    
    New method:
    void get_async(string path, callback_func…) {
    	// creates a new thread
    	// Calls callback_func after 100ms or whenever operation done.
    	callback_func(files, folders);
    	return;
    }
    
    -> Now implement Search using new method get_async() along with time_complexities.

    ()

  • inputs:

    int n - [0..n-1] digits in the array, 
    int[]arr1 - [0, 1, 2] len 3 values will be valid and will use the digits in the range of 0 to n-1
    int[]arr2 - [2, 3, 1] len 3 values will be valid and will use the digits in the range of 0 to n-1
    arr1 and arr2 can contain duplicate values and also all values can be equal. arr1:[0, 1, 2] arr2:[0, 1, 2]
    int t - will be used to calculate upper and lower bound for each digit in the array. `0<=t<=n`.

    Function signature

    int solve(int n, int t, int[]arr1, int[]arr2) {
    }

    Return how many distinct combinations (length of 3) we can create. Distinct - order matters [0, 1, 2] [2, 0, 1] is distinct. [0, 1, 2] [0, 1, 2] not distinct E.x

    n = 3
    arr1[0, 1, 2]
    arr2[2, 0, 1]
    t = 1

  • You are given n fingerprints from 0 , 1 ,2 , 3.....(n-1). One has to generate a password of length n or greater than n, such that every fingerprint should be utilised atleast once. Write a general function, where you are given number of fingerprints and password length and print all the possible passwords.

Link
Link
Link
Link
https://leetcode.com/discuss/interview-question/5075278/Google-Phone-screen