JobsJob TrackerJob alerts

ClearTrail ยท 17 questions

All 17Coding 7System Design 2Low-Level Design 1
  • Sorting types, complexities, and graphs
  • TCP/IP vs UDP and Process vs Processor
  • Java Strings, Immutable Class, and Singleton ClassLow-Level Design
  • Check whether an element is present in both arraysCoding
  • Check if an array is sortedCoding
  • Find n odd integers by recursionCoding
  • Design an app like WhatsAppSystem Design
  • Explain 4 principles of OOPs
  • Difference between Object Overloading and Object Overriding
  • SQL query for highest salary in IT departmentCoding
  • What are ACID properties in SQL?
  • Coconut checkpoint puzzle
  • Swap first and last digit of a numberCoding
  • Auto tyre distance puzzle
  • Palindrome checkCoding
  • Find kth bitCoding
  • Design module for min/max frequencySystem Design
โ† ClearTrail questions
  1. Interview questions
  2. ClearTrail
  3. Check whether an element is present in both arrays
Coding

Check whether an element is present in both arrays

Filed under ClearTrail

The question

Given two arrays, find and output the elements present in both arrays, optimizing from naive O(n^2) to O(n).

No write-up yet. Related questions below have one.

Related ClearTrail questions

  • Check if an array is sorted
  • Find n odd integers by recursion
  • SQL query for highest salary in IT department
  • Swap first and last digit of a number
  • Find kth bit
โ† Java Strings, Immutable Class, and Singleton ClassCheck if an array is sorted โ†’

Collected from public candidate posts and coding forums. Updated Nov 2026.