JobsJob TrackerJob alerts

Larsen & Toubro ยท 97 questions

All 97Coding 25System Design 2Low-Level Design 8Behavioral 21Product Sense 3
  • Count palindrome words in a sentenceCoding
  • Difference between TRUNCATE and DELETE
  • What would you change in WhatsApp as a developerProduct Sense
  • What is binary search
  • Difference between an array and a linked list
  • Implementation of authentication in your Node.js projectBehavioral
  • Sum of numbers in an 18-digit alphanumeric stringCoding
  • Web calculator that shows history of calculationsCoding
  • Check the validity of a passwordCoding
  • Linear vs non-linear data structures and one to store company data
  • Extract data from two tables: foreign keys and joins
  • Differences between C, C++ and Python
  • Array vs vector, and how a map is implemented in C++
  • Kohli plays for himself - would you play for yourself rather than the teamBehavioral
  • Maximum product of a contiguous subarrayCoding
  • Machine learning, AI and how Alexa differs from other assistants
  • Extempore on blockchain or cloud computing
  • DBMS vs RDBMS, primary vs foreign key, current SQL version
  • Hobbies, role model, emerging technologies and career aspirationsBehavioral
  • Constructors and their types
  • Inheritance and function overriding
  • Difference between NULL and void pointer
  • Print all permutations of a stringCoding
  • Bond and relocation, goals and why LTIBehavioral
  • Minimum adjacent swaps to make a string a palindromeCoding
  • Basic IT Subjects and Concepts DiscussionLow-Level Design
  • Personal Interview with DBMS QuestionBehavioral
  • Difficult situation in life and how you tackled itBehavioral
  • Strengths and weaknesses, project role, certifications, internshipBehavioral
  • C memory allocation, structures, pointers, dangling and null pointers
  • Factorial logic and swapping without a temp variableCoding
  • Logic for prime numbersCoding
  • Smallest and largest element; remove duplicates; detect duplicates among 100Coding
  • Functions, local vs global variables, numpy
  • Joins, keys, specialization/generalization, indexes
  • Select top 10 rows, update a tuple; truncate vs delete and rollbackCoding
  • Sorting algorithms, merge vs heap sort, bubble sort
  • Stack vs queue, linked list, best structure for strings, HashMap
  • Encapsulation vs abstraction, polymorphism, static class, garbage collection
  • Algorithm for a Microsoft Teams-like appSystem Design
  • Languages in home appliances; building program; Java improvements
  • Pandemic activities, coding languages, project explanationBehavioral
  • Modify an e-commerce website; OOP basics; SDLC steps
  • Why Indian economy slowed down; current technologyBehavioral
  • Planning vs execution; hard vs smart workBehavioral
  • Three reasons to hire you; non-technical departmentBehavioral
  • Why aptitude matters; best and worst parts of the online assessmentBehavioral
  • Example of dedication; why LTI; flexibility with bond and relocationBehavioral
  • Max Candies Bought Using Palindromes Within Range and BudgetCoding
  • Write test cases for a table
  • Code to send a packet from A to DCoding
  • Python Control Flow and OOPsCoding
  • Explain polymorphism and its typesCoding
  • Probability of getting a 3 on one or both dice
  • Number Series ProblemCoding
  • Add Features to WhatsAppProduct Sense
  • Create a student table in C++
  • Explain the five pillars of OOPS
  • Pseudocode on function overloading and overriding
  • Check if a string or number is a palindromeCoding
  • What are class loader and bootstrap loader?
  • Array initialization and static keyword in C++
  • Technical subject questions
  • OOP and SQL concepts
  • Explain Joins in SQL.
  • Difference between mutable and immutable objects.
  • Difference between C and C++.
  • What is Inheritance?Low-Level Design
  • Explain SDLC.
  • Which feature would you add to WhatsApp?Product Sense
  • How does Google search engine work?System Design
  • Basic coding questionCoding
  • Sort array by k-elementsCoding
  • Swapping methodsCoding
  • Polymorphism and Inheritance
  • Handling strict deadlines and rude managementBehavioral
  • Array operation coding questionCoding
  • Difference between C and C++ and OOPs concepts
  • HR introduction and background questionsBehavioral
  • Infinity Coding Challenge AssessmentCoding
  • OOP Concepts, Polymorphism, and Error Handling in C++Low-Level Design
  • Introduction and Behavioral SituationsBehavioral
  • ML Libraries and Concepts
  • InheritanceLow-Level Design
  • Min/Max and Missing ElementCoding
  • Explain Data Structures and Stack
  • What does M25 mean in concrete, and what governs its strength?Low-Level Design
  • How are shear force and bending moment diagrams related?Low-Level Design
  • State the laws of thermodynamics and explain entropy.Low-Level Design
  • What does a stress-strain curve show, and how do stress and strain differ?Low-Level Design
  • What experience do you have in the engineering field?Behavioral
  • Tell me about yourselfBehavioral
  • Why Larsen & Toubro?Behavioral
  • Why should we hire you?Behavioral
  • Strengths and weaknessesBehavioral
  • Online Assessment covering Quantitative, Logical, Verbal, and CodingCoding
  • Java Fundamentals and Coding QuestionsCoding
โ† Larsen & Toubro questions
  1. Interview questions
  2. Larsen & Toubro
  3. Logic for prime numbers
Coding

Logic for prime numbers

Filed under Larsen & Toubro

The question

Asked for logic to find primes.

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

Related Larsen & Toubro questions

  • Count palindrome words in a sentence
  • Sum of numbers in an 18-digit alphanumeric string
  • Web calculator that shows history of calculations
  • Check the validity of a password
  • Maximum product of a contiguous subarray
โ† Factorial logic and swapping without a temp variableSmallest and largest element; remove duplicates; detect duplicates among 100 โ†’

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