Texas Instruments

Online Assessment

Texas InstrumentsOnline Assessment

Company-style OA practice sets with full problem statements, sample test cases, and solutions.

5 Sets2 Questions/Set90 minArrayHash TableStringSortingDynamic Programming

๐Ÿ’ฐ Contribute & Earn

Have you recently taken Texas Instruments's Online Assessment or coding test? Share the questions, test cases, or assessment patterns you encountered. Earn SWE180 Coins for every verified submission and use them to unlock other company OA sets and premium tools for free!

Share OA & Earn Coins โž”

Practice Sets

Community OA โ€” Software Engineer / Firmware Engineer ยท 0-1 YOE ยท 2026

2 questions
Q1.
Most Frequent N-Gram
StringsHash TableSliding Window
Easy

Problem Statement

The term N-gram refers to all possible substrings of length N formed using consecutive letters contained in a string. Given a string S and an integer N, find the most frequent N-gram and the number of times it appears in S.

If there is more than one N-gram with the same maximum frequency, print the first one that appears in S.

Input Format

  • A single line of input contains string S and integer N separated by a single white space.

Output Format

  • The output contains a string denoting the most frequent N-gram and an integer denoting the number of times the N-gram appears in S, separated by a single white space.

Constraints

  • 1 <= |S| <= 100
  • 1 <= N <= 10
  • N <= |S|

Sample Test Cases

Example 1

Input

banana 3

Output

ana 2

Explanation

The string S is 'banana' and N = 3.

All the 3-grams and their frequencies are:

- 'ban': 1

- 'ana': 2 (at indices 1..3 and 3..5)

- 'nan': 1

The most frequent 3-gram is 'ana' with frequency 2.

Example 2

Input

isamohanaismohana 3

Output

moh 2

Explanation

The 3-grams appearing with max frequency 2 include 'moh', 'oha', 'han', and 'ana'. 'moh' appears first in S (starting at index 3), so 'moh 2' is printed.

Approach:1. Iterate through string S from index 0 to |S| - N. 2. Extract each substring `sub = S.substr(i, N)`. 3. Count occurrences using a hash map `freq[sub]` and track the first occurrence index `firstSeen[sub] = i`. 4. Find the substring with maximum frequency. If frequencies tie, pick the one with the smallest first occurrence index. 5. Print `<ngram> <frequency>`.
Q2.
Drop Array Elements by Indices
ArraysHash SetImplementation
Easy

Problem Statement

You are given an array A of size n containing positive integers, along with another array X of size m that specifies the indices of elements to be dropped from array A.

Your task is to remove the elements at the specified indices from array A and print the modified array as the output.

Input Format

  • First line: integer n displaying the size of array A.
  • Second line: n space-separated positive integers (elements of array A).
  • Third line: integer m displaying the size of array X.
  • Fourth line: m space-separated integers (0-based indices to drop from array A).

Output Format

  • A single line displaying the elements of the modified array after dropping the elements, separated by single spaces.

Constraints

  • 1 <= n <= 10^4
  • 1 <= m < 10^4
  • m < n
  • All elements of array X are distinct and in range [0, n - 1].
  • Indices are 0-based.
  • Elements of array X cannot be negative.

Sample Test Cases

Example 1

Input

4
1 2 3 4
2
2 3

Output

1 2

Explanation

Array A is [1, 2, 3, 4] of size 4.

Indices to drop are [2, 3] (elements 3 and 4).

After dropping, remaining elements are 1 2.

Example 2

Input

5
10 20 30 40 50
1
0

Output

20 30 40 50

Explanation

Drop index 0 (element 10). Remaining elements are 20 30 40 50.

Approach:1. Store all indices from array X into a boolean array `dropped[n]` or a hash set for O(1) lookups. 2. Iterate through array A from index 0 to n - 1. 3. If `!dropped[i]`, output element A[i]. 4. Runs in O(N + M) time and O(N) space.

Comprehensive Texas Instruments Online Assessment Patterns & Questions

Gain complete transparency into the Texas Instruments online assessment process. Prepare effectively with real, verified coding challenges, test patterns, and platform details.

Texas Instruments Exact Coding Questions

Wondering what top companies are actually asking in their initial screening rounds? We provide exact Data Structures, Algorithms, and logical reasoning questions reported by candidates who recently took the Texas Instruments online tests. Stop guessing and start practicing the right problems.

Test Patterns & Platforms

Understand exactly how many questions to expect, the typical time limits, and the platforms used (e.g., HackerRank, Codility, CodeSignal). Knowing the format in advance is the first step to clearing the Texas Instruments OA.

๐Ÿ”ฅ Why practice these assessments?

  • โœ“High ROI: Most candidates are filtered out at the OA stage. Passing the OA guarantees an interview.
  • โœ“Real Edge Cases: We include not just the problem statements, but the hidden constraints and edge cases you need to pass all test cases.
  • โœ“Optimal Solutions: Learn the time and space complexities required to score perfectly in automated grading systems.